@selfcommunity/react-ui 1.2.0-alpha.5 → 1.2.0-alpha.7

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.
@@ -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
- const [step, setStep] = (0, react_1.useState)(Course_1.SCCourseFormStepType.GENERAL);
49
- const [type, setType] = (0, react_1.useState)('');
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);
@@ -26,7 +26,8 @@ const classes = {
26
26
  divider: `${constants_1.PREFIX}-action-comment-divider`,
27
27
  inline: `${constants_1.PREFIX}-action-comment-inline`,
28
28
  button: `${constants_1.PREFIX}-action-comment-button`,
29
- viewAudienceButton: `${constants_1.PREFIX}-action-comment-view-audience-button`
29
+ viewAudienceButton: `${constants_1.PREFIX}-action-comment-view-audience-button`,
30
+ paperContrastColor: `${constants_1.PREFIX}-paper-contrast-color`
30
31
  };
31
32
  const Root = (0, material_1.styled)(material_1.Box, {
32
33
  name: constants_1.PREFIX,
@@ -52,7 +53,9 @@ function Comment(props) {
52
53
  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 }) })));
53
54
  }
54
55
  else {
55
- audience = ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: onViewCommentsAction ? ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", onClick: onViewCommentsAction, color: "inherit" }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: feedObjectTemplate === feedObject_1.SCFeedObjectTemplateType.DETAIL ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` }))) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", component: react_core_1.Link, to: scRoutingContext.url((0, contribution_1.getContributionRouteName)(obj), (0, contribution_1.getRouteData)(obj)), classes: { root: classes.viewAudienceButton } }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` }))) })) }));
56
+ audience = ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: onViewCommentsAction ? ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", onClick: onViewCommentsAction, color: "inherit" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span", sx: { '&': { all: 'unset' } }, className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` })) }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: feedObjectTemplate === feedObject_1.SCFeedObjectTemplateType.DETAIL ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, {
57
+ total: obj.comment_count
58
+ })}` }))) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", component: react_core_1.Link, to: scRoutingContext.url((0, contribution_1.getContributionRouteName)(obj), (0, contribution_1.getRouteData)(obj)), 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.comments, { total: obj.comment_count })}` })) }))) })) }));
56
59
  }
57
60
  }
58
61
  return audience;
@@ -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: `${intl.formatMessage(messages.shares, { total: sharesCount })}` })), openSharesDialog && sharesCount > 0 && ((0, jsx_runtime_1.jsx)(SharesDialog_1.default, { feedObject: obj, feedObjectType: obj.type, open: openSharesDialog, onClose: handleToggleSharesDialog }))] }));
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
- const [step, setStep] = useState(SCCourseFormStepType.GENERAL);
47
- const [type, setType] = useState('');
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);
@@ -24,7 +24,8 @@ const classes = {
24
24
  divider: `${PREFIX}-action-comment-divider`,
25
25
  inline: `${PREFIX}-action-comment-inline`,
26
26
  button: `${PREFIX}-action-comment-button`,
27
- viewAudienceButton: `${PREFIX}-action-comment-view-audience-button`
27
+ viewAudienceButton: `${PREFIX}-action-comment-view-audience-button`,
28
+ paperContrastColor: `${PREFIX}-paper-contrast-color`
28
29
  };
29
30
  const Root = styled(Box, {
30
31
  name: PREFIX,
@@ -50,7 +51,9 @@ export default function Comment(props) {
50
51
  audience = (_jsx(Button, Object.assign({ variant: "text", size: "small", disabled: true, color: "inherit" }, { children: _jsx(Skeleton, { animation: "wave", height: 18, width: 50 }) })));
51
52
  }
52
53
  else {
53
- audience = (_jsx(_Fragment, { children: onViewCommentsAction ? (_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: onViewCommentsAction, color: "inherit" }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` }))) : (_jsx(_Fragment, { children: feedObjectTemplate === SCFeedObjectTemplateType.DETAIL ? (_jsx(Typography, Object.assign({ variant: "body2" }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` }))) : (_jsx(Button, Object.assign({ variant: "text", size: "small", component: Link, to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), classes: { root: classes.viewAudienceButton } }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` }))) })) }));
54
+ audience = (_jsx(_Fragment, { children: onViewCommentsAction ? (_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: onViewCommentsAction, color: "inherit" }, { children: _jsx(Typography, Object.assign({ component: "span", sx: { '&': { all: 'unset' } }, className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` })) }))) : (_jsx(_Fragment, { children: feedObjectTemplate === SCFeedObjectTemplateType.DETAIL ? (_jsx(Typography, Object.assign({ variant: "body2", className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, {
55
+ total: obj.comment_count
56
+ })}` }))) : (_jsx(Button, Object.assign({ variant: "text", size: "small", component: Link, to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), classes: { root: classes.viewAudienceButton } }, { children: _jsx(Typography, Object.assign({ component: "span", sx: { '&': { all: 'unset' } }, className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` })) }))) })) }));
54
57
  }
55
58
  }
56
59
  return audience;
@@ -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: `${intl.formatMessage(messages.shares, { total: sharesCount })}` })), openSharesDialog && sharesCount > 0 && (_jsx(SharesDialog, { feedObject: obj, feedObjectType: obj.type, open: openSharesDialog, onClose: handleToggleSharesDialog }))] }));
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;