@selfcommunity/react-templates 0.4.5-courses.196 → 0.4.5-courses.198
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LessonAppbarProps, LessonDrawerProps } from '@selfcommunity/react-ui';
|
|
1
|
+
import { LessonAppbarProps, LessonDrawerProps, SCLessonActionsType } from '@selfcommunity/react-ui';
|
|
2
2
|
export interface LessonProps {
|
|
3
3
|
/**
|
|
4
4
|
* Overrides or extends the styles applied to the component.
|
|
@@ -52,6 +52,11 @@ export interface LessonProps {
|
|
|
52
52
|
* @default null
|
|
53
53
|
*/
|
|
54
54
|
onActivePanelChange?: (panel: any) => void;
|
|
55
|
+
/**
|
|
56
|
+
* If passed renders the component with a specific section opened
|
|
57
|
+
* @default null
|
|
58
|
+
*/
|
|
59
|
+
lessonAction?: SCLessonActionsType;
|
|
55
60
|
/**
|
|
56
61
|
* Any other properties
|
|
57
62
|
*/
|
|
@@ -42,7 +42,7 @@ function Lesson(inProps) {
|
|
|
42
42
|
props: inProps,
|
|
43
43
|
name: constants_1.PREFIX
|
|
44
44
|
});
|
|
45
|
-
const { className = null, courseId, sectionId, lessonId, LessonAppbarProps = {}, LessonDrawerProps = {}, editMode = false, previewMode = false, onEditModeClose = null, onLessonChange = null, onActivePanelChange = null } = props, rest = tslib_1.__rest(props, ["className", "courseId", "sectionId", "lessonId", "LessonAppbarProps", "LessonDrawerProps", "editMode", "previewMode", "onEditModeClose", "onLessonChange", "onActivePanelChange"]);
|
|
45
|
+
const { className = null, courseId, sectionId, lessonId, LessonAppbarProps = {}, LessonDrawerProps = {}, editMode = false, previewMode = false, onEditModeClose = null, onLessonChange = null, onActivePanelChange = null, lessonAction = null } = props, rest = tslib_1.__rest(props, ["className", "courseId", "sectionId", "lessonId", "LessonAppbarProps", "LessonDrawerProps", "editMode", "previewMode", "onEditModeClose", "onLessonChange", "onActivePanelChange", "lessonAction"]);
|
|
46
46
|
// HOOKS
|
|
47
47
|
const theme = (0, material_1.useTheme)();
|
|
48
48
|
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
@@ -56,7 +56,7 @@ function Lesson(inProps) {
|
|
|
56
56
|
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
57
57
|
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
58
58
|
// STATE
|
|
59
|
-
const [activePanel, setActivePanel] = (0, react_1.useState)(
|
|
59
|
+
const [activePanel, setActivePanel] = (0, react_1.useState)(lessonAction);
|
|
60
60
|
const [settings, setSettings] = (0, react_1.useState)(null);
|
|
61
61
|
const [updating, setUpdating] = (0, react_1.useState)(false);
|
|
62
62
|
const [lessonContent, setLessonContent] = (0, react_1.useState)('');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LessonAppbarProps, LessonDrawerProps } from '@selfcommunity/react-ui';
|
|
1
|
+
import { LessonAppbarProps, LessonDrawerProps, SCLessonActionsType } from '@selfcommunity/react-ui';
|
|
2
2
|
export interface LessonProps {
|
|
3
3
|
/**
|
|
4
4
|
* Overrides or extends the styles applied to the component.
|
|
@@ -52,6 +52,11 @@ export interface LessonProps {
|
|
|
52
52
|
* @default null
|
|
53
53
|
*/
|
|
54
54
|
onActivePanelChange?: (panel: any) => void;
|
|
55
|
+
/**
|
|
56
|
+
* If passed renders the component with a specific section opened
|
|
57
|
+
* @default null
|
|
58
|
+
*/
|
|
59
|
+
lessonAction?: SCLessonActionsType;
|
|
55
60
|
/**
|
|
56
61
|
* Any other properties
|
|
57
62
|
*/
|
|
@@ -40,7 +40,7 @@ export default function Lesson(inProps) {
|
|
|
40
40
|
props: inProps,
|
|
41
41
|
name: PREFIX
|
|
42
42
|
});
|
|
43
|
-
const { className = null, courseId, sectionId, lessonId, LessonAppbarProps = {}, LessonDrawerProps = {}, editMode = false, previewMode = false, onEditModeClose = null, onLessonChange = null, onActivePanelChange = null } = props, rest = __rest(props, ["className", "courseId", "sectionId", "lessonId", "LessonAppbarProps", "LessonDrawerProps", "editMode", "previewMode", "onEditModeClose", "onLessonChange", "onActivePanelChange"]);
|
|
43
|
+
const { className = null, courseId, sectionId, lessonId, LessonAppbarProps = {}, LessonDrawerProps = {}, editMode = false, previewMode = false, onEditModeClose = null, onLessonChange = null, onActivePanelChange = null, lessonAction = null } = props, rest = __rest(props, ["className", "courseId", "sectionId", "lessonId", "LessonAppbarProps", "LessonDrawerProps", "editMode", "previewMode", "onEditModeClose", "onLessonChange", "onActivePanelChange", "lessonAction"]);
|
|
44
44
|
// HOOKS
|
|
45
45
|
const theme = useTheme();
|
|
46
46
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
@@ -54,7 +54,7 @@ export default function Lesson(inProps) {
|
|
|
54
54
|
const { enqueueSnackbar } = useSnackbar();
|
|
55
55
|
const scRoutingContext = useSCRouting();
|
|
56
56
|
// STATE
|
|
57
|
-
const [activePanel, setActivePanel] = useState(
|
|
57
|
+
const [activePanel, setActivePanel] = useState(lessonAction);
|
|
58
58
|
const [settings, setSettings] = useState(null);
|
|
59
59
|
const [updating, setUpdating] = useState(false);
|
|
60
60
|
const [lessonContent, setLessonContent] = useState('');
|