@selfcommunity/react-ui 1.2.0-alpha.6 → 1.2.0-alpha.8
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/CourseFormDialog/CourseFormDialog.js +3 -2
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +5 -2
- package/lib/esm/components/CourseFormDialog/CourseFormDialog.js +3 -2
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +6 -3
- package/lib/umd/react-ui.js +1 -1
- package/package.json +8 -8
|
@@ -45,8 +45,9 @@ function CourseFormDialog(inProps) {
|
|
|
45
45
|
});
|
|
46
46
|
const { className, open = true, onClose, CourseFormComponentProps = {} } = props, rest = tslib_1.__rest(props, ["className", "open", "onClose", "CourseFormComponentProps"]);
|
|
47
47
|
// STATE
|
|
48
|
-
|
|
49
|
-
const [
|
|
48
|
+
// TODO - temporary hardcoded CUSTOMIZATION and 'self-paced' --> previous value: GENERAL and ''
|
|
49
|
+
const [step, setStep] = (0, react_1.useState)(Course_1.SCCourseFormStepType.CUSTOMIZATION);
|
|
50
|
+
const [type, setType] = (0, react_1.useState)('self-paced');
|
|
50
51
|
//HANDLERS
|
|
51
52
|
const handleStepTypeChange = (step, type) => {
|
|
52
53
|
setStep(step);
|
|
@@ -33,7 +33,8 @@ const classes = {
|
|
|
33
33
|
divider: `${constants_1.PREFIX}-action-share-divider`,
|
|
34
34
|
inline: `${constants_1.PREFIX}-action-share-inline`,
|
|
35
35
|
button: `${constants_1.PREFIX}-action-share-button`,
|
|
36
|
-
viewAudienceButton: `${constants_1.PREFIX}-action-share-view-audience-button
|
|
36
|
+
viewAudienceButton: `${constants_1.PREFIX}-action-share-view-audience-button`,
|
|
37
|
+
paperContrastColor: `${constants_1.PREFIX}-paper-contrast-color`
|
|
37
38
|
};
|
|
38
39
|
const Root = (0, material_1.styled)(material_1.Box, {
|
|
39
40
|
name: constants_1.PREFIX,
|
|
@@ -181,7 +182,9 @@ function Share(props) {
|
|
|
181
182
|
audience = ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", disabled: true, color: "inherit" }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 18, width: 50 }) })));
|
|
182
183
|
}
|
|
183
184
|
else {
|
|
184
|
-
audience = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", onClick: handleToggleSharesDialog, disabled: sharesCount < 1, classes: { root: classes.viewAudienceButton } }, { children:
|
|
185
|
+
audience = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", onClick: handleToggleSharesDialog, disabled: sharesCount < 1, classes: { root: classes.viewAudienceButton } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span", sx: { '&': { all: 'unset' } }, className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.shares, {
|
|
186
|
+
total: sharesCount
|
|
187
|
+
})}` })) })), openSharesDialog && sharesCount > 0 && ((0, jsx_runtime_1.jsx)(SharesDialog_1.default, { feedObject: obj, feedObjectType: obj.type, open: openSharesDialog, onClose: handleToggleSharesDialog }))] }));
|
|
185
188
|
}
|
|
186
189
|
}
|
|
187
190
|
return audience;
|
|
@@ -43,8 +43,9 @@ export default function CourseFormDialog(inProps) {
|
|
|
43
43
|
});
|
|
44
44
|
const { className, open = true, onClose, CourseFormComponentProps = {} } = props, rest = __rest(props, ["className", "open", "onClose", "CourseFormComponentProps"]);
|
|
45
45
|
// STATE
|
|
46
|
-
|
|
47
|
-
const [
|
|
46
|
+
// TODO - temporary hardcoded CUSTOMIZATION and 'self-paced' --> previous value: GENERAL and ''
|
|
47
|
+
const [step, setStep] = useState(SCCourseFormStepType.CUSTOMIZATION);
|
|
48
|
+
const [type, setType] = useState('self-paced');
|
|
48
49
|
//HANDLERS
|
|
49
50
|
const handleStepTypeChange = (step, type) => {
|
|
50
51
|
setStep(step);
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import React, { useContext, useMemo, useState } from 'react';
|
|
4
4
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
5
5
|
import SharesDialog from './SharesDialog';
|
|
6
|
-
import { Box, Button, Divider, ListItemText, Menu, SwipeableDrawer, Tooltip, useMediaQuery, useTheme, Icon, MenuItem, ListItemIcon, styled, Skeleton } from '@mui/material';
|
|
6
|
+
import { Box, Button, Divider, ListItemText, Menu, SwipeableDrawer, Tooltip, useMediaQuery, useTheme, Icon, MenuItem, ListItemIcon, styled, Skeleton, Typography } from '@mui/material';
|
|
7
7
|
import { MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_TYPE_SHARE } from '../../../../constants/Media';
|
|
8
8
|
import { SCOPE_SC_UI } from '../../../../constants/Errors';
|
|
9
9
|
import classNames from 'classnames';
|
|
@@ -31,7 +31,8 @@ const classes = {
|
|
|
31
31
|
divider: `${PREFIX}-action-share-divider`,
|
|
32
32
|
inline: `${PREFIX}-action-share-inline`,
|
|
33
33
|
button: `${PREFIX}-action-share-button`,
|
|
34
|
-
viewAudienceButton: `${PREFIX}-action-share-view-audience-button
|
|
34
|
+
viewAudienceButton: `${PREFIX}-action-share-view-audience-button`,
|
|
35
|
+
paperContrastColor: `${PREFIX}-paper-contrast-color`
|
|
35
36
|
};
|
|
36
37
|
const Root = styled(Box, {
|
|
37
38
|
name: PREFIX,
|
|
@@ -179,7 +180,9 @@ export default function Share(props) {
|
|
|
179
180
|
audience = (_jsx(Button, Object.assign({ variant: "text", size: "small", disabled: true, color: "inherit" }, { children: _jsx(Skeleton, { animation: "wave", height: 18, width: 50 }) })));
|
|
180
181
|
}
|
|
181
182
|
else {
|
|
182
|
-
audience = (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: handleToggleSharesDialog, disabled: sharesCount < 1, classes: { root: classes.viewAudienceButton } }, { children:
|
|
183
|
+
audience = (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: handleToggleSharesDialog, disabled: sharesCount < 1, classes: { root: classes.viewAudienceButton } }, { children: _jsx(Typography, Object.assign({ component: "span", sx: { '&': { all: 'unset' } }, className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.shares, {
|
|
184
|
+
total: sharesCount
|
|
185
|
+
})}` })) })), openSharesDialog && sharesCount > 0 && (_jsx(SharesDialog, { feedObject: obj, feedObjectType: obj.type, open: openSharesDialog, onClose: handleToggleSharesDialog }))] }));
|
|
183
186
|
}
|
|
184
187
|
}
|
|
185
188
|
return audience;
|