diff --git a/public/react/src/common/context/ThemeContext.js b/public/react/src/common/context/ThemeContext.js new file mode 100644 index 000000000..e4fe3da89 --- /dev/null +++ b/public/react/src/common/context/ThemeContext.js @@ -0,0 +1,17 @@ +import React from 'react' + +export const themes = { + light: { + foreground: '#000000', + background: '#eeeeee', + foreground_select: '#4CACFF' + }, + dark: { + foreground: '#ffffff', + background: '#222222', + }, +}; + +export const ThemeContext = React.createContext( + themes.light // default value +); diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index f5b8d0430..263e08808 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -27,6 +27,8 @@ export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER , EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const' +export { themes, ThemeContext } from './context/ThemeContext' + export { ModalHOC } from './components/ModalHOC' export { default as Cropper } from './components/Cropper' export { default as ConditionToolTip } from './components/ConditionToolTip' diff --git a/public/react/src/modules/courses/members/modal/AddStudentModal.js b/public/react/src/modules/courses/members/modal/AddStudentModal.js index cb40c1983..c3d8cdd75 100644 --- a/public/react/src/modules/courses/members/modal/AddStudentModal.js +++ b/public/react/src/modules/courses/members/modal/AddStudentModal.js @@ -5,7 +5,7 @@ import ModalWrapper from "../../common/ModalWrapper" import InfiniteScroll from 'react-infinite-scroller'; import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from '../common' import NoneData from '../../coursesPublic/NoneData' -import { ConditionToolTip } from 'educoder' +import { ConditionToolTip, ThemeContext } from 'educoder' import SchoolSelect from '../../coursesPublic/form/SchoolSelect' const Option = Select.Option; @@ -151,6 +151,7 @@ class AddStudentModal extends Component{ const { users, checkBoxValues, loading, hasMore, name, school_name , courseGroup, course_groups,isSpin } = this.state const { moduleName } = this.props + let theme = this.context; return( { return (

- + 12 }> @@ -254,7 +255,8 @@ class AddStudentModal extends Component{ - +

) @@ -274,4 +276,6 @@ class AddStudentModal extends Component{ ) } } + +AddStudentModal.contextType = ThemeContext; export default AddStudentModal;