@selfcommunity/react-ui 0.7.50-events.85 → 0.7.50-events.87
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/EventHeader/EventHeader.d.ts +1 -1
- package/lib/cjs/components/EventHeader/EventHeader.js +24 -16
- package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +1 -1
- package/lib/cjs/components/EventInviteButton/EventInviteButton.js +1 -1
- package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +1 -2
- package/lib/cjs/components/OnBoardingWidget/Steps/App/App.js +2 -4
- package/lib/cjs/components/OnBoardingWidget/Steps/Category/Category.js +15 -14
- package/lib/cjs/components/OnBoardingWidget/Steps/Content/Content.js +5 -2
- package/lib/cjs/constants/Event.d.ts +1 -1
- package/lib/cjs/constants/Event.js +1 -1
- package/lib/cjs/shared/EventInfoDetails/index.d.ts +3 -0
- package/lib/cjs/shared/EventInfoDetails/index.js +17 -18
- package/lib/cjs/shared/ProgressBar/index.d.ts +5 -0
- package/lib/cjs/shared/ProgressBar/index.js +2 -2
- package/lib/esm/components/EventHeader/EventHeader.d.ts +1 -1
- package/lib/esm/components/EventHeader/EventHeader.js +24 -16
- package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +1 -1
- package/lib/esm/components/EventInviteButton/EventInviteButton.js +1 -1
- package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +1 -2
- package/lib/esm/components/OnBoardingWidget/Steps/App/App.js +2 -4
- package/lib/esm/components/OnBoardingWidget/Steps/Category/Category.js +16 -15
- package/lib/esm/components/OnBoardingWidget/Steps/Content/Content.js +5 -2
- package/lib/esm/constants/Event.d.ts +1 -1
- package/lib/esm/constants/Event.js +1 -1
- package/lib/esm/shared/EventInfoDetails/index.d.ts +3 -0
- package/lib/esm/shared/EventInfoDetails/index.js +18 -19
- package/lib/esm/shared/ProgressBar/index.d.ts +5 -0
- package/lib/esm/shared/ProgressBar/index.js +2 -2
- package/lib/umd/99.js +2 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +8 -7
- package/lib/cjs/assets/onBoarding/Android.d.ts +0 -1
- package/lib/cjs/assets/onBoarding/Android.js +0 -7
- package/lib/cjs/assets/onBoarding/CategoryA.d.ts +0 -1
- package/lib/cjs/assets/onBoarding/CategoryA.js +0 -7
- package/lib/cjs/assets/onBoarding/CategoryB.d.ts +0 -1
- package/lib/cjs/assets/onBoarding/CategoryB.js +0 -7
- package/lib/cjs/assets/onBoarding/Header.d.ts +0 -1
- package/lib/cjs/assets/onBoarding/Header.js +0 -7
- package/lib/cjs/assets/onBoarding/Ios.d.ts +0 -1
- package/lib/cjs/assets/onBoarding/Ios.js +0 -7
- package/lib/esm/assets/onBoarding/Android.d.ts +0 -1
- package/lib/esm/assets/onBoarding/Android.js +0 -4
- package/lib/esm/assets/onBoarding/CategoryA.d.ts +0 -1
- package/lib/esm/assets/onBoarding/CategoryA.js +0 -4
- package/lib/esm/assets/onBoarding/CategoryB.d.ts +0 -1
- package/lib/esm/assets/onBoarding/CategoryB.js +0 -4
- package/lib/esm/assets/onBoarding/Header.d.ts +0 -1
- package/lib/esm/assets/onBoarding/Header.js +0 -4
- package/lib/esm/assets/onBoarding/Ios.d.ts +0 -1
- package/lib/esm/assets/onBoarding/Ios.js +0 -4
- package/lib/umd/920.js +0 -2
- /package/lib/umd/{920.js.LICENSE.txt → 99.js.LICENSE.txt} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SCEventType } from '@selfcommunity/types';
|
|
2
|
-
import { EventSubscribeButtonProps } from '../EventSubscribeButton';
|
|
3
2
|
import { EventActionsMenuProps } from '../../shared/EventActionsMenu';
|
|
3
|
+
import { EventSubscribeButtonProps } from '../EventSubscribeButton';
|
|
4
4
|
export interface EventHeaderProps {
|
|
5
5
|
/**
|
|
6
6
|
* Id of event object
|
|
@@ -2,30 +2,32 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const styles_1 = require("@mui/material/styles");
|
|
7
5
|
const material_1 = require("@mui/material");
|
|
8
|
-
const
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const system_1 = require("@mui/system");
|
|
9
8
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
10
|
-
const
|
|
9
|
+
const types_1 = require("@selfcommunity/types");
|
|
11
10
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
12
|
-
const
|
|
13
|
-
const
|
|
11
|
+
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
12
|
+
const react_1 = require("react");
|
|
14
13
|
const react_intl_1 = require("react-intl");
|
|
15
|
-
const Bullet_1 = tslib_1.__importDefault(require("../../shared/Bullet"));
|
|
16
|
-
const EventSubscribeButton_1 = tslib_1.__importDefault(require("../EventSubscribeButton"));
|
|
17
|
-
const EventInviteButton_1 = tslib_1.__importDefault(require("../EventInviteButton"));
|
|
18
14
|
const PubSub_1 = require("../../constants/PubSub");
|
|
19
|
-
const
|
|
20
|
-
const EditEventButton_1 = tslib_1.__importDefault(require("../EditEventButton"));
|
|
21
|
-
const User_1 = tslib_1.__importDefault(require("../User"));
|
|
15
|
+
const Bullet_1 = tslib_1.__importDefault(require("../../shared/Bullet"));
|
|
22
16
|
const Calendar_1 = tslib_1.__importDefault(require("../../shared/Calendar"));
|
|
23
17
|
const EventActionsMenu_1 = tslib_1.__importDefault(require("../../shared/EventActionsMenu"));
|
|
18
|
+
const EditEventButton_1 = tslib_1.__importDefault(require("../EditEventButton"));
|
|
19
|
+
const EventInviteButton_1 = tslib_1.__importDefault(require("../EventInviteButton"));
|
|
20
|
+
const EventSubscribeButton_1 = tslib_1.__importDefault(require("../EventSubscribeButton"));
|
|
21
|
+
const User_1 = tslib_1.__importDefault(require("../User"));
|
|
22
|
+
const constants_1 = require("./constants");
|
|
23
|
+
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
24
24
|
const classes = {
|
|
25
25
|
root: `${constants_1.PREFIX}-root`,
|
|
26
26
|
cover: `${constants_1.PREFIX}-cover`,
|
|
27
27
|
time: `${constants_1.PREFIX}-time`,
|
|
28
28
|
calendar: `${constants_1.PREFIX}-calendar`,
|
|
29
|
+
inProgress: `${constants_1.PREFIX}-in-progress`,
|
|
30
|
+
chip: `${constants_1.PREFIX}-chip`,
|
|
29
31
|
info: `${constants_1.PREFIX}-info`,
|
|
30
32
|
name: `${constants_1.PREFIX}-name`,
|
|
31
33
|
visibility: `${constants_1.PREFIX}-visibility`,
|
|
@@ -36,7 +38,7 @@ const classes = {
|
|
|
36
38
|
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
37
39
|
name: constants_1.PREFIX,
|
|
38
40
|
slot: 'Root',
|
|
39
|
-
shouldForwardProp: (prop) => prop !== 'isEventAdmin'
|
|
41
|
+
shouldForwardProp: (prop) => prop !== 'isEventAdmin' && prop !== 'isEventFinished'
|
|
40
42
|
})(() => ({}));
|
|
41
43
|
/**
|
|
42
44
|
* > API documentation for the Community-JS Event Header component. Learn about the available props and the CSS API.
|
|
@@ -85,14 +87,20 @@ function EventHeader(inProps) {
|
|
|
85
87
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
86
88
|
// HOOKS
|
|
87
89
|
const { scEvent, setSCEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
|
|
90
|
+
const theme = (0, material_1.useTheme)();
|
|
91
|
+
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
88
92
|
// INTL
|
|
89
93
|
const intl = (0, react_intl_1.useIntl)();
|
|
90
94
|
// REFS
|
|
91
95
|
const updatesSubscription = (0, react_1.useRef)(null);
|
|
92
96
|
// CONST
|
|
93
97
|
const isEventAdmin = (0, react_1.useMemo)(() => { var _a; return scUserContext.user && ((_a = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _a === void 0 ? void 0 : _a.id) === scUserContext.user.id; }, [scUserContext.user, (_a = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _a === void 0 ? void 0 : _a.id]);
|
|
94
|
-
const
|
|
95
|
-
|
|
98
|
+
const isEventFinished = (0, react_1.useMemo)(() => {
|
|
99
|
+
if (scEvent && !scEvent.running) {
|
|
100
|
+
return new Date().getTime() > new Date(scEvent.end_date || scEvent.start_date).getTime();
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}, [scEvent]);
|
|
96
104
|
/**
|
|
97
105
|
* Subscriber for pubsub callback
|
|
98
106
|
*/
|
|
@@ -136,7 +144,7 @@ function EventHeader(inProps) {
|
|
|
136
144
|
return (
|
|
137
145
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
138
146
|
// @ts-ignore
|
|
139
|
-
(0, jsx_runtime_1.jsxs)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className), isEventAdmin: isEventAdmin }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.calendar }, { children: (0, jsx_runtime_1.jsx)(Calendar_1.default, { day: new Date(scEvent.start_date).getDate() }) })) })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.info }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.time }, { children: scEvent.end_date && scEvent.end_date !== scEvent.start_date ? (new Date(scEvent.start_date).getDate() !== new Date(scEvent.end_date).getDate() ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.startEndTimeDiff", defaultMessage: "ui.eventHeader.startEndTimeDiff", values: {
|
|
147
|
+
(0, jsx_runtime_1.jsxs)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className), isEventAdmin: isEventAdmin, isEventFinished: isEventFinished }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.calendar }, { children: (0, jsx_runtime_1.jsx)(Calendar_1.default, { day: new Date(scEvent.start_date).getDate() }) })) })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.info }, { children: [scEvent.running && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.inProgress }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.inProgress", defaultMessage: "ui.eventHeader.inProgress" }) }))), isEventFinished && ((0, jsx_runtime_1.jsx)(material_1.Chip, { icon: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "calendar_off" })), label: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.finished", defaultMessage: "ui.eventHeader.finished" }) })), variant: "outlined", size: "small", className: classes.chip })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.time }, { children: scEvent.end_date && scEvent.end_date !== scEvent.start_date ? (new Date(scEvent.start_date).getDate() !== new Date(scEvent.end_date).getDate() ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.startEndTimeDiff", defaultMessage: "ui.eventHeader.startEndTimeDiff", values: {
|
|
140
148
|
startDate: intl.formatDate(scEvent.start_date, {
|
|
141
149
|
weekday: 'long',
|
|
142
150
|
day: 'numeric',
|
|
@@ -68,6 +68,6 @@ function EventInfoWidget(inProps) {
|
|
|
68
68
|
return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
|
|
69
69
|
}
|
|
70
70
|
const description = expanded ? scEvent.description : getTruncatedText(scEvent.description, 220);
|
|
71
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.titleWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "info" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.infoEventWidget.title", defaultMessage: "ui.infoEventWidget.title" }) }))] })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.textWrapper }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ component: "span", variant: "body1" }, { children: [description, showButton && !expanded && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "text", className: classes.showMore, onClick: handleToggleSummary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.infoEventWidget.showMore", defaultMessage: "ui.infoEventWidget.showMore" }) })))] })) })), (0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent, hasCreatedInfo: true })] })) })));
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.titleWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "info" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.infoEventWidget.title", defaultMessage: "ui.infoEventWidget.title" }) }))] })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.textWrapper }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ component: "span", variant: "body1" }, { children: [description, showButton && !expanded && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "text", className: classes.showMore, onClick: handleToggleSummary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.infoEventWidget.showMore", defaultMessage: "ui.infoEventWidget.showMore" }) })))] })) })), (0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent, hasRecurringInfo: true, hasCreatedInfo: true })] })) })));
|
|
72
72
|
}
|
|
73
73
|
exports.default = EventInfoWidget;
|
|
@@ -246,7 +246,7 @@ function EventInviteButton(inProps) {
|
|
|
246
246
|
/**
|
|
247
247
|
* Renders root object
|
|
248
248
|
*/
|
|
249
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClose, variant: scEvent ? 'contained' : 'outlined', color: scEvent ? 'secondary' : 'inherit', startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "add" }) }, rest, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInviteButton", defaultMessage: "ui.eventInviteButton" }) })), open && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ DialogContentProps: { dividers: false }, open: true, className: classes.dialogRoot, title: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleClose }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "
|
|
249
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClose, variant: scEvent ? 'contained' : 'outlined', color: scEvent ? 'secondary' : 'inherit', startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "add" }) }, rest, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInviteButton", defaultMessage: "ui.eventInviteButton" }) })), open && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ DialogContentProps: { dividers: false }, open: true, className: classes.dialogRoot, title: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleClose }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.dialogTitle }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInviteButton.dialog.title", defaultMessage: "ui.eventInviteButton.dialog.title" }) })), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ size: "small", color: "secondary", variant: "contained", onClick: handleSendInvitations, loading: isSending, disabled: !invited.length }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInviteButton.dialog.button.end", defaultMessage: "ui.eventInviteButton.dialog.button.end" }) }))] }) }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.dialogContent }, { children: [(0, jsx_runtime_1.jsx)(Autocomplete_1.default, { className: classes.autocomplete, loading: loading, size: "small", multiple: true, freeSolo: true, disableClearable: true, options: suggested, onChange: handleChange, onInputChange: handleInputChange, inputValue: value, filterOptions: filterOptions, value: invited, getOptionLabel: (option) => (option ? option.username : '...'), isOptionEqualToValue: (option, value) => (option ? value.id === option.id : false), renderTags: () => null, renderOption: (props, option) => ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "li" }, props, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: option.username, src: option.avatar }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ ml: 1 }, { children: option.username }))] }))), renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { variant: "outlined", placeholder: `${intl.formatMessage(messages.placeholder)}`, InputProps: Object.assign(Object.assign({}, params.InputProps), { className: classes.input, startAdornment: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.icon }, { children: "search" })) })), params.InputProps.startAdornment] })) }) }))) }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.invitedBox }, { children: invited.map((option, index) => ((0, jsx_runtime_1.jsx)(material_1.Chip, { avatar: (0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: option.username, src: option.avatar }), label: option.username, onDelete: () => {
|
|
250
250
|
handleDelete(option);
|
|
251
251
|
}, style: { marginRight: 8 } }, index))) })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.suggested }, { children: [list.length !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", fontWeight: "bold" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInviteButton.dialog.content.list", defaultMessage: "ui.eventInviteButton.dialog.content.list" }) }))), list.slice(0, 5).map((user, index) => ((0, jsx_runtime_1.jsx)(User_1.default, { elevation: 0, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), user: user, userId: user.id, buttonProps: { onClick: () => handleUserInvite(user) } }, index)))] }))] })) })))] }));
|
|
252
252
|
}
|
|
@@ -18,7 +18,6 @@ const App_1 = tslib_1.__importDefault(require("./Steps/App"));
|
|
|
18
18
|
const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
|
|
19
19
|
const Widget_1 = tslib_1.__importDefault(require("../Widget"));
|
|
20
20
|
const Content_1 = tslib_1.__importDefault(require("./Steps/Content"));
|
|
21
|
-
const Header_1 = tslib_1.__importDefault(require("../../assets/onBoarding/Header"));
|
|
22
21
|
const Errors_1 = require("../../constants/Errors");
|
|
23
22
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
24
23
|
const utils_1 = require("@selfcommunity/utils");
|
|
@@ -217,7 +216,7 @@ const OnBoardingWidget = (inProps) => {
|
|
|
217
216
|
if (!isAdmin) {
|
|
218
217
|
return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
|
|
219
218
|
}
|
|
220
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(AccordionRoot, Object.assign({ defaultExpanded: true, onChange: handleExpand, className: classes.accordionRoot, expanded: expanded }, { children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, Object.assign({ expandIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "medium" }, { children: "expand_more" })), "aria-controls": "accordion", id: "onBoarding-accordion" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: expanded ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isMobile ? ((0, jsx_runtime_1.jsx)(material_1.CardMedia,
|
|
219
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(AccordionRoot, Object.assign({ defaultExpanded: true, onChange: handleExpand, className: classes.accordionRoot, expanded: expanded }, { children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, Object.assign({ expandIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "medium" }, { children: "expand_more" })), "aria-controls": "accordion", id: "onBoarding-accordion" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: expanded ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isMobile ? ((0, jsx_runtime_1.jsx)(material_1.CardMedia, { className: classes.logo, component: "img", src: "/onBoarding/header.svg" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", textAlign: "center" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.accordion.expanded.title.mobile", defaultMessage: "ui.onBoardingWidget.accordion.expanded.title.mobile", values: {
|
|
221
220
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
222
221
|
// @ts-ignore
|
|
223
222
|
b: (chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks }),
|
|
@@ -10,8 +10,6 @@ const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
|
10
10
|
const constants_1 = require("../../constants");
|
|
11
11
|
const material_1 = require("@mui/material");
|
|
12
12
|
const react_intl_1 = require("react-intl");
|
|
13
|
-
const Ios_1 = tslib_1.__importDefault(require("../../../../assets/onBoarding/Ios"));
|
|
14
|
-
const Android_1 = tslib_1.__importDefault(require("../../../../assets/onBoarding/Android"));
|
|
15
13
|
const types_1 = require("@selfcommunity/types");
|
|
16
14
|
const classes = {
|
|
17
15
|
root: `${constants_1.PREFIX}-app-root`,
|
|
@@ -56,7 +54,7 @@ function App(inProps) {
|
|
|
56
54
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
57
55
|
// @ts-ignore
|
|
58
56
|
b: (...chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
59
|
-
} }) })), (0, jsx_runtime_1.jsx)(material_1.CardMedia,
|
|
57
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.CardMedia, { className: classes.image, component: "img", src: "/onBoarding/ios.png" })] })), tab === 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.app.android", defaultMessage: "ui.onBoardingWidget.step.app.android" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.step }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.app.android.a", defaultMessage: "ui.onBoardingWidget.step.app.android.a", values: {
|
|
60
58
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
61
59
|
// @ts-ignore
|
|
62
60
|
icon: (...chunks) => (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "medium" }, { children: chunks })),
|
|
@@ -70,6 +68,6 @@ function App(inProps) {
|
|
|
70
68
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
71
69
|
// @ts-ignore
|
|
72
70
|
b: (...chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
73
|
-
} }) })), (0, jsx_runtime_1.jsx)(material_1.CardMedia,
|
|
71
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.CardMedia, { className: classes.image, component: "img", src: "/onBoarding/android.png" })] })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ className: classes.button, size: "small", variant: "outlined", color: "secondary", onClick: onCompleteAction, disabled: (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.COMPLETED || (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.IN_PROGRESS }, { children: "Ok!" }))] }))] })));
|
|
74
72
|
}
|
|
75
73
|
exports.default = App;
|
|
@@ -10,10 +10,9 @@ const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
|
10
10
|
const react_1 = require("react");
|
|
11
11
|
const react_intl_1 = require("react-intl");
|
|
12
12
|
const constants_1 = require("../../constants");
|
|
13
|
-
const CategoryA_1 = tslib_1.__importDefault(require("../../../../assets/onBoarding/CategoryA"));
|
|
14
|
-
const CategoryB_1 = tslib_1.__importDefault(require("../../../../assets/onBoarding/CategoryB"));
|
|
15
13
|
const ProgressBar_1 = tslib_1.__importDefault(require("../../../../shared/ProgressBar"));
|
|
16
14
|
const types_1 = require("@selfcommunity/types");
|
|
15
|
+
const react_lottie_player_1 = require("@lottiefiles/react-lottie-player");
|
|
17
16
|
const classes = {
|
|
18
17
|
root: `${constants_1.PREFIX}-category-root`,
|
|
19
18
|
title: `${constants_1.PREFIX}-category-title`,
|
|
@@ -21,7 +20,9 @@ const classes = {
|
|
|
21
20
|
image: `${constants_1.PREFIX}-category-image`,
|
|
22
21
|
action: `${constants_1.PREFIX}-category-action`,
|
|
23
22
|
button: `${constants_1.PREFIX}-category-button`,
|
|
24
|
-
success: `${constants_1.PREFIX}-success
|
|
23
|
+
success: `${constants_1.PREFIX}-success`,
|
|
24
|
+
progress: `${constants_1.PREFIX}-category-progress`,
|
|
25
|
+
animationProgress: `${constants_1.PREFIX}-category-animation-progress`
|
|
25
26
|
};
|
|
26
27
|
function CircledLetter({ letter, statement }) {
|
|
27
28
|
return ((0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ component: "span", sx: { display: 'flex', alignItems: 'center', gap: 1, mb: 1.5 } }, { children: [(0, jsx_runtime_1.jsx)(Box_1.default, Object.assign({ component: "span", sx: {
|
|
@@ -68,16 +69,16 @@ function Category(inProps) {
|
|
|
68
69
|
return () => clearInterval(intervalId);
|
|
69
70
|
}
|
|
70
71
|
}, [step.status, step.completion_percentage]);
|
|
71
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.categories", defaultMessage: "ui.onBoardingWidget.categories" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.category.summary", defaultMessage: "ui.onBoardingWidget.step.category.summary" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.category.generation.steps", defaultMessage: "ui.onBoardingWidget.step.category.generation.steps", values: {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.categories", defaultMessage: "ui.onBoardingWidget.categories" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.category.summary", defaultMessage: "ui.onBoardingWidget.step.category.summary" }) })), (step === null || step === void 0 ? void 0 : step.status) !== types_1.SCOnBoardingStepStatusType.IN_PROGRESS && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.category.generation.steps", defaultMessage: "ui.onBoardingWidget.step.category.generation.steps", values: {
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
iconA: (...chunks) => (0, jsx_runtime_1.jsx)(CircledLetter, { letter: "a", statement: chunks }),
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
iconB: (...chunks) => (0, jsx_runtime_1.jsx)(CircledLetter, { letter: "b", statement: chunks }),
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
iconC: (...chunks) => (0, jsx_runtime_1.jsx)(CircledLetter, { letter: "c", statement: chunks })
|
|
82
|
+
} }) }), (0, jsx_runtime_1.jsx)(material_1.CardMedia, { className: classes.image, component: "img", src: "/onBoarding/categoryA.svg" }), (0, jsx_runtime_1.jsx)(material_1.CardMedia, { className: classes.image, component: "img", src: "/onBoarding/categoryB.svg" })] })), (0, jsx_runtime_1.jsx)(Box_1.default, Object.assign({ component: "span", className: classes.action }, { children: (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.COMPLETED ? ((0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ severity: "success" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.categories.success", defaultMessage: "ui.onBoardingWidget.step.categories.success" }) }))) : (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.IN_PROGRESS ? ((0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.progress }, { children: [(0, jsx_runtime_1.jsx)(react_lottie_player_1.Player, { autoplay: true, loop: true, src: "/onBoarding/progress/category_progress.json", className: classes.animationProgress, controls: false }), (0, jsx_runtime_1.jsx)(ProgressBar_1.default, { value: progress, hideBar: true, loadingMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.categories.loading", defaultMessage: "ui.onBoardingWidget.step.categories.loading" }) })) })] }))) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: handleCategoriesCreation, endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: hover ? 'ai_stars' : 'magic_wand' }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.category.button", id: "ui.onBoardingWidget.step.category.button" }) }))) }))] })));
|
|
82
83
|
}
|
|
83
84
|
exports.default = Category;
|
|
@@ -12,11 +12,14 @@ const constants_1 = require("../../constants");
|
|
|
12
12
|
const react_intl_1 = require("react-intl");
|
|
13
13
|
const types_1 = require("@selfcommunity/types");
|
|
14
14
|
const ProgressBar_1 = tslib_1.__importDefault(require("../../../../shared/ProgressBar"));
|
|
15
|
+
const react_lottie_player_1 = require("@lottiefiles/react-lottie-player");
|
|
15
16
|
const classes = {
|
|
16
17
|
root: `${constants_1.PREFIX}-content-root`,
|
|
17
18
|
title: `${constants_1.PREFIX}-content-title`,
|
|
18
19
|
summary: `${constants_1.PREFIX}-content-summary`,
|
|
19
|
-
action: `${constants_1.PREFIX}-content-action
|
|
20
|
+
action: `${constants_1.PREFIX}-content-action`,
|
|
21
|
+
progress: `${constants_1.PREFIX}-content-progress`,
|
|
22
|
+
animationProgress: `${constants_1.PREFIX}-content-animation-progress`
|
|
20
23
|
};
|
|
21
24
|
const Root = (0, styles_1.styled)(Box_1.default, {
|
|
22
25
|
name: constants_1.PREFIX,
|
|
@@ -48,6 +51,6 @@ function Content(inProps) {
|
|
|
48
51
|
return () => clearInterval(intervalId);
|
|
49
52
|
}
|
|
50
53
|
}, [step.status, step.completion_percentage]);
|
|
51
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.contents", defaultMessage: "ui.onBoardingWidget.contents" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.content.summary", defaultMessage: "ui.onBoardingWidget.step.content.summary" }) })), (0, jsx_runtime_1.jsx)(Box_1.default, Object.assign({ component: "span", className: classes.action }, { children: (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.COMPLETED ? ((0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ severity: "success" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.contents.success", defaultMessage: "ui.onBoardingWidget.step.contents.success" }) }))) : (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.IN_PROGRESS ? ((0, jsx_runtime_1.jsx)(ProgressBar_1.default, { value: progress, loadingMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.contents.loading", defaultMessage: "ui.onBoardingWidget.step.contents.loading" }) })) })) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: handleContentCreation, endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: hover ? 'ai_stars' : 'magic_wand' }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.content.button", id: "ui.onBoardingWidget.step.content.button" }) }))) }))] })));
|
|
54
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.contents", defaultMessage: "ui.onBoardingWidget.contents" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.summary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.content.summary", defaultMessage: "ui.onBoardingWidget.step.content.summary" }) })), (0, jsx_runtime_1.jsx)(Box_1.default, Object.assign({ component: "span", className: classes.action }, { children: (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.COMPLETED ? ((0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ severity: "success" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.contents.success", defaultMessage: "ui.onBoardingWidget.step.contents.success" }) }))) : (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.IN_PROGRESS ? ((0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.progress }, { children: [(0, jsx_runtime_1.jsx)(react_lottie_player_1.Player, { autoplay: true, loop: true, src: "/onBoarding/progress/content_progress.json", className: classes.animationProgress, controls: false }), (0, jsx_runtime_1.jsx)(ProgressBar_1.default, { value: progress, hideBar: true, loadingMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.contents.loading", defaultMessage: "ui.onBoardingWidget.step.contents.loading" }) })) })] }))) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: handleContentCreation, endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: hover ? 'ai_stars' : 'magic_wand' }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.onBoardingWidget.step.content.button", id: "ui.onBoardingWidget.step.content.button" }) }))) }))] })));
|
|
52
55
|
}
|
|
53
56
|
exports.default = Content;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const EVENT_TITLE_MAX_LENGTH = 50;
|
|
2
|
-
export declare const EVENT_DESCRIPTION_MAX_LENGTH =
|
|
2
|
+
export declare const EVENT_DESCRIPTION_MAX_LENGTH = 500;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EVENT_DESCRIPTION_MAX_LENGTH = exports.EVENT_TITLE_MAX_LENGTH = void 0;
|
|
4
4
|
exports.EVENT_TITLE_MAX_LENGTH = 50;
|
|
5
|
-
exports.EVENT_DESCRIPTION_MAX_LENGTH =
|
|
5
|
+
exports.EVENT_DESCRIPTION_MAX_LENGTH = 500;
|
|
@@ -3,14 +3,17 @@ import React from 'react';
|
|
|
3
3
|
export interface EventInfoDetailsProps {
|
|
4
4
|
event: SCEventType;
|
|
5
5
|
hideDateIcon?: boolean;
|
|
6
|
+
hideRecurringIcon?: boolean;
|
|
6
7
|
hidePrivacyIcon?: boolean;
|
|
7
8
|
hideLocationIcon?: boolean;
|
|
8
9
|
hideCreatedIcon?: boolean;
|
|
9
10
|
hasDateInfo?: boolean;
|
|
11
|
+
hasRecurringInfo?: boolean;
|
|
10
12
|
hasPrivacyInfo?: boolean;
|
|
11
13
|
hasLocationInfo?: boolean;
|
|
12
14
|
hasCreatedInfo?: boolean;
|
|
13
15
|
beforeDateInfo?: React.ReactNode | null;
|
|
16
|
+
beforeRecurringInfo?: React.ReactNode | null;
|
|
14
17
|
beforePrivacyInfo?: React.ReactNode | null;
|
|
15
18
|
beforeLocationInfo?: React.ReactNode | null;
|
|
16
19
|
beforeCreatedInfo?: React.ReactNode | null;
|
|
@@ -4,13 +4,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
const material_1 = require("@mui/material");
|
|
5
5
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
6
6
|
const types_1 = require("@selfcommunity/types");
|
|
7
|
-
const date_fns_1 = require("date-fns");
|
|
8
|
-
const locale_1 = require("date-fns/locale");
|
|
9
7
|
const react_intl_1 = require("react-intl");
|
|
10
|
-
const LOCALE_MAP = {
|
|
11
|
-
en: locale_1.enUS,
|
|
12
|
-
it: locale_1.it
|
|
13
|
-
};
|
|
14
8
|
const PREFIX = 'SCEventInfoDetails';
|
|
15
9
|
const classes = {
|
|
16
10
|
root: `${PREFIX}-root`,
|
|
@@ -30,21 +24,26 @@ function EventInfoDetails(inProps) {
|
|
|
30
24
|
props: inProps,
|
|
31
25
|
name: PREFIX
|
|
32
26
|
});
|
|
33
|
-
const { event, hideDateIcon = false, hidePrivacyIcon = false, hideLocationIcon = false, hideCreatedIcon = false, hasDateInfo = true, hasPrivacyInfo = true, hasLocationInfo = true, hasCreatedInfo = false, beforeDateInfo, beforePrivacyInfo, beforeLocationInfo, beforeCreatedInfo } = props;
|
|
27
|
+
const { event, hideDateIcon = false, hideRecurringIcon = false, hidePrivacyIcon = false, hideLocationIcon = false, hideCreatedIcon = false, hasDateInfo = true, hasRecurringInfo = false, hasPrivacyInfo = true, hasLocationInfo = true, hasCreatedInfo = false, beforeDateInfo, beforeRecurringInfo, beforePrivacyInfo, beforeLocationInfo, beforeCreatedInfo } = props;
|
|
34
28
|
// HOOKS
|
|
35
29
|
const intl = (0, react_intl_1.useIntl)();
|
|
36
30
|
const privacy = event.privacy === types_1.SCEventPrivacyType.PUBLIC ? 'ui.eventInfoDetails.privacy.public' : 'ui.eventInfoDetails.privacy.private';
|
|
37
31
|
const location = event.location === types_1.SCEventLocationType.ONLINE ? 'ui.eventInfoDetails.location.virtual' : 'ui.eventInfoDetails.location.inPerson';
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [beforeDateInfo, hasDateInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideDateIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "CalendarIcon" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInfoDetails.date.startEndTime", defaultMessage: "ui.eventInfoDetails.date.startEndTime", values: {
|
|
33
|
+
date: intl.formatDate(event.running ? event.running_start_date : event.next_start_date, {
|
|
34
|
+
weekday: 'long',
|
|
35
|
+
day: 'numeric',
|
|
36
|
+
year: 'numeric',
|
|
37
|
+
month: 'long'
|
|
38
|
+
}),
|
|
39
|
+
start: intl.formatDate(event.running ? event.running_start_date : event.next_start_date, { hour: 'numeric', minute: 'numeric' })
|
|
40
|
+
} }) }))] }))), beforeRecurringInfo, hasRecurringInfo && event.recurring !== types_1.SCEventRecurrenceType.NEVER && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideRecurringIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "frequency" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventInfoDetails.frequency.${event.recurring}.placeholder`, defaultMessage: `ui.eventInfoDetails.frequency.${event.recurring}.placeholder` }) }))] }))), beforePrivacyInfo, hasPrivacyInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hidePrivacyIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: event.privacy === types_1.SCEventPrivacyType.PUBLIC ? 'public' : 'private' })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: privacy, defaultMessage: privacy }) })), "-", (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: location, defaultMessage: location }) }))] }))), beforeLocationInfo, hasLocationInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideLocationIcon && ((0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: event.location === types_1.SCEventLocationType.ONLINE ? 'play_circle_outline' : 'add_location_alt' }))), event.location === types_1.SCEventLocationType.ONLINE ? ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: event.link, target: "_blank", className: classes.link }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.url }, { children: event.link })) }))) : ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.url }, { children: event.geolocation })))] }))), beforeCreatedInfo, hasCreatedInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.creationWrapper }, { children: [!hideCreatedIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "create" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInfoDetails.date.create", defaultMessage: "ui.eventInfoDetails.date.create", values: {
|
|
41
|
+
date: intl.formatDate(event.created_at, {
|
|
42
|
+
weekday: 'long',
|
|
43
|
+
day: 'numeric',
|
|
44
|
+
year: 'numeric',
|
|
45
|
+
month: 'long'
|
|
46
|
+
})
|
|
47
|
+
} }) }))] })))] })));
|
|
49
48
|
}
|
|
50
49
|
exports.default = EventInfoDetails;
|
|
@@ -15,6 +15,11 @@ export interface ProgressBarProps extends LinearProgressProps {
|
|
|
15
15
|
* @default null
|
|
16
16
|
*/
|
|
17
17
|
loadingMessage?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Hides the bar, rendering just the massage and percentage
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
hideBar?: boolean;
|
|
18
23
|
/**
|
|
19
24
|
* Any other properties
|
|
20
25
|
*/
|
|
@@ -19,7 +19,7 @@ const Root = (0, styles_1.styled)(material_1.Box, {
|
|
|
19
19
|
overridesResolver: (props, styles) => styles.root
|
|
20
20
|
})(() => ({}));
|
|
21
21
|
function ProgressBar(props) {
|
|
22
|
-
const { className, value, loadingMessage = null } = props, rest = tslib_1.__rest(props, ["className", "value", "loadingMessage"]);
|
|
23
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.message }, { children: loadingMessage })), (0, jsx_runtime_1.jsx)(LinearProgress_1.default, Object.assign({ variant: "determinate", color: "success", className: classes.bar, value: value }, rest)), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.progress }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", color: "text.secondary" }, { children: `${Math.round(value)}%` })) }))] })));
|
|
22
|
+
const { className, value, loadingMessage = null, hideBar = false } = props, rest = tslib_1.__rest(props, ["className", "value", "loadingMessage", "hideBar"]);
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.message }, { children: loadingMessage })), !hideBar && (0, jsx_runtime_1.jsx)(LinearProgress_1.default, Object.assign({ variant: "determinate", color: "success", className: classes.bar, value: value }, rest)), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.progress }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", color: "text.secondary" }, { children: `${Math.round(value)}%` })) }))] })));
|
|
24
24
|
}
|
|
25
25
|
exports.default = ProgressBar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SCEventType } from '@selfcommunity/types';
|
|
2
|
-
import { EventSubscribeButtonProps } from '../EventSubscribeButton';
|
|
3
2
|
import { EventActionsMenuProps } from '../../shared/EventActionsMenu';
|
|
3
|
+
import { EventSubscribeButtonProps } from '../EventSubscribeButton';
|
|
4
4
|
export interface EventHeaderProps {
|
|
5
5
|
/**
|
|
6
6
|
* Id of event object
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { Box, Chip, Icon, Paper, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
|
-
import {
|
|
6
|
-
import { SCEventLocationType, SCEventPrivacyType } from '@selfcommunity/types';
|
|
5
|
+
import { useThemeProps } from '@mui/system';
|
|
7
6
|
import { SCPreferences, useSCFetchEvent, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
|
|
8
|
-
import
|
|
7
|
+
import { SCEventLocationType, SCEventPrivacyType } from '@selfcommunity/types';
|
|
9
8
|
import classNames from 'classnames';
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
9
|
+
import PubSub from 'pubsub-js';
|
|
10
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
12
11
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
13
|
-
import Bullet from '../../shared/Bullet';
|
|
14
|
-
import EventSubscribeButton from '../EventSubscribeButton';
|
|
15
|
-
import EventInviteButton from '../EventInviteButton';
|
|
16
12
|
import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
|
|
17
|
-
import
|
|
18
|
-
import EditEventButton from '../EditEventButton';
|
|
19
|
-
import User from '../User';
|
|
13
|
+
import Bullet from '../../shared/Bullet';
|
|
20
14
|
import Calendar from '../../shared/Calendar';
|
|
21
15
|
import EventActionsMenu from '../../shared/EventActionsMenu';
|
|
16
|
+
import EditEventButton from '../EditEventButton';
|
|
17
|
+
import EventInviteButton from '../EventInviteButton';
|
|
18
|
+
import EventSubscribeButton from '../EventSubscribeButton';
|
|
19
|
+
import User from '../User';
|
|
20
|
+
import { PREFIX } from './constants';
|
|
21
|
+
import EventHeaderSkeleton from './Skeleton';
|
|
22
22
|
const classes = {
|
|
23
23
|
root: `${PREFIX}-root`,
|
|
24
24
|
cover: `${PREFIX}-cover`,
|
|
25
25
|
time: `${PREFIX}-time`,
|
|
26
26
|
calendar: `${PREFIX}-calendar`,
|
|
27
|
+
inProgress: `${PREFIX}-in-progress`,
|
|
28
|
+
chip: `${PREFIX}-chip`,
|
|
27
29
|
info: `${PREFIX}-info`,
|
|
28
30
|
name: `${PREFIX}-name`,
|
|
29
31
|
visibility: `${PREFIX}-visibility`,
|
|
@@ -34,7 +36,7 @@ const classes = {
|
|
|
34
36
|
const Root = styled(Box, {
|
|
35
37
|
name: PREFIX,
|
|
36
38
|
slot: 'Root',
|
|
37
|
-
shouldForwardProp: (prop) => prop !== 'isEventAdmin'
|
|
39
|
+
shouldForwardProp: (prop) => prop !== 'isEventAdmin' && prop !== 'isEventFinished'
|
|
38
40
|
})(() => ({}));
|
|
39
41
|
/**
|
|
40
42
|
* > API documentation for the Community-JS Event Header component. Learn about the available props and the CSS API.
|
|
@@ -83,14 +85,20 @@ export default function EventHeader(inProps) {
|
|
|
83
85
|
const scUserContext = useSCUser();
|
|
84
86
|
// HOOKS
|
|
85
87
|
const { scEvent, setSCEvent } = useSCFetchEvent({ id: eventId, event });
|
|
88
|
+
const theme = useTheme();
|
|
89
|
+
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
86
90
|
// INTL
|
|
87
91
|
const intl = useIntl();
|
|
88
92
|
// REFS
|
|
89
93
|
const updatesSubscription = useRef(null);
|
|
90
94
|
// CONST
|
|
91
95
|
const isEventAdmin = useMemo(() => { var _a; return scUserContext.user && ((_a = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _a === void 0 ? void 0 : _a.id) === scUserContext.user.id; }, [scUserContext.user, (_a = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _a === void 0 ? void 0 : _a.id]);
|
|
92
|
-
const
|
|
93
|
-
|
|
96
|
+
const isEventFinished = useMemo(() => {
|
|
97
|
+
if (scEvent && !scEvent.running) {
|
|
98
|
+
return new Date().getTime() > new Date(scEvent.end_date || scEvent.start_date).getTime();
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
}, [scEvent]);
|
|
94
102
|
/**
|
|
95
103
|
* Subscriber for pubsub callback
|
|
96
104
|
*/
|
|
@@ -134,7 +142,7 @@ export default function EventHeader(inProps) {
|
|
|
134
142
|
return (
|
|
135
143
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
136
144
|
// @ts-ignore
|
|
137
|
-
_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className), isEventAdmin: isEventAdmin }, rest, { children: [_jsx(Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: _jsx(Box, Object.assign({ className: classes.calendar }, { children: _jsx(Calendar, { day: new Date(scEvent.start_date).getDate() }) })) })), _jsxs(Box, Object.assign({ className: classes.info }, { children: [_jsx(Typography, Object.assign({ className: classes.time }, { children: scEvent.end_date && scEvent.end_date !== scEvent.start_date ? (new Date(scEvent.start_date).getDate() !== new Date(scEvent.end_date).getDate() ? (_jsx(FormattedMessage, { id: "ui.eventHeader.startEndTimeDiff", defaultMessage: "ui.eventHeader.startEndTimeDiff", values: {
|
|
145
|
+
_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className), isEventAdmin: isEventAdmin, isEventFinished: isEventFinished }, rest, { children: [_jsx(Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: _jsx(Box, Object.assign({ className: classes.calendar }, { children: _jsx(Calendar, { day: new Date(scEvent.start_date).getDate() }) })) })), _jsxs(Box, Object.assign({ className: classes.info }, { children: [scEvent.running && (_jsx(Typography, Object.assign({ variant: "body1", className: classes.inProgress }, { children: _jsx(FormattedMessage, { id: "ui.eventHeader.inProgress", defaultMessage: "ui.eventHeader.inProgress" }) }))), isEventFinished && (_jsx(Chip, { icon: _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "calendar_off" })), label: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.eventHeader.finished", defaultMessage: "ui.eventHeader.finished" }) })), variant: "outlined", size: "small", className: classes.chip })), _jsx(Typography, Object.assign({ className: classes.time }, { children: scEvent.end_date && scEvent.end_date !== scEvent.start_date ? (new Date(scEvent.start_date).getDate() !== new Date(scEvent.end_date).getDate() ? (_jsx(FormattedMessage, { id: "ui.eventHeader.startEndTimeDiff", defaultMessage: "ui.eventHeader.startEndTimeDiff", values: {
|
|
138
146
|
startDate: intl.formatDate(scEvent.start_date, {
|
|
139
147
|
weekday: 'long',
|
|
140
148
|
day: 'numeric',
|
|
@@ -66,5 +66,5 @@ export default function EventInfoWidget(inProps) {
|
|
|
66
66
|
return _jsx(HiddenPlaceholder, {});
|
|
67
67
|
}
|
|
68
68
|
const description = expanded ? scEvent.description : getTruncatedText(scEvent.description, 220);
|
|
69
|
-
return (_jsx(Root, Object.assign({ className: classes.root }, rest, { children: _jsxs(CardContent, Object.assign({ className: classes.content }, { children: [_jsxs(Stack, Object.assign({ className: classes.titleWrapper }, { children: [_jsx(Icon, Object.assign({ fontSize: "small" }, { children: "info" })), _jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: "ui.infoEventWidget.title", defaultMessage: "ui.infoEventWidget.title" }) }))] })), _jsx(Box, Object.assign({ className: classes.textWrapper }, { children: _jsxs(Typography, Object.assign({ component: "span", variant: "body1" }, { children: [description, showButton && !expanded && (_jsx(Button, Object.assign({ size: "small", variant: "text", className: classes.showMore, onClick: handleToggleSummary }, { children: _jsx(FormattedMessage, { id: "ui.infoEventWidget.showMore", defaultMessage: "ui.infoEventWidget.showMore" }) })))] })) })), _jsx(EventInfoDetails, { event: scEvent, hasCreatedInfo: true })] })) })));
|
|
69
|
+
return (_jsx(Root, Object.assign({ className: classes.root }, rest, { children: _jsxs(CardContent, Object.assign({ className: classes.content }, { children: [_jsxs(Stack, Object.assign({ className: classes.titleWrapper }, { children: [_jsx(Icon, Object.assign({ fontSize: "small" }, { children: "info" })), _jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: "ui.infoEventWidget.title", defaultMessage: "ui.infoEventWidget.title" }) }))] })), _jsx(Box, Object.assign({ className: classes.textWrapper }, { children: _jsxs(Typography, Object.assign({ component: "span", variant: "body1" }, { children: [description, showButton && !expanded && (_jsx(Button, Object.assign({ size: "small", variant: "text", className: classes.showMore, onClick: handleToggleSummary }, { children: _jsx(FormattedMessage, { id: "ui.infoEventWidget.showMore", defaultMessage: "ui.infoEventWidget.showMore" }) })))] })) })), _jsx(EventInfoDetails, { event: scEvent, hasRecurringInfo: true, hasCreatedInfo: true })] })) })));
|
|
70
70
|
}
|
|
@@ -244,7 +244,7 @@ export default function EventInviteButton(inProps) {
|
|
|
244
244
|
/**
|
|
245
245
|
* Renders root object
|
|
246
246
|
*/
|
|
247
|
-
return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClose, variant: scEvent ? 'contained' : 'outlined', color: scEvent ? 'secondary' : 'inherit', startIcon: _jsx(Icon, { children: "add" }) }, rest, { children: _jsx(FormattedMessage, { id: "ui.eventInviteButton", defaultMessage: "ui.eventInviteButton" }) })), open && (_jsx(DialogRoot, Object.assign({ DialogContentProps: { dividers: false }, open: true, className: classes.dialogRoot, title: _jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ onClick: handleClose }, { children: _jsx(Icon, { children: "
|
|
247
|
+
return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClose, variant: scEvent ? 'contained' : 'outlined', color: scEvent ? 'secondary' : 'inherit', startIcon: _jsx(Icon, { children: "add" }) }, rest, { children: _jsx(FormattedMessage, { id: "ui.eventInviteButton", defaultMessage: "ui.eventInviteButton" }) })), open && (_jsx(DialogRoot, Object.assign({ DialogContentProps: { dividers: false }, open: true, className: classes.dialogRoot, title: _jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ onClick: handleClose }, { children: _jsx(Icon, { children: "close" }) })), _jsx(Typography, Object.assign({ className: classes.dialogTitle }, { children: _jsx(FormattedMessage, { id: "ui.eventInviteButton.dialog.title", defaultMessage: "ui.eventInviteButton.dialog.title" }) })), _jsx(LoadingButton, Object.assign({ size: "small", color: "secondary", variant: "contained", onClick: handleSendInvitations, loading: isSending, disabled: !invited.length }, { children: _jsx(FormattedMessage, { id: "ui.eventInviteButton.dialog.button.end", defaultMessage: "ui.eventInviteButton.dialog.button.end" }) }))] }) }, { children: _jsxs(Box, Object.assign({ className: classes.dialogContent }, { children: [_jsx(Autocomplete, { className: classes.autocomplete, loading: loading, size: "small", multiple: true, freeSolo: true, disableClearable: true, options: suggested, onChange: handleChange, onInputChange: handleInputChange, inputValue: value, filterOptions: filterOptions, value: invited, getOptionLabel: (option) => (option ? option.username : '...'), isOptionEqualToValue: (option, value) => (option ? value.id === option.id : false), renderTags: () => null, renderOption: (props, option) => (_jsxs(Box, Object.assign({ component: "li" }, props, { children: [_jsx(Avatar, { alt: option.username, src: option.avatar }), _jsx(Typography, Object.assign({ ml: 1 }, { children: option.username }))] }))), renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { variant: "outlined", placeholder: `${intl.formatMessage(messages.placeholder)}`, InputProps: Object.assign(Object.assign({}, params.InputProps), { className: classes.input, startAdornment: (_jsxs(_Fragment, { children: [_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, Object.assign({ className: classes.icon }, { children: "search" })) })), params.InputProps.startAdornment] })) }) }))) }), _jsx(Box, Object.assign({ className: classes.invitedBox }, { children: invited.map((option, index) => (_jsx(Chip, { avatar: _jsx(Avatar, { alt: option.username, src: option.avatar }), label: option.username, onDelete: () => {
|
|
248
248
|
handleDelete(option);
|
|
249
249
|
}, style: { marginRight: 8 } }, index))) })), _jsxs(Box, Object.assign({ className: classes.suggested }, { children: [list.length !== 0 && (_jsx(Typography, Object.assign({ variant: "h4", fontWeight: "bold" }, { children: _jsx(FormattedMessage, { id: "ui.eventInviteButton.dialog.content.list", defaultMessage: "ui.eventInviteButton.dialog.content.list" }) }))), list.slice(0, 5).map((user, index) => (_jsx(User, { elevation: 0, actions: _jsx(_Fragment, {}), user: user, userId: user.id, buttonProps: { onClick: () => handleUserInvite(user) } }, index)))] }))] })) })))] }));
|
|
250
250
|
}
|
|
@@ -16,7 +16,6 @@ import App from './Steps/App';
|
|
|
16
16
|
import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
|
|
17
17
|
import Widget from '../Widget';
|
|
18
18
|
import Content from './Steps/Content';
|
|
19
|
-
import Header from '../../assets/onBoarding/Header';
|
|
20
19
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
21
20
|
import { OnBoardingService, PreferenceService } from '@selfcommunity/api-services';
|
|
22
21
|
import { Logger } from '@selfcommunity/utils';
|
|
@@ -215,7 +214,7 @@ const OnBoardingWidget = (inProps) => {
|
|
|
215
214
|
if (!isAdmin) {
|
|
216
215
|
return _jsx(HiddenPlaceholder, {});
|
|
217
216
|
}
|
|
218
|
-
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsxs(AccordionRoot, Object.assign({ defaultExpanded: true, onChange: handleExpand, className: classes.accordionRoot, expanded: expanded }, { children: [_jsx(AccordionSummary, Object.assign({ expandIcon: _jsx(Icon, Object.assign({ fontSize: "medium" }, { children: "expand_more" })), "aria-controls": "accordion", id: "onBoarding-accordion" }, { children: _jsx(_Fragment, { children: expanded ? (_jsxs(_Fragment, { children: [!isMobile ? (_jsx(CardMedia,
|
|
217
|
+
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsxs(AccordionRoot, Object.assign({ defaultExpanded: true, onChange: handleExpand, className: classes.accordionRoot, expanded: expanded }, { children: [_jsx(AccordionSummary, Object.assign({ expandIcon: _jsx(Icon, Object.assign({ fontSize: "medium" }, { children: "expand_more" })), "aria-controls": "accordion", id: "onBoarding-accordion" }, { children: _jsx(_Fragment, { children: expanded ? (_jsxs(_Fragment, { children: [!isMobile ? (_jsx(CardMedia, { className: classes.logo, component: "img", src: "/onBoarding/header.svg" })) : (_jsx(Typography, Object.assign({ variant: "h4", textAlign: "center" }, { children: _jsx(FormattedMessage, { id: "ui.onBoardingWidget.accordion.expanded.title.mobile", defaultMessage: "ui.onBoardingWidget.accordion.expanded.title.mobile", values: {
|
|
219
218
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
220
219
|
// @ts-ignore
|
|
221
220
|
b: (chunks) => _jsx("strong", { children: chunks }),
|