@selfcommunity/react-templates 0.4.5-courses.178 → 0.4.5-courses.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/Lesson/Lesson.d.ts +0 -5
- package/lib/cjs/components/Lesson/Lesson.js +2 -2
- package/lib/esm/components/Lesson/Lesson.d.ts +0 -5
- package/lib/esm/components/Lesson/Lesson.js +2 -2
- package/lib/umd/{649.js → 461.js} +2 -2
- package/lib/umd/react-templates.js +1 -1
- package/package.json +6 -6
- /package/lib/umd/{649.js.LICENSE.txt → 461.js.LICENSE.txt} +0 -0
|
@@ -40,14 +40,14 @@ function Lesson(inProps) {
|
|
|
40
40
|
props: inProps,
|
|
41
41
|
name: constants_1.PREFIX
|
|
42
42
|
});
|
|
43
|
-
const { className = null, courseId, sectionId, lessonId, LessonAppbarProps = {}, LessonDrawerProps = {},
|
|
43
|
+
const { className = null, courseId, sectionId, lessonId, LessonAppbarProps = {}, LessonDrawerProps = {}, editMode = false, onEditModeClose = null, onLessonChange = null, onActivePanelChange = null } = props, rest = tslib_1.__rest(props, ["className", "courseId", "sectionId", "lessonId", "LessonAppbarProps", "LessonDrawerProps", "editMode", "onEditModeClose", "onLessonChange", "onActivePanelChange"]);
|
|
44
44
|
// HOOKS
|
|
45
45
|
const theme = (0, material_1.useTheme)();
|
|
46
46
|
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
47
47
|
const [_lessonId, setLessonId] = (0, react_1.useState)(lessonId);
|
|
48
48
|
const [_sectionId, setSectionId] = (0, react_1.useState)(sectionId);
|
|
49
49
|
const { scLesson, setSCLesson } = (0, react_core_1.useSCFetchLesson)({ id: _lessonId, courseId, sectionId: _sectionId });
|
|
50
|
-
const { scCourse, setSCCourse } = (0, react_core_1.useSCFetchCourse)({ id: courseId, params: { view:
|
|
50
|
+
const { scCourse, setSCCourse } = (0, react_core_1.useSCFetchCourse)({ id: courseId, params: { view: editMode ? api_services_1.CourseInfoViewType.EDIT : api_services_1.CourseInfoViewType.USER } });
|
|
51
51
|
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
52
52
|
// STATE
|
|
53
53
|
const [activePanel, setActivePanel] = (0, react_1.useState)(null);
|
|
@@ -38,14 +38,14 @@ export default function Lesson(inProps) {
|
|
|
38
38
|
props: inProps,
|
|
39
39
|
name: PREFIX
|
|
40
40
|
});
|
|
41
|
-
const { className = null, courseId, sectionId, lessonId, LessonAppbarProps = {}, LessonDrawerProps = {},
|
|
41
|
+
const { className = null, courseId, sectionId, lessonId, LessonAppbarProps = {}, LessonDrawerProps = {}, editMode = false, onEditModeClose = null, onLessonChange = null, onActivePanelChange = null } = props, rest = __rest(props, ["className", "courseId", "sectionId", "lessonId", "LessonAppbarProps", "LessonDrawerProps", "editMode", "onEditModeClose", "onLessonChange", "onActivePanelChange"]);
|
|
42
42
|
// HOOKS
|
|
43
43
|
const theme = useTheme();
|
|
44
44
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
45
45
|
const [_lessonId, setLessonId] = useState(lessonId);
|
|
46
46
|
const [_sectionId, setSectionId] = useState(sectionId);
|
|
47
47
|
const { scLesson, setSCLesson } = useSCFetchLesson({ id: _lessonId, courseId, sectionId: _sectionId });
|
|
48
|
-
const { scCourse, setSCCourse } = useSCFetchCourse({ id: courseId, params: { view:
|
|
48
|
+
const { scCourse, setSCCourse } = useSCFetchCourse({ id: courseId, params: { view: editMode ? CourseInfoViewType.EDIT : CourseInfoViewType.USER } });
|
|
49
49
|
const { enqueueSnackbar } = useSnackbar();
|
|
50
50
|
// STATE
|
|
51
51
|
const [activePanel, setActivePanel] = useState(null);
|