@selfcommunity/react-ui 0.10.2-courses.101 → 0.10.2-courses.102

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.
Files changed (44) hide show
  1. package/lib/cjs/components/Course/CreatePlaceholder.d.ts +33 -0
  2. package/lib/cjs/components/Course/CreatePlaceholder.js +59 -0
  3. package/lib/cjs/components/CourseCompletedDialog/CourseCompletedDialog.d.ts +9 -0
  4. package/lib/cjs/components/CourseCompletedDialog/CourseCompletedDialog.js +40 -0
  5. package/lib/cjs/components/CourseCompletedDialog/index.d.ts +3 -0
  6. package/lib/cjs/components/CourseCompletedDialog/index.js +5 -0
  7. package/lib/cjs/components/CourseForm/CourseForm.js +23 -11
  8. package/lib/cjs/components/CourseForm/Dialog.d.ts +8 -0
  9. package/lib/cjs/components/CourseForm/Dialog.js +19 -0
  10. package/lib/cjs/components/CourseParticipantsButton/CourseParticipantsButton.js +2 -2
  11. package/lib/cjs/components/Courses/Courses.js +3 -3
  12. package/lib/cjs/components/Courses/Skeleton.js +2 -2
  13. package/lib/cjs/components/LessonObject/LessonObject.js +14 -6
  14. package/lib/cjs/index.d.ts +2 -2
  15. package/lib/cjs/index.js +3 -3
  16. package/lib/esm/components/Course/CreatePlaceholder.d.ts +33 -0
  17. package/lib/esm/components/Course/CreatePlaceholder.js +56 -0
  18. package/lib/esm/components/CourseCompletedDialog/CourseCompletedDialog.d.ts +9 -0
  19. package/lib/esm/components/CourseCompletedDialog/CourseCompletedDialog.js +37 -0
  20. package/lib/esm/components/CourseCompletedDialog/index.d.ts +3 -0
  21. package/lib/esm/components/CourseCompletedDialog/index.js +2 -0
  22. package/lib/esm/components/CourseForm/CourseForm.js +25 -13
  23. package/lib/esm/components/CourseForm/Dialog.d.ts +8 -0
  24. package/lib/esm/components/CourseForm/Dialog.js +16 -0
  25. package/lib/esm/components/CourseParticipantsButton/CourseParticipantsButton.js +2 -2
  26. package/lib/esm/components/Courses/Courses.js +3 -3
  27. package/lib/esm/components/Courses/Skeleton.js +2 -2
  28. package/lib/esm/components/LessonObject/LessonObject.js +15 -7
  29. package/lib/esm/index.d.ts +2 -2
  30. package/lib/esm/index.js +2 -2
  31. package/lib/umd/react-ui.js +1 -1
  32. package/package.json +8 -8
  33. package/lib/cjs/components/Course/Placeholder.d.ts +0 -40
  34. package/lib/cjs/components/Course/Placeholder.js +0 -65
  35. package/lib/cjs/components/LessonCompletedDialog/LessonCompletedDialog.d.ts +0 -8
  36. package/lib/cjs/components/LessonCompletedDialog/LessonCompletedDialog.js +0 -36
  37. package/lib/cjs/components/LessonCompletedDialog/index.d.ts +0 -3
  38. package/lib/cjs/components/LessonCompletedDialog/index.js +0 -5
  39. package/lib/esm/components/Course/Placeholder.d.ts +0 -40
  40. package/lib/esm/components/Course/Placeholder.js +0 -62
  41. package/lib/esm/components/LessonCompletedDialog/LessonCompletedDialog.d.ts +0 -8
  42. package/lib/esm/components/LessonCompletedDialog/LessonCompletedDialog.js +0 -32
  43. package/lib/esm/components/LessonCompletedDialog/index.d.ts +0 -3
  44. package/lib/esm/components/LessonCompletedDialog/index.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selfcommunity/react-ui",
3
- "version": "0.10.2-courses.101+b7b188f46",
3
+ "version": "0.10.2-courses.102+f500754c2",
4
4
  "description": "React UI Components to integrate a Community created with SelfCommunity Platform.",
5
5
  "author": "SelfCommunity <https://www.selfcommunity.com>",
6
6
  "homepage": "https://www.selfcommunity.com",
@@ -96,12 +96,12 @@
96
96
  "@rpldy/upload-drop-zone": "^1.7.1",
97
97
  "@rpldy/upload-preview": "^1.7.1",
98
98
  "@rpldy/uploady": "^1.7.1",
99
- "@selfcommunity/api-services": "0.6.4-courses.149+b7b188f46",
100
- "@selfcommunity/react-core": "0.6.4-courses.103+b7b188f46",
101
- "@selfcommunity/react-i18n": "0.7.4-courses.103+b7b188f46",
102
- "@selfcommunity/react-theme-default": "0.4.2-courses.101+b7b188f46",
103
- "@selfcommunity/types": "0.7.4-courses.149+b7b188f46",
104
- "@selfcommunity/utils": "0.2.61-courses.149+b7b188f46",
99
+ "@selfcommunity/api-services": "0.6.4-courses.150+f500754c2",
100
+ "@selfcommunity/react-core": "0.6.4-courses.104+f500754c2",
101
+ "@selfcommunity/react-i18n": "0.7.4-courses.104+f500754c2",
102
+ "@selfcommunity/react-theme-default": "0.4.2-courses.102+f500754c2",
103
+ "@selfcommunity/types": "0.7.4-courses.150+f500754c2",
104
+ "@selfcommunity/utils": "0.2.61-courses.150+f500754c2",
105
105
  "@types/classnames": "^2.3.1",
106
106
  "@types/sortablejs": "1",
107
107
  "autosuggest-highlight": "^3.3.4",
@@ -196,5 +196,5 @@
196
196
  "engines": {
197
197
  "node": ">=20.x"
198
198
  },
199
- "gitHead": "b7b188f46cb8b91d5e01bd886c102449ccf89e34"
199
+ "gitHead": "f500754c2a9dfa5195a3fec9117793e0dace932e"
200
200
  }
@@ -1,40 +0,0 @@
1
- import { WidgetProps } from '../Widget';
2
- export interface CourseSkeletonProps extends WidgetProps {
3
- /**
4
- * Overrides or extends the styles applied to the component.
5
- * @default null
6
- */
7
- className?: string;
8
- /**
9
- * Shows create ation
10
- * @default false
11
- */
12
- actionCreate?: boolean;
13
- /**
14
- * The placeholder item number
15
- */
16
- itemNumber?: number;
17
- }
18
- /**
19
- * > API documentation for the Community-JS Course Placeholder component. Learn about the available props and the CSS API.
20
-
21
- #### Import
22
-
23
- ```jsx
24
- import {CoursePlaceholder} from '@selfcommunity/react-ui';
25
- ```
26
-
27
- #### Component Name
28
-
29
- The name `SCCourse-placeholder-root` can be used when providing style overrides in the theme.
30
-
31
- #### CSS
32
-
33
- |Rule Name|Global class|Description|
34
- |---|---|---|
35
- |root|.SCCourse-placeholder-root|Styles applied to the root element.|
36
- |image|.SCCourse-placeholder-image|Styles applied to the image element.|
37
- |action|.SCCourse-placeholder-action|Styles applied to action section.|
38
- *
39
- */
40
- export default function CoursePlaceholder(inProps: CourseSkeletonProps): JSX.Element;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const material_1 = require("@mui/material");
6
- const styles_1 = require("@mui/material/styles");
7
- const system_1 = require("@mui/system");
8
- const classnames_1 = tslib_1.__importDefault(require("classnames"));
9
- const Widget_1 = tslib_1.__importDefault(require("../Widget"));
10
- const constants_1 = require("./constants");
11
- const react_intl_1 = require("react-intl");
12
- const react_core_1 = require("@selfcommunity/react-core");
13
- const CreateCourseButton_1 = tslib_1.__importDefault(require("../CreateCourseButton"));
14
- const classes = {
15
- root: `${constants_1.PREFIX}-placeholder-root`,
16
- placeholderImageWrapper: `${constants_1.PREFIX}-placeholder-image-wrapper`,
17
- placeholderImage: `${constants_1.PREFIX}-placeholder-image`,
18
- placeholderAvatar: `${constants_1.PREFIX}-placeholder-avatar`,
19
- placeholderCreator: `${constants_1.PREFIX}-placeholder-creator`,
20
- placeholderChip: `${constants_1.PREFIX}-placeholder-chip`,
21
- placeholderIcon: `${constants_1.PREFIX}-placeholder-icon`,
22
- placeholderName: `${constants_1.PREFIX}-placeholder-name`,
23
- placeholderContent: `${constants_1.PREFIX}-placeholder-content`,
24
- placeholderInfo: `${constants_1.PREFIX}-placeholder-info`,
25
- placeholderActions: `${constants_1.PREFIX}-placeholder-actions`,
26
- placeholderCreateButton: `${constants_1.PREFIX}-placeholder-create-button`
27
- };
28
- const Root = (0, styles_1.styled)(Widget_1.default, {
29
- name: constants_1.PREFIX,
30
- slot: 'PlaceholderRoot'
31
- })(() => ({}));
32
- /**
33
- * > API documentation for the Community-JS Course Placeholder component. Learn about the available props and the CSS API.
34
-
35
- #### Import
36
-
37
- ```jsx
38
- import {CoursePlaceholder} from '@selfcommunity/react-ui';
39
- ```
40
-
41
- #### Component Name
42
-
43
- The name `SCCourse-placeholder-root` can be used when providing style overrides in the theme.
44
-
45
- #### CSS
46
-
47
- |Rule Name|Global class|Description|
48
- |---|---|---|
49
- |root|.SCCourse-placeholder-root|Styles applied to the root element.|
50
- |image|.SCCourse-placeholder-image|Styles applied to the image element.|
51
- |action|.SCCourse-placeholder-action|Styles applied to action section.|
52
- *
53
- */
54
- function CoursePlaceholder(inProps) {
55
- // PROPS
56
- const props = (0, system_1.useThemeProps)({
57
- props: inProps,
58
- name: constants_1.PREFIX
59
- });
60
- const { className, actionCreate = false, itemNumber = 1 } = props, rest = tslib_1.__rest(props, ["className", "actionCreate", "itemNumber"]);
61
- // HOOK
62
- const { preferences } = (0, react_core_1.useSCPreferences)();
63
- return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative", className: classes.placeholderImageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: `${preferences[react_core_1.SCPreferences.IMAGES_USER_DEFAULT_COVER].value}`, alt: "placeholder image", className: classes.placeholderImage }), (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.placeholderIcon, fontSize: "large" }, { children: "courses" })), !actionCreate && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { className: classes.placeholderAvatar, alt: "placeholder-avatar", src: "" }), (0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseStatus.draft", defaultMessage: "ui.courseStatus.draft" }), className: classes.placeholderChip })] }))] })), !actionCreate && ((0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.placeholderContent }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.placeholderCreator }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.placeholder.teacher", defaultMessage: "ui.course.placeholder.teacher" }) })), (0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.placeholderName }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.placeholder.title", defaultMessage: "ui.course.placeholder.title", values: { number: itemNumber } }) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.placeholderInfo }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.placeholder.subtitle", defaultMessage: "ui.course.placeholder.subtitle" }) }))] }))), (0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: (0, classnames_1.default)(classes.placeholderActions, { [classes.placeholderCreateButton]: actionCreate }) }, { children: actionCreate ? ((0, jsx_runtime_1.jsx)(CreateCourseButton_1.default, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Typography, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "people_alt" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.courseParticipantsButton.participants", id: "ui.courseParticipantsButton.participants", values: { total: 0 } })] })) }))] })));
64
- }
65
- exports.default = CoursePlaceholder;
@@ -1,8 +0,0 @@
1
- import { SCCourseType } from '@selfcommunity/types';
2
- export interface LessonCompletedDialogProps {
3
- course: SCCourseType;
4
- open: boolean;
5
- onAction?: () => void;
6
- onClose?: () => void;
7
- }
8
- export default function LessonCompletedDialog(inProps: LessonCompletedDialogProps): JSX.Element;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
6
- const material_1 = require("@mui/material");
7
- const react_intl_1 = require("react-intl");
8
- const clapping_1 = require("../../assets/courses/clapping");
9
- const PREFIX = 'SCLessonCompletedDialog';
10
- const classes = {
11
- root: `${PREFIX}-root`,
12
- wrapper: `${PREFIX}-wrapper`,
13
- title: `${PREFIX}-title`,
14
- descriptionPt1: `${PREFIX}-description-pt1`,
15
- descriptionPt2: `${PREFIX}-description-pt2`
16
- };
17
- const Root = (0, material_1.styled)(BaseDialog_1.default, {
18
- name: PREFIX,
19
- slot: 'Root',
20
- overridesResolver: (_props, styles) => styles.root
21
- })(() => ({}));
22
- function LessonCompletedDialog(inProps) {
23
- // PROPS
24
- const props = (0, material_1.useThemeProps)({
25
- props: inProps,
26
- name: PREFIX
27
- });
28
- const { course, open, onAction, onClose } = props;
29
- // HOOKS
30
- const intl = (0, react_intl_1.useIntl)();
31
- return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ DialogContentProps: { dividers: false }, open: open, onClose: onClose, actions: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: onAction, size: "medium", variant: "contained" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.completedDialog.btn.label", defaultMessage: "ui.course.completedDialog.btn.label" }) })) })), className: classes.root }, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.wrapper }, { children: [(0, jsx_runtime_1.jsx)("img", { src: clapping_1.CLAPPING, alt: intl.formatMessage({ id: 'ui.course.completedDialog.title', defaultMessage: 'ui.course.completedDialog.title' }), width: 100, height: 100 }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h2", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.completedDialog.title", defaultMessage: "ui.course.completedDialog.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.descriptionPt1 }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.completedDialog.description.pt1", defaultMessage: "ui.course.completedDialog.description.pt1" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.descriptionPt2 }, { children: intl.formatMessage({ id: 'ui.course.completedDialog.description.pt2', defaultMessage: 'ui.course.completedDialog.description.pt2' }, {
32
- courseName: course.name,
33
- span: (chunks) => ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span", variant: "inherit", color: "primary" }, { children: chunks })))
34
- }) }))] })) })));
35
- }
36
- exports.default = LessonCompletedDialog;
@@ -1,3 +0,0 @@
1
- import LessonCompletedDialog, { LessonCompletedDialogProps } from './LessonCompletedDialog';
2
- export default LessonCompletedDialog;
3
- export { LessonCompletedDialogProps };
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const LessonCompletedDialog_1 = tslib_1.__importDefault(require("./LessonCompletedDialog"));
5
- exports.default = LessonCompletedDialog_1.default;
@@ -1,40 +0,0 @@
1
- import { WidgetProps } from '../Widget';
2
- export interface CourseSkeletonProps extends WidgetProps {
3
- /**
4
- * Overrides or extends the styles applied to the component.
5
- * @default null
6
- */
7
- className?: string;
8
- /**
9
- * Shows create ation
10
- * @default false
11
- */
12
- actionCreate?: boolean;
13
- /**
14
- * The placeholder item number
15
- */
16
- itemNumber?: number;
17
- }
18
- /**
19
- * > API documentation for the Community-JS Course Placeholder component. Learn about the available props and the CSS API.
20
-
21
- #### Import
22
-
23
- ```jsx
24
- import {CoursePlaceholder} from '@selfcommunity/react-ui';
25
- ```
26
-
27
- #### Component Name
28
-
29
- The name `SCCourse-placeholder-root` can be used when providing style overrides in the theme.
30
-
31
- #### CSS
32
-
33
- |Rule Name|Global class|Description|
34
- |---|---|---|
35
- |root|.SCCourse-placeholder-root|Styles applied to the root element.|
36
- |image|.SCCourse-placeholder-image|Styles applied to the image element.|
37
- |action|.SCCourse-placeholder-action|Styles applied to action section.|
38
- *
39
- */
40
- export default function CoursePlaceholder(inProps: CourseSkeletonProps): JSX.Element;
@@ -1,62 +0,0 @@
1
- import { __rest } from "tslib";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Avatar, Box, CardActions, CardContent, CardMedia, Chip, Icon, Typography } from '@mui/material';
4
- import { styled } from '@mui/material/styles';
5
- import { useThemeProps } from '@mui/system';
6
- import classNames from 'classnames';
7
- import Widget from '../Widget';
8
- import { PREFIX } from './constants';
9
- import { FormattedMessage } from 'react-intl';
10
- import { SCPreferences, useSCPreferences } from '@selfcommunity/react-core';
11
- import CreateCourseButton from '../CreateCourseButton';
12
- const classes = {
13
- root: `${PREFIX}-placeholder-root`,
14
- placeholderImageWrapper: `${PREFIX}-placeholder-image-wrapper`,
15
- placeholderImage: `${PREFIX}-placeholder-image`,
16
- placeholderAvatar: `${PREFIX}-placeholder-avatar`,
17
- placeholderCreator: `${PREFIX}-placeholder-creator`,
18
- placeholderChip: `${PREFIX}-placeholder-chip`,
19
- placeholderIcon: `${PREFIX}-placeholder-icon`,
20
- placeholderName: `${PREFIX}-placeholder-name`,
21
- placeholderContent: `${PREFIX}-placeholder-content`,
22
- placeholderInfo: `${PREFIX}-placeholder-info`,
23
- placeholderActions: `${PREFIX}-placeholder-actions`,
24
- placeholderCreateButton: `${PREFIX}-placeholder-create-button`
25
- };
26
- const Root = styled(Widget, {
27
- name: PREFIX,
28
- slot: 'PlaceholderRoot'
29
- })(() => ({}));
30
- /**
31
- * > API documentation for the Community-JS Course Placeholder component. Learn about the available props and the CSS API.
32
-
33
- #### Import
34
-
35
- ```jsx
36
- import {CoursePlaceholder} from '@selfcommunity/react-ui';
37
- ```
38
-
39
- #### Component Name
40
-
41
- The name `SCCourse-placeholder-root` can be used when providing style overrides in the theme.
42
-
43
- #### CSS
44
-
45
- |Rule Name|Global class|Description|
46
- |---|---|---|
47
- |root|.SCCourse-placeholder-root|Styles applied to the root element.|
48
- |image|.SCCourse-placeholder-image|Styles applied to the image element.|
49
- |action|.SCCourse-placeholder-action|Styles applied to action section.|
50
- *
51
- */
52
- export default function CoursePlaceholder(inProps) {
53
- // PROPS
54
- const props = useThemeProps({
55
- props: inProps,
56
- name: PREFIX
57
- });
58
- const { className, actionCreate = false, itemNumber = 1 } = props, rest = __rest(props, ["className", "actionCreate", "itemNumber"]);
59
- // HOOK
60
- const { preferences } = useSCPreferences();
61
- return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsxs(Box, Object.assign({ position: "relative", className: classes.placeholderImageWrapper }, { children: [_jsx(CardMedia, { component: "img", image: `${preferences[SCPreferences.IMAGES_USER_DEFAULT_COVER].value}`, alt: "placeholder image", className: classes.placeholderImage }), _jsx(Icon, Object.assign({ className: classes.placeholderIcon, fontSize: "large" }, { children: "courses" })), !actionCreate && (_jsxs(_Fragment, { children: [_jsx(Avatar, { className: classes.placeholderAvatar, alt: "placeholder-avatar", src: "" }), _jsx(Chip, { size: "small", component: "div", label: _jsx(FormattedMessage, { id: "ui.courseStatus.draft", defaultMessage: "ui.courseStatus.draft" }), className: classes.placeholderChip })] }))] })), !actionCreate && (_jsxs(CardContent, Object.assign({ className: classes.placeholderContent }, { children: [_jsx(Typography, Object.assign({ className: classes.placeholderCreator }, { children: _jsx(FormattedMessage, { id: "ui.course.placeholder.teacher", defaultMessage: "ui.course.placeholder.teacher" }) })), _jsx(Box, { children: _jsx(Typography, Object.assign({ variant: "h5", className: classes.placeholderName }, { children: _jsx(FormattedMessage, { id: "ui.course.placeholder.title", defaultMessage: "ui.course.placeholder.title", values: { number: itemNumber } }) })) }), _jsx(Typography, Object.assign({ className: classes.placeholderInfo }, { children: _jsx(FormattedMessage, { id: "ui.course.placeholder.subtitle", defaultMessage: "ui.course.placeholder.subtitle" }) }))] }))), _jsx(CardActions, Object.assign({ className: classNames(classes.placeholderActions, { [classes.placeholderCreateButton]: actionCreate }) }, { children: actionCreate ? (_jsx(CreateCourseButton, {})) : (_jsxs(Typography, { children: [_jsx(Icon, { children: "people_alt" }), _jsx(FormattedMessage, { defaultMessage: "ui.courseParticipantsButton.participants", id: "ui.courseParticipantsButton.participants", values: { total: 0 } })] })) }))] })));
62
- }
@@ -1,8 +0,0 @@
1
- import { SCCourseType } from '@selfcommunity/types';
2
- export interface LessonCompletedDialogProps {
3
- course: SCCourseType;
4
- open: boolean;
5
- onAction?: () => void;
6
- onClose?: () => void;
7
- }
8
- export default function LessonCompletedDialog(inProps: LessonCompletedDialogProps): JSX.Element;
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import BaseDialog from '../../shared/BaseDialog';
3
- import { Button, Stack, styled, Typography, useThemeProps } from '@mui/material';
4
- import { FormattedMessage, useIntl } from 'react-intl';
5
- import { CLAPPING } from '../../assets/courses/clapping';
6
- const PREFIX = 'SCLessonCompletedDialog';
7
- const classes = {
8
- root: `${PREFIX}-root`,
9
- wrapper: `${PREFIX}-wrapper`,
10
- title: `${PREFIX}-title`,
11
- descriptionPt1: `${PREFIX}-description-pt1`,
12
- descriptionPt2: `${PREFIX}-description-pt2`
13
- };
14
- const Root = styled(BaseDialog, {
15
- name: PREFIX,
16
- slot: 'Root',
17
- overridesResolver: (_props, styles) => styles.root
18
- })(() => ({}));
19
- export default function LessonCompletedDialog(inProps) {
20
- // PROPS
21
- const props = useThemeProps({
22
- props: inProps,
23
- name: PREFIX
24
- });
25
- const { course, open, onAction, onClose } = props;
26
- // HOOKS
27
- const intl = useIntl();
28
- return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, open: open, onClose: onClose, actions: _jsx(Button, Object.assign({ onClick: onAction, size: "medium", variant: "contained" }, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.course.completedDialog.btn.label", defaultMessage: "ui.course.completedDialog.btn.label" }) })) })), className: classes.root }, { children: _jsxs(Stack, Object.assign({ className: classes.wrapper }, { children: [_jsx("img", { src: CLAPPING, alt: intl.formatMessage({ id: 'ui.course.completedDialog.title', defaultMessage: 'ui.course.completedDialog.title' }), width: 100, height: 100 }), _jsx(Typography, Object.assign({ variant: "h2", className: classes.title }, { children: _jsx(FormattedMessage, { id: "ui.course.completedDialog.title", defaultMessage: "ui.course.completedDialog.title" }) })), _jsx(Typography, Object.assign({ variant: "h4", className: classes.descriptionPt1 }, { children: _jsx(FormattedMessage, { id: "ui.course.completedDialog.description.pt1", defaultMessage: "ui.course.completedDialog.description.pt1" }) })), _jsx(Typography, Object.assign({ variant: "h4", className: classes.descriptionPt2 }, { children: intl.formatMessage({ id: 'ui.course.completedDialog.description.pt2', defaultMessage: 'ui.course.completedDialog.description.pt2' }, {
29
- courseName: course.name,
30
- span: (chunks) => (_jsx(Typography, Object.assign({ component: "span", variant: "inherit", color: "primary" }, { children: chunks })))
31
- }) }))] })) })));
32
- }
@@ -1,3 +0,0 @@
1
- import LessonCompletedDialog, { LessonCompletedDialogProps } from './LessonCompletedDialog';
2
- export default LessonCompletedDialog;
3
- export { LessonCompletedDialogProps };
@@ -1,2 +0,0 @@
1
- import LessonCompletedDialog from './LessonCompletedDialog';
2
- export default LessonCompletedDialog;