@selfcommunity/react-ui 0.8.0-live.67 → 0.8.0-live.68

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 (32) hide show
  1. package/lib/cjs/components/Notification/LiveStream/LiveStream.d.ts +1 -1
  2. package/lib/cjs/components/Notification/LiveStream/LiveStream.js +10 -20
  3. package/lib/cjs/components/Notification/Notification.js +3 -2
  4. package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +4 -0
  5. package/lib/cjs/components/ToastNotifications/ToastNotifications.js +6 -2
  6. package/lib/cjs/components/UserLiveStreamWidget/Skeleton.d.ts +2 -0
  7. package/lib/cjs/components/UserLiveStreamWidget/Skeleton.js +28 -0
  8. package/lib/cjs/components/UserLiveStreamWidget/UserLiveStreamWidget.d.ts +47 -0
  9. package/lib/cjs/components/UserLiveStreamWidget/UserLiveStreamWidget.js +129 -0
  10. package/lib/cjs/components/UserLiveStreamWidget/constants.d.ts +1 -0
  11. package/lib/cjs/components/UserLiveStreamWidget/constants.js +4 -0
  12. package/lib/cjs/components/UserLiveStreamWidget/index.d.ts +4 -0
  13. package/lib/cjs/components/UserLiveStreamWidget/index.js +8 -0
  14. package/lib/cjs/index.d.ts +2 -1
  15. package/lib/cjs/index.js +4 -1
  16. package/lib/esm/components/Notification/LiveStream/LiveStream.d.ts +1 -1
  17. package/lib/esm/components/Notification/LiveStream/LiveStream.js +11 -21
  18. package/lib/esm/components/Notification/Notification.js +3 -2
  19. package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +4 -0
  20. package/lib/esm/components/ToastNotifications/ToastNotifications.js +6 -2
  21. package/lib/esm/components/UserLiveStreamWidget/Skeleton.d.ts +2 -0
  22. package/lib/esm/components/UserLiveStreamWidget/Skeleton.js +24 -0
  23. package/lib/esm/components/UserLiveStreamWidget/UserLiveStreamWidget.d.ts +47 -0
  24. package/lib/esm/components/UserLiveStreamWidget/UserLiveStreamWidget.js +126 -0
  25. package/lib/esm/components/UserLiveStreamWidget/constants.d.ts +1 -0
  26. package/lib/esm/components/UserLiveStreamWidget/constants.js +1 -0
  27. package/lib/esm/components/UserLiveStreamWidget/index.d.ts +4 -0
  28. package/lib/esm/components/UserLiveStreamWidget/index.js +4 -0
  29. package/lib/esm/index.d.ts +2 -1
  30. package/lib/esm/index.js +2 -1
  31. package/lib/umd/react-ui.js +1 -1
  32. package/package.json +7 -7
@@ -8,7 +8,7 @@ export interface NotificationLiveStreamProps extends Pick<NotificationItemProps,
8
8
  notificationObject: SCNotificationLiveStreamActivityType;
9
9
  }
10
10
  /**
11
- * This component render the content of the notification of type event
11
+ * This component render the content of the notification of type live stream
12
12
  * @constructor
13
13
  * @param props
14
14
  */
@@ -15,9 +15,9 @@ const lab_1 = require("@mui/lab");
15
15
  const UserDeletedSnackBar_1 = tslib_1.__importDefault(require("../../../shared/UserDeletedSnackBar"));
16
16
  const UserAvatar_1 = tslib_1.__importDefault(require("../../../shared/UserAvatar"));
17
17
  const constants_1 = require("../constants");
18
- const Event_1 = tslib_1.__importDefault(require("../../Event"));
18
+ const LiveStream_1 = tslib_1.__importDefault(require("../../LiveStream"));
19
19
  const classes = {
20
- root: `${constants_1.PREFIX}-event-root`,
20
+ root: `${constants_1.PREFIX}-live-root`,
21
21
  avatar: `${constants_1.PREFIX}-avatar`,
22
22
  actions: `${constants_1.PREFIX}-actions`,
23
23
  seeButton: `${constants_1.PREFIX}see-button`,
@@ -27,10 +27,10 @@ const classes = {
27
27
  };
28
28
  const Root = (0, styles_1.styled)(NotificationItem_1.default, {
29
29
  name: constants_1.PREFIX,
30
- slot: 'EventRoot'
30
+ slot: 'LiveStreamRoot'
31
31
  })(() => ({}));
32
32
  /**
33
- * This component render the content of the notification of type event
33
+ * This component render the content of the notification of type live stream
34
34
  * @constructor
35
35
  * @param props
36
36
  */
@@ -44,28 +44,19 @@ function LiveStreamNotification(props) {
44
44
  // CONST
45
45
  const isSnippetTemplate = template === types_1.SCNotificationObjectTemplateType.SNIPPET;
46
46
  const isToastTemplate = template === types_1.SCNotificationObjectTemplateType.TOAST;
47
- const intl = (0, react_intl_1.useIntl)();
48
47
  // RENDER
49
- if (isSnippetTemplate || isToastTemplate) {
48
+ if (isSnippetTemplate) {
50
49
  return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className, `${constants_1.PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({}, (!notificationObject.user.deleted && {
51
50
  to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
52
51
  }), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null }, { children: (0, jsx_runtime_1.jsx)(UserAvatar_1.default, Object.assign({ hide: !notificationObject.user.community_badge, smaller: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: notificationObject.user.username, variant: "circular", src: notificationObject.user.avatar, classes: { root: classes.avatar } }) })) })), primary: (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({}, (!notificationObject.user.deleted && {
53
52
  to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
54
- }), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.user.username })), ' ', (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.notification.event.${notificationObject.type}`, defaultMessage: `ui.notification.event.${notificationObject.type}`, values: {
53
+ }), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.user.username })), ' ', (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.notification.${notificationObject.type}.title`, defaultMessage: `ui.notification.${notificationObject.type}.title`, values: {
55
54
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
56
55
  // @ts-ignore
57
56
  icon: (...chunks) => (0, jsx_runtime_1.jsx)(material_1.Icon, { children: chunks }),
58
- event: notificationObject.live_stream.title,
57
+ live: notificationObject.live_stream.title,
59
58
  link: (...chunks) => (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: chunks }))
60
- } })] }), secondary: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.notification.event.dateTime", defaultMessage: "ui.notification.event.dateTime", values: {
61
- date: intl.formatDate(notificationObject.live_stream.created_at, {
62
- weekday: 'long',
63
- day: 'numeric',
64
- year: 'numeric',
65
- month: 'long'
66
- }),
67
- hour: intl.formatDate(notificationObject.live_stream.created_at, { hour: 'numeric', minute: 'numeric' })
68
- } }) })) }), footer: isToastTemplate ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [(0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ color: "primary" }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.notification.event.button.see", defaultMessage: "ui.notification.event.button.see" }) })) }))] }))) : ((0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at, className: classes.snippetTime })) }, rest)));
59
+ } })] }), footer: isToastTemplate ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [(0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ color: "primary" }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.notification.live_stream_started.join", defaultMessage: "ui.notification.live_stream_started.join" }) })) }))] }))) : ((0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at, className: classes.snippetTime })) }, rest)));
69
60
  }
70
61
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className, `${constants_1.PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({}, (!notificationObject.user.deleted && {
71
62
  to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
@@ -74,9 +65,8 @@ function LiveStreamNotification(props) {
74
65
  }), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.user.username })), ' ', (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.notification.${notificationObject.type}`, defaultMessage: `ui.notification.${notificationObject.type}`, values: {
75
66
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
76
67
  // @ts-ignore
77
- icon: (...chunks) => (0, jsx_runtime_1.jsx)(material_1.Icon, { children: chunks }),
78
- event: notificationObject.live_stream.title,
68
+ live: notificationObject.live_stream.title,
79
69
  link: (...chunks) => (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: chunks }))
80
- } }), (0, jsx_runtime_1.jsx)(Event_1.default, { event: notificationObject.live_stream, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), elevation: 0 })] }), actions: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [(0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at, className: classes.activeAt }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ color: 'primary', variant: "outlined", size: "small", classes: { root: classes.seeButton }, component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.notification.event.button.see", defaultMessage: "ui.notification.event.button.see" }) }))] })) }, rest)), openAlert && (0, jsx_runtime_1.jsx)(UserDeletedSnackBar_1.default, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
70
+ } }), (0, jsx_runtime_1.jsx)(LiveStream_1.default, { liveStream: notificationObject.live_stream, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), elevation: 0 })] }), actions: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [(0, jsx_runtime_1.jsx)(DateTimeAgo_1.default, { date: notificationObject.active_at, className: classes.activeAt }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ color: 'primary', variant: "outlined", size: "small", classes: { root: classes.seeButton }, component: react_core_1.Link, disabled: Boolean(notificationObject.live_stream.closed_at_by_host), to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.notification.live_stream_started.join", defaultMessage: "ui.notification.live_stream_started.join" }) }))] })) }, rest)), openAlert && (0, jsx_runtime_1.jsx)(UserDeletedSnackBar_1.default, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
81
71
  }
82
72
  exports.default = LiveStreamNotification;
@@ -18,6 +18,8 @@ const KindlyNoticeFor_1 = tslib_1.__importDefault(require("./KindlyNoticeFor"));
18
18
  const react_intl_1 = require("react-intl");
19
19
  const KindlyNoticeFlag_1 = tslib_1.__importDefault(require("./KindlyNoticeFlag"));
20
20
  const VoteUp_1 = tslib_1.__importDefault(require("./VoteUp"));
21
+ const Event_1 = tslib_1.__importDefault(require("./Event/Event"));
22
+ const LiveStream_1 = tslib_1.__importDefault(require("./LiveStream/LiveStream"));
21
23
  const Icon_1 = tslib_1.__importDefault(require("@mui/material/Icon"));
22
24
  const Errors_1 = require("../../constants/Errors");
23
25
  const contribution_1 = require("../../utils/contribution");
@@ -37,7 +39,6 @@ const UserDeletedSnackBar_1 = tslib_1.__importDefault(require("../../shared/User
37
39
  const UserAvatar_1 = tslib_1.__importDefault(require("../../shared/UserAvatar"));
38
40
  const constants_1 = require("./constants");
39
41
  const Group_1 = tslib_1.__importDefault(require("./Group"));
40
- const Event_1 = tslib_1.__importDefault(require("./Event/Event"));
41
42
  const messages = (0, react_intl_1.defineMessages)({
42
43
  receivePrivateMessage: {
43
44
  id: 'ui.notification.receivePrivateMessage',
@@ -309,7 +310,7 @@ function UserNotification(inProps) {
309
310
  return (0, jsx_runtime_1.jsx)(Event_1.default, { notificationObject: n }, i);
310
311
  }
311
312
  else if (n.type === types_1.SCNotificationTypologyType.LIVE_STREAM_STARTED) {
312
- return (0, jsx_runtime_1.jsx)(Event_1.default, { notificationObject: n }, i);
313
+ return (0, jsx_runtime_1.jsx)(LiveStream_1.default, { notificationObject: n }, i);
313
314
  }
314
315
  return null;
315
316
  }
@@ -36,6 +36,7 @@ const NotificationItem_1 = tslib_1.__importDefault(require("../../shared/Notific
36
36
  const constants_1 = require("./constants");
37
37
  const Group_1 = tslib_1.__importDefault(require("../Notification/Group"));
38
38
  const Event_1 = tslib_1.__importDefault(require("../Notification/Event/Event"));
39
+ const LiveStream_1 = tslib_1.__importDefault(require("../Notification/LiveStream"));
39
40
  const classes = {
40
41
  root: `${constants_1.PREFIX}-root`,
41
42
  notificationsWrap: `${constants_1.PREFIX}-notifications-wrap`,
@@ -269,6 +270,9 @@ function SnippetNotifications(inProps) {
269
270
  n.type === types_2.SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT) {
270
271
  return (0, jsx_runtime_1.jsx)(Event_1.default, { notificationObject: n, template: types_1.SCNotificationObjectTemplateType.SNIPPET }, i);
271
272
  }
273
+ else if (type === types_2.SCNotificationTypologyType.LIVE_STREAM_STARTED) {
274
+ content = (0, jsx_runtime_1.jsx)(LiveStream_1.default, { notificationObject: n, template: types_1.SCNotificationObjectTemplateType.SNIPPET }, i);
275
+ }
272
276
  if (type && handleNotification) {
273
277
  /** Override content */
274
278
  content = handleNotification(type, n, content);
@@ -9,8 +9,9 @@ const react_core_1 = require("@selfcommunity/react-core");
9
9
  const types_1 = require("@selfcommunity/types");
10
10
  const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
11
11
  const notistack_1 = require("notistack");
12
- const CustomSnackMessage_1 = tslib_1.__importDefault(require("../../shared/CustomSnackMessage"));
12
+ const constants_1 = require("./constants");
13
13
  const types_2 = require("../../types");
14
+ const CustomSnackMessage_1 = tslib_1.__importDefault(require("../../shared/CustomSnackMessage"));
14
15
  const Comment_1 = tslib_1.__importDefault(require("../Notification/Comment"));
15
16
  const ContributionFollow_1 = tslib_1.__importDefault(require("../Notification/ContributionFollow"));
16
17
  const UserFollow_1 = tslib_1.__importDefault(require("../Notification/UserFollow"));
@@ -24,9 +25,9 @@ const UserBlocked_1 = tslib_1.__importDefault(require("../Notification/UserBlock
24
25
  const Message_1 = tslib_1.__importDefault(require("../BroadcastMessages/Message"));
25
26
  const system_1 = require("@mui/system");
26
27
  const Contribution_1 = tslib_1.__importDefault(require("../Notification/Contribution"));
27
- const constants_1 = require("./constants");
28
28
  const Group_1 = tslib_1.__importDefault(require("../Notification/Group"));
29
29
  const Event_1 = tslib_1.__importDefault(require("../Notification/Event/Event"));
30
+ const LiveStream_1 = tslib_1.__importDefault(require("../Notification/LiveStream"));
30
31
  const Root = (0, styles_1.styled)(material_1.Box, {
31
32
  name: constants_1.PREFIX,
32
33
  slot: 'Root'
@@ -126,6 +127,9 @@ function UserToastNotifications(inProps) {
126
127
  type === types_1.SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT) {
127
128
  content = (0, jsx_runtime_1.jsx)(Event_1.default, { notificationObject: n.notification_obj, template: types_2.SCNotificationObjectTemplateType.TOAST });
128
129
  }
130
+ else if (type === types_1.SCNotificationTypologyType.LIVE_STREAM_STARTED) {
131
+ content = (0, jsx_runtime_1.jsx)(LiveStream_1.default, { notificationObject: n.notification_obj, template: types_2.SCNotificationObjectTemplateType.TOAST });
132
+ }
129
133
  }
130
134
  if (n.activity_type && n.activity_type === types_1.SCNotificationTypologyType.NOTIFICATION_BANNER) {
131
135
  /** Notification of type: 'notification_banner' */
@@ -0,0 +1,2 @@
1
+ import 'swiper/css';
2
+ export default function UserLiveStreamWidgetSkeleton(): JSX.Element;
@@ -0,0 +1,28 @@
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 system_1 = require("@mui/system");
7
+ const react_1 = require("react");
8
+ require("swiper/css");
9
+ const Event_1 = require("../Event");
10
+ const Widget_1 = tslib_1.__importDefault(require("../Widget"));
11
+ const constants_1 = require("./constants");
12
+ const classes = {
13
+ root: `${constants_1.PREFIX}-skeleton-root`,
14
+ content: `${constants_1.PREFIX}-content`,
15
+ user: `${constants_1.PREFIX}-user`,
16
+ liveWrapper: `${constants_1.PREFIX}-live-wrapper`,
17
+ event: `${constants_1.PREFIX}-event`,
18
+ actions: `${constants_1.PREFIX}-actions`
19
+ };
20
+ const Root = (0, system_1.styled)(Widget_1.default, {
21
+ name: constants_1.PREFIX,
22
+ slot: 'SkeletonRoot',
23
+ overridesResolver: (_props, styles) => styles.skeletonRoot
24
+ })(() => ({}));
25
+ function UserLiveStreamWidgetSkeleton() {
26
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardContent, Object.assign({ className: classes.content }, { children: (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.liveWrapper }, { children: [1, 2, 3, 4].map((_event, i, array) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, { elevation: 0, className: classes.event }), i < array.length - 1 && (0, jsx_runtime_1.jsx)(material_1.Divider, {})] }, i))) })) })), (0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "52px", height: "20px" }) }))] })));
27
+ }
28
+ exports.default = UserLiveStreamWidgetSkeleton;
@@ -0,0 +1,47 @@
1
+ import { SCUserType } from '@selfcommunity/types';
2
+ import { CacheStrategies } from '@selfcommunity/utils';
3
+ import 'swiper/css';
4
+ import { BaseDialogProps } from '../../shared/BaseDialog';
5
+ import { WidgetProps } from '../Widget';
6
+ import { LiveStreamProps } from '../LiveStream';
7
+ export interface UserLiveStreamWidgetProps extends WidgetProps {
8
+ /**
9
+ * The user id
10
+ * @default null
11
+ */
12
+ userId: number;
13
+ /**
14
+ * User Object
15
+ * @default null
16
+ */
17
+ user?: SCUserType;
18
+ /**
19
+ * Props to spread to single live stream object
20
+ * @default {}
21
+ */
22
+ liveStreamComponentProps?: LiveStreamProps;
23
+ /**
24
+ * API Query Params
25
+ * @default [{'limit': 20, 'offset': 0}]
26
+ */
27
+ endpointQueryParams?: Record<string, string | number>;
28
+ /**
29
+ * Caching strategies
30
+ * @default CacheStrategies.CACHE_FIRST
31
+ */
32
+ cacheStrategy?: CacheStrategies;
33
+ /**
34
+ * Props to spread to users suggestion dialog
35
+ * @default {}
36
+ */
37
+ dialogProps?: BaseDialogProps;
38
+ /**
39
+ * Limit param
40
+ */
41
+ limit?: number;
42
+ /**
43
+ * Other props
44
+ */
45
+ [p: string]: any;
46
+ }
47
+ export default function UserLiveStreamWidget(inProps: UserLiveStreamWidgetProps): JSX.Element;
@@ -0,0 +1,129 @@
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 system_1 = require("@mui/system");
7
+ const api_services_1 = require("@selfcommunity/api-services");
8
+ const react_core_1 = require("@selfcommunity/react-core");
9
+ const utils_1 = require("@selfcommunity/utils");
10
+ const react_1 = require("react");
11
+ const react_intl_1 = require("react-intl");
12
+ require("swiper/css");
13
+ const Errors_1 = require("../../constants/Errors");
14
+ const Pagination_1 = require("../../constants/Pagination");
15
+ const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
16
+ const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
17
+ const InfiniteScroll_1 = tslib_1.__importDefault(require("../../shared/InfiniteScroll"));
18
+ const widget_1 = require("../../utils/widget");
19
+ const Widget_1 = tslib_1.__importDefault(require("../Widget"));
20
+ const constants_1 = require("./constants");
21
+ const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
22
+ const LiveStream_1 = tslib_1.__importStar(require("../LiveStream"));
23
+ const messages = (0, react_intl_1.defineMessages)({
24
+ title: {
25
+ id: 'ui.userLiveStreamWidget.title',
26
+ defaultMessage: 'ui.userLiveStreamWidget.title'
27
+ }
28
+ });
29
+ const classes = {
30
+ root: `${constants_1.PREFIX}-root`,
31
+ content: `${constants_1.PREFIX}-content`,
32
+ header: `${constants_1.PREFIX}-header`,
33
+ avatarWrapper: `${constants_1.PREFIX}-avatar-wrapper`,
34
+ avatar: `${constants_1.PREFIX}-avatar`,
35
+ liveWrapper: `${constants_1.PREFIX}-live-wrapper`,
36
+ live: `${constants_1.PREFIX}-live`,
37
+ actions: `${constants_1.PREFIX}-actions`,
38
+ actionButton: `${constants_1.PREFIX}-action-button`,
39
+ dialogRoot: `${constants_1.PREFIX}-dialog-root`,
40
+ infiniteScroll: `${constants_1.PREFIX}-infinite-scroll`,
41
+ endMessage: `${constants_1.PREFIX}-end-message`
42
+ };
43
+ const Root = (0, system_1.styled)(Widget_1.default, {
44
+ name: constants_1.PREFIX,
45
+ slot: 'Root',
46
+ overridesResolver: (_props, styles) => styles.root
47
+ })(() => ({}));
48
+ const DialogRoot = (0, system_1.styled)(BaseDialog_1.default, {
49
+ name: constants_1.PREFIX,
50
+ slot: 'DialogRoot',
51
+ overridesResolver: (_props, styles) => styles.dialogRoot
52
+ })(() => ({}));
53
+ function UserLiveStreamWidget(inProps) {
54
+ // PROPS
55
+ const props = (0, material_1.useThemeProps)({
56
+ props: inProps,
57
+ name: constants_1.PREFIX
58
+ });
59
+ const { userId, user, liveStreamComponentProps = { elevation: 0, square: true }, endpointQueryParams = { limit: 5, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET }, cacheStrategy, dialogProps, limit = 5 } = props, rest = tslib_1.__rest(props, ["userId", "user", "liveStreamComponentProps", "endpointQueryParams", "cacheStrategy", "dialogProps", "limit"]);
60
+ // STATE
61
+ const [state, dispatch] = (0, react_1.useReducer)(widget_1.dataWidgetReducer, {
62
+ isLoadingNext: false,
63
+ next: null,
64
+ cacheKey: react_core_1.SCCache.getWidgetStateCacheKey(react_core_1.SCCache.USER_LIVE_STREAM_CACHE_PREFIX_KEY, (0, utils_1.isInteger)(userId) ? userId : user.id),
65
+ cacheStrategy,
66
+ visibleItems: limit
67
+ }, widget_1.stateWidgetInitializer);
68
+ const [openDialog, setOpenDialog] = (0, react_1.useState)(false);
69
+ // CONTEXT
70
+ const scUserContext = (0, react_core_1.useSCUser)();
71
+ const scPreferencesContext = (0, react_core_1.useSCPreferences)();
72
+ const { scUser } = (0, react_core_1.useSCFetchUser)({ id: userId, user });
73
+ // HOOKS
74
+ const intl = (0, react_intl_1.useIntl)();
75
+ // MEMO
76
+ const liveStreamEnabled = (0, react_1.useMemo)(() => react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in scPreferencesContext.preferences &&
77
+ scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value, [scPreferencesContext.preferences]);
78
+ console.log(liveStreamEnabled);
79
+ const _initComponent = (0, react_1.useCallback)(() => {
80
+ if (!state.initialized && !state.isLoadingNext) {
81
+ dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
82
+ api_services_1.UserApiClient.getUserLiveStream(scUser.id, endpointQueryParams)
83
+ .then((payload) => {
84
+ dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: Object.assign(Object.assign({}, payload), { initialized: true }) });
85
+ })
86
+ .catch((error) => {
87
+ dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
88
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
89
+ });
90
+ }
91
+ }, [scUser, state.isLoadingNext, state.initialized, dispatch]);
92
+ // EFFECTS
93
+ (0, react_1.useEffect)(() => {
94
+ let _t;
95
+ if (scUserContext.user && scUser && liveStreamEnabled) {
96
+ _t = setTimeout(_initComponent);
97
+ return () => {
98
+ clearTimeout(_t);
99
+ };
100
+ }
101
+ }, [scUserContext.user, scUser, liveStreamEnabled]);
102
+ // HANDLERS
103
+ /**
104
+ * Handles pagination
105
+ */
106
+ const handleNext = (0, react_1.useCallback)(() => {
107
+ dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
108
+ api_services_1.http
109
+ .request({
110
+ url: state.next,
111
+ method: api_services_1.Endpoints.GetLiveStream.method
112
+ })
113
+ .then((res) => {
114
+ dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: res.data });
115
+ });
116
+ }, [dispatch, state.next, state.isLoadingNext, state.initialized]);
117
+ const handleToggleDialogOpen = (0, react_1.useCallback)(() => {
118
+ setOpenDialog((prev) => !prev);
119
+ }, []);
120
+ if (!scUser && !state.initialized) {
121
+ return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
122
+ }
123
+ // RENDER
124
+ if (!scUser.user || (state === null || state === void 0 ? void 0 : state.count) === 0 || !liveStreamEnabled) {
125
+ return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
126
+ }
127
+ return ((0, jsx_runtime_1.jsxs)(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.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)("b", { children: intl.formatMessage(messages.title, { user: scUser.username }) }) })), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.liveWrapper }, { children: state === null || state === void 0 ? void 0 : state.results.map((_live, i, array) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(LiveStream_1.default, Object.assign({ liveStream: _live }, liveStreamComponentProps, { className: classes.live })), i < array.length - 1 && (0, jsx_runtime_1.jsx)(material_1.Divider, {})] }, i))) }))] })), state.count > state.visibleItems && ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen, className: classes.actionButton }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.userLiveStreamWidget.showAll", defaultMessage: "ui.userLiveStreamWidget.showAll" }) })) })) }))), openDialog && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: intl.formatMessage(messages.title, { user: scUser.username }), onClose: handleToggleDialogOpen, open: openDialog }, dialogProps, { children: (0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: state.results.length, next: handleNext, hasMoreNext: Boolean(state.next), loaderNext: (0, jsx_runtime_1.jsx)(LiveStream_1.LiveStreamSkeleton, Object.assign({ elevation: 0 }, liveStreamComponentProps)), className: classes.infiniteScroll, endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.userLiveStreamWidget.noMoreResults", defaultMessage: "ui.userLiveStreamWidget.noMoreResults" }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, { children: state.results.map((live) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(LiveStream_1.default, Object.assign({ elevation: 0, liveStream: live }, liveStreamComponentProps)) }, live.id))) }) })) })))] })));
128
+ }
129
+ exports.default = UserLiveStreamWidget;
@@ -0,0 +1 @@
1
+ export declare const PREFIX = "SCUserLiveStreamWidget";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PREFIX = void 0;
4
+ exports.PREFIX = 'SCUserLiveStreamWidget';
@@ -0,0 +1,4 @@
1
+ import UserLiveStreamWidget, { UserLiveStreamWidgetProps } from './UserLiveStreamWidget';
2
+ import UserLiveStreamWidgetSkeleton from './Skeleton';
3
+ export default UserLiveStreamWidget;
4
+ export { UserLiveStreamWidgetSkeleton, type UserLiveStreamWidgetProps };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserLiveStreamWidgetSkeleton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const UserLiveStreamWidget_1 = tslib_1.__importDefault(require("./UserLiveStreamWidget"));
6
+ const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
7
+ exports.UserLiveStreamWidgetSkeleton = Skeleton_1.default;
8
+ exports.default = UserLiveStreamWidget_1.default;
@@ -124,6 +124,7 @@ import UserProfileHeader, { UserProfileHeaderProps, UserProfileHeaderSkeleton }
124
124
  import UserSocialAssociation, { UserSocialAssociationProps } from './components/UserSocialAssociation';
125
125
  import UserSubscribedGroupsWidget, { UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton } from './components/UserSubscribedGroupsWidget';
126
126
  import UserSuggestionWidget, { UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton } from './components/UserSuggestionWidget';
127
+ import UserLiveStreamWidget, { UserLiveStreamWidgetProps, UserLiveStreamWidgetSkeleton } from './components/UserLiveStreamWidget';
127
128
  import Widget, { WidgetProps } from './components/Widget';
128
129
  import { MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO } from './constants/Media';
129
130
  import LiveStream, { LiveStreamProps, LiveStreamSkeletonProps, LiveStreamSkeleton } from './components/LiveStream';
@@ -185,4 +186,4 @@ import LogoSelfCommunity from './assets/logo';
185
186
  /**
186
187
  * List all exports
187
188
  */
188
- export { AcceptRequestUserEventButton, AcceptRequestUserEventButtonProps, AccountChangeMailValidation, AccountChangeMailValidationProps, AccountDataPortability, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDataPortabilityProps, AccountDelete, AccountDeleteButton, AccountDeleteButtonProps, AccountDeleteProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AvatarGroupSkeleton, BaseDialog, BaseDialogProps, BaseItem, BaseItemProps, BaseLightbox, BaseLightboxProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, bytesToSize, generateRoomId, randomString, decodePassphrase, encodePassphrase, Calendar, CalendarProps, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowButton, CategoryFollowButtonProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoryProps, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CentralProgress, ChangeCover, ChangeCoverProps, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, ChangePicture, ChangePictureProps, CommentObject, CommentObjectProps, CommentObjectReply, CommentObjectReplyProps, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectProps, CommentsObjectSkeleton, Composer, ComposerIconButton, ComposerIconButtonProps, ComposerProps, ConfirmDialog, ConnectionUserButton, ConsentSolution, ConsentSolutionButton, ConsentSolutionButtonProps, ConsentSolutionProps, ConsentSolutionSkeleton, ContributionUtils, CreateEventButton, CreateEventButtonProps, CreateEventWidget, CreateEventWidgetProps, CreateEventWidgetSkeleton, CreateGroupButton, EventForm, EventFormProps, EventFormDialog, EventFormDialogProps, CreateGroupButtonProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultDrawerContentProps, DefaultHeaderContent, DefaultHeaderContentProps, EditEventButton, EditEventButtonProps, EditGroupButton, EditGroupButtonProps, EditMediaProps, Editor, EditorProps, EditorSkeleton, EmailTextField, Event, EventActionsMenu, EventActionsMenuProps, EventHeader, EventHeaderProps, EventHeaderSkeleton, EventInfoDetails, EventInfoDetailsProps, EventInfoWidget, EventInfoWidgetProps, EventInviteButton, EventInviteButtonProps, EventLocationWidget, EventLocationWidgetProps, EventLocationWidgetSkeleton, EventMediaWidget, EventMediaWidgetProps, EventMediaWidgetSkeleton, EventMembersWidget, EventMembersWidgetProps, EventMembersWidgetSkeleton, EventParticipantsButton, EventParticipantsButtonProps, EventProps, Events, EventSkeleton, EventSkeletonProps, EventsProps, EventsSkeleton, EventsSkeletonProps, FACEBOOK_SHARE, Feed, FeedObject, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedObjectProps, FeedObjectSkeleton, FeedProps, FeedRef, FeedSidebarProps, FeedSkeleton, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, File, FollowUserButton, FollowUserButtonProps, Footer, FooterProps, FooterSkeleton, FriendshipButtonProps, FriendshipUserButton, GenericSkeleton, getRelativeTime, getUnseenNotification, getUnseenNotificationCounter, Group, GroupActionsMenu, GroupActionsMenuProps, GroupForm, GroupFormProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, GroupInviteButton, GroupInviteButtonProps, GroupInvitedWidget, GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton, GroupMembersButton, GroupMembersButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupProps, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupSettingsIconButton, GroupSettingsIconButtonProps, GroupSkeleton, GroupsProps, GroupsSkeleton, GroupSubscribeButton, GroupSubscribeButtonProps, HiddenPlaceholder, Incubator, IncubatorDetail, IncubatorDetailProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorProps, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, InfiniteScroll, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, InviteUserEventButton, InviteUserEventButtonProps, LanguageSwitcher, LEGAL_POLICIES, Lightbox, LightboxProps, Link, LINKEDIN_SHARE, LocationAutocomplete, LocationAutocompleteProps, LogoSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, MediaChunkUploader, MediaChunkUploaderProps, MessageUploaderUtils, MetadataField, MetadataFieldProps, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetProps, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuDrawer, NavigationMenuDrawerProps, NavigationMenuHeader, NavigationMenuIconButton, NavigationMenuIconButtonProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbar, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbarProps, NavigationToolbarSkeleton, Notification, NotificationProps, NotificationSkeleton, OnBoardingWidget, OnBoardingWidgetProps, OnBoardingWidgetSkeleton, PasswordTextField, PhoneTextField, PlatformWidget, PlatformWidgetActionType, PlatformWidgetProps, PlatformWidgetSkeleton, PollSuggestionWidget, PollSuggestionWidgetProps, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageThread, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, ProgressBar, ProgressBarProps, RelatedEventsWidget, RelatedEventsWidgetProps, RelatedEventsWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectsWidgetSkeleton, RelatedFeedObjectWidgetProps, ReplyComment, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventMembersEventType, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCGroupMembersEventType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Share, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, StickyBox, StickyBoxComponent, StickyBoxProps, SuggestedEventsWidget, SuggestedEventsWidgetProps, SuggestedEventsWidgetSkeleton, TagChip, TagChipProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, UrlTextField, User, UserActionIconButton, UserActionIconButtonProps, UserAvatar, UserAvatarProps, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserCounters, UserCountersProps, UserDeletedSnackBar, UserDeletedSnackBarProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserInfo, UserInfoDialog, UserInfoDialogProps, UserInfoProps, UserInfoSkeleton, UsernameTextField, UserProfileBlocked, UserProfileBlockedProps, UserProfileEdit, UserProfileEditProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSkeleton, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserProps, UserSkeleton, UserSocialAssociation, UserSocialAssociationProps, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, useStickyBox, UseStickyBoxProps, LiveStream, LiveStreamProps, LiveStreamSkeletonProps, LiveStreamSkeleton, LiveStreamInfoDetails, LiveStreamInfoDetailsProps, CreateLiveStreamDialog, CreateLiveStreamDialogProps, CreateLiveStreamButton, CreateLiveStreamButtonProps, LiveStreamForm, LiveStreamFormProps, LiveStreamRoom, LiveStreamRoomProps, LiveStreamVideoConference, LiveStreamVideoConferenceProps, VirtualScrollerItemProps, Widget, WidgetProps, X_SHARE };
189
+ export { AcceptRequestUserEventButton, AcceptRequestUserEventButtonProps, AccountChangeMailValidation, AccountChangeMailValidationProps, AccountDataPortability, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDataPortabilityProps, AccountDelete, AccountDeleteButton, AccountDeleteButtonProps, AccountDeleteProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AvatarGroupSkeleton, BaseDialog, BaseDialogProps, BaseItem, BaseItemProps, BaseLightbox, BaseLightboxProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, bytesToSize, generateRoomId, randomString, decodePassphrase, encodePassphrase, Calendar, CalendarProps, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowButton, CategoryFollowButtonProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoryProps, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CentralProgress, ChangeCover, ChangeCoverProps, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, ChangePicture, ChangePictureProps, CommentObject, CommentObjectProps, CommentObjectReply, CommentObjectReplyProps, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectProps, CommentsObjectSkeleton, Composer, ComposerIconButton, ComposerIconButtonProps, ComposerProps, ConfirmDialog, ConnectionUserButton, ConsentSolution, ConsentSolutionButton, ConsentSolutionButtonProps, ConsentSolutionProps, ConsentSolutionSkeleton, ContributionUtils, CreateEventButton, CreateEventButtonProps, CreateEventWidget, CreateEventWidgetProps, CreateEventWidgetSkeleton, CreateGroupButton, EventForm, EventFormProps, EventFormDialog, EventFormDialogProps, CreateGroupButtonProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultDrawerContentProps, DefaultHeaderContent, DefaultHeaderContentProps, EditEventButton, EditEventButtonProps, EditGroupButton, EditGroupButtonProps, EditMediaProps, Editor, EditorProps, EditorSkeleton, EmailTextField, Event, EventActionsMenu, EventActionsMenuProps, EventHeader, EventHeaderProps, EventHeaderSkeleton, EventInfoDetails, EventInfoDetailsProps, EventInfoWidget, EventInfoWidgetProps, EventInviteButton, EventInviteButtonProps, EventLocationWidget, EventLocationWidgetProps, EventLocationWidgetSkeleton, EventMediaWidget, EventMediaWidgetProps, EventMediaWidgetSkeleton, EventMembersWidget, EventMembersWidgetProps, EventMembersWidgetSkeleton, EventParticipantsButton, EventParticipantsButtonProps, EventProps, Events, EventSkeleton, EventSkeletonProps, EventsProps, EventsSkeleton, EventsSkeletonProps, FACEBOOK_SHARE, Feed, FeedObject, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedObjectProps, FeedObjectSkeleton, FeedProps, FeedRef, FeedSidebarProps, FeedSkeleton, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, File, FollowUserButton, FollowUserButtonProps, Footer, FooterProps, FooterSkeleton, FriendshipButtonProps, FriendshipUserButton, GenericSkeleton, getRelativeTime, getUnseenNotification, getUnseenNotificationCounter, Group, GroupActionsMenu, GroupActionsMenuProps, GroupForm, GroupFormProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, GroupInviteButton, GroupInviteButtonProps, GroupInvitedWidget, GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton, GroupMembersButton, GroupMembersButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupProps, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupSettingsIconButton, GroupSettingsIconButtonProps, GroupSkeleton, GroupsProps, GroupsSkeleton, GroupSubscribeButton, GroupSubscribeButtonProps, HiddenPlaceholder, Incubator, IncubatorDetail, IncubatorDetailProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorProps, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, InfiniteScroll, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, InviteUserEventButton, InviteUserEventButtonProps, LanguageSwitcher, LEGAL_POLICIES, Lightbox, LightboxProps, Link, LINKEDIN_SHARE, LocationAutocomplete, LocationAutocompleteProps, LogoSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, MediaChunkUploader, MediaChunkUploaderProps, MessageUploaderUtils, MetadataField, MetadataFieldProps, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetProps, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuDrawer, NavigationMenuDrawerProps, NavigationMenuHeader, NavigationMenuIconButton, NavigationMenuIconButtonProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbar, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbarProps, NavigationToolbarSkeleton, Notification, NotificationProps, NotificationSkeleton, OnBoardingWidget, OnBoardingWidgetProps, OnBoardingWidgetSkeleton, PasswordTextField, PhoneTextField, PlatformWidget, PlatformWidgetActionType, PlatformWidgetProps, PlatformWidgetSkeleton, PollSuggestionWidget, PollSuggestionWidgetProps, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageThread, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, ProgressBar, ProgressBarProps, RelatedEventsWidget, RelatedEventsWidgetProps, RelatedEventsWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectsWidgetSkeleton, RelatedFeedObjectWidgetProps, ReplyComment, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventMembersEventType, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCGroupMembersEventType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Share, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, StickyBox, StickyBoxComponent, StickyBoxProps, SuggestedEventsWidget, SuggestedEventsWidgetProps, SuggestedEventsWidgetSkeleton, TagChip, TagChipProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, UrlTextField, User, UserActionIconButton, UserActionIconButtonProps, UserAvatar, UserAvatarProps, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserCounters, UserCountersProps, UserDeletedSnackBar, UserDeletedSnackBarProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserInfo, UserInfoDialog, UserInfoDialogProps, UserInfoProps, UserInfoSkeleton, UsernameTextField, UserProfileBlocked, UserProfileBlockedProps, UserProfileEdit, UserProfileEditProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSkeleton, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserProps, UserSkeleton, UserSocialAssociation, UserSocialAssociationProps, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, UserLiveStreamWidget, UserLiveStreamWidgetProps, UserLiveStreamWidgetSkeleton, useStickyBox, UseStickyBoxProps, LiveStream, LiveStreamProps, LiveStreamSkeletonProps, LiveStreamSkeleton, LiveStreamInfoDetails, LiveStreamInfoDetailsProps, CreateLiveStreamDialog, CreateLiveStreamDialogProps, CreateLiveStreamButton, CreateLiveStreamButtonProps, LiveStreamForm, LiveStreamFormProps, LiveStreamRoom, LiveStreamRoomProps, LiveStreamVideoConference, LiveStreamVideoConferenceProps, VirtualScrollerItemProps, Widget, WidgetProps, X_SHARE };
package/lib/cjs/index.js CHANGED
@@ -5,7 +5,7 @@ exports.FeedObject = exports.Feed = exports.FACEBOOK_SHARE = exports.EventsSkele
5
5
  exports.LocationAutocomplete = exports.LINKEDIN_SHARE = exports.Link = exports.Lightbox = exports.LEGAL_POLICIES = exports.LanguageSwitcher = exports.InviteUserEventButton = exports.InlineComposerWidgetSkeleton = exports.InlineComposerWidget = exports.InfiniteScroll = exports.IncubatorSuggestionWidget = exports.IncubatorSubscribeButton = exports.IncubatorListWidget = exports.IncubatorDetail = exports.Incubator = exports.HiddenPlaceholder = exports.GroupSubscribeButton = exports.GroupsSkeleton = exports.GroupSkeleton = exports.GroupSettingsIconButton = exports.Groups = exports.GroupRequestsWidgetSkeleton = exports.GroupRequestsWidget = exports.GroupMembersWidgetSkeleton = exports.GroupMembersWidget = exports.GroupMembersButton = exports.GroupInvitedWidgetSkeleton = exports.GroupInvitedWidget = exports.GroupInviteButton = exports.GroupInfoWidgetSkeleton = exports.GroupInfoWidget = exports.GroupHeaderSkeleton = exports.GroupHeader = exports.GroupForm = exports.GroupActionsMenu = exports.Group = exports.getUnseenNotificationCounter = exports.getUnseenNotification = exports.getRelativeTime = exports.GenericSkeleton = exports.FriendshipUserButton = exports.FooterSkeleton = exports.Footer = exports.FollowUserButton = exports.File = exports.FeedUpdatesWidgetSkeleton = exports.FeedUpdatesWidget = exports.FeedSkeleton = exports.FeedObjectSkeleton = exports.FeedObjectMediaPreview = void 0;
6
6
  exports.PrivateMessageThreadItem = exports.PrivateMessageThread = exports.PrivateMessageSnippetsSkeleton = exports.PrivateMessageSnippets = exports.PrivateMessageSnippetItemSkeleton = exports.PrivateMessageSnippetItem = exports.PrivateMessageSettingsIconButton = exports.PrivateMessageEditorSkeleton = exports.PrivateMessageEditor = exports.PrivateMessageComponentSkeleton = exports.PrivateMessageComponent = exports.PollSuggestionWidget = exports.PlatformWidgetSkeleton = exports.PlatformWidget = exports.PhoneTextField = exports.PasswordTextField = exports.OnBoardingWidgetSkeleton = exports.OnBoardingWidget = exports.NotificationSkeleton = exports.Notification = exports.NavigationToolbarSkeleton = exports.NavigationToolbarMobileSkeleton = exports.NavigationToolbarMobile = exports.NavigationToolbar = exports.NavigationSettingsIconButton = exports.NavigationMenuIconButton = exports.NavigationMenuHeader = exports.NavigationMenuDrawer = exports.NavigationMenuContent = exports.MyEventsWidgetSkeleton = exports.MyEventsWidget = exports.MIN_PRELOAD_OFFSET_VIEWPORT = exports.MetadataField = exports.MessageUploaderUtils = exports.MediaChunkUploader = exports.MEDIA_TYPE_VIDEO = exports.MEDIA_TYPE_URL = exports.MEDIA_TYPE_SHARE = exports.MEDIA_TYPE_LINK = exports.MEDIA_TYPE_IMAGE = exports.MEDIA_TYPE_EVENT = exports.MEDIA_TYPE_EMBED = exports.MEDIA_TYPE_DOCUMENT = exports.MEDIA_EMBED_SC_SHARED_OBJECT = exports.MEDIA_EMBED_SC_SHARED_EVENT = exports.MEDIA_EMBED_SC_LINK_TYPE = exports.MAX_PRELOAD_OFFSET_VIEWPORT = exports.LoyaltyProgramWidgetSkeleton = exports.LoyaltyProgramWidget = exports.LogoSelfCommunity = void 0;
7
7
  exports.UsernameTextField = exports.UserInfoSkeleton = exports.UserInfoDialog = exports.UserInfo = exports.UserFollowersWidgetSkeleton = exports.UserFollowersWidget = exports.UserFollowedUsersWidgetSkeleton = exports.UserFollowedUsersWidget = exports.UserFollowedCategoriesWidgetSkeleton = exports.UserFollowedCategoriesWidget = exports.UserDeletedSnackBar = exports.UserCounters = exports.UserConnectionsWidgetSkeleton = exports.UserConnectionsWidget = exports.UserConnectionsRequestsWidgetSkeleton = exports.UserConnectionsRequestsWidget = exports.UserConnectionsRequestsSentWidgetSkeleton = exports.UserConnectionsRequestsSentWidget = exports.UserAvatar = exports.UserActionIconButton = exports.User = exports.UrlTextField = exports.ToastNotificationsSkeleton = exports.ToastNotifications = exports.TagChip = exports.SuggestedEventsWidgetSkeleton = exports.SuggestedEventsWidget = exports.StickyBox = exports.SnippetNotificationsSkeleton = exports.SnippetNotifications = exports.Share = exports.SearchDialog = exports.SearchAutocomplete = exports.SCUserSocialAssociations = exports.SCUserProfileSettings = exports.SCUserProfileFields = exports.SCNotificationObjectTemplateType = exports.SCFeedObjectTemplateType = exports.SCFeedObjectActivitiesType = exports.SCEventTemplateType = exports.SCCommentsOrderBy = exports.SCBroadcastMessageTemplateType = exports.ReplyComment = exports.RelatedFeedObjectsWidgetSkeleton = exports.RelatedFeedObjectsWidget = exports.RelatedEventsWidgetSkeleton = exports.RelatedEventsWidget = exports.ProgressBar = exports.PrivateMessageThreadSkeleton = exports.PrivateMessageThreadItemSkeleton = void 0;
8
- exports.X_SHARE = exports.Widget = exports.LiveStreamVideoConference = exports.LiveStreamRoom = exports.LiveStreamForm = exports.CreateLiveStreamButton = exports.CreateLiveStreamDialog = exports.LiveStreamInfoDetails = exports.LiveStreamSkeleton = exports.LiveStream = exports.useStickyBox = exports.UserSuggestionWidgetSkeleton = exports.UserSuggestionWidget = exports.UserSubscribedGroupsWidgetSkeleton = exports.UserSubscribedGroupsWidget = exports.UserSocialAssociation = exports.UserSkeleton = exports.UserProfileHeaderSkeleton = exports.UserProfileHeader = exports.UserProfileEditSkeleton = exports.UserProfileEditSectionSettings = exports.UserProfileEditSectionPublicInfo = exports.UserProfileEditSectionAccount = exports.UserProfileEdit = exports.UserProfileBlocked = void 0;
8
+ exports.X_SHARE = exports.Widget = exports.LiveStreamVideoConference = exports.LiveStreamRoom = exports.LiveStreamForm = exports.CreateLiveStreamButton = exports.CreateLiveStreamDialog = exports.LiveStreamInfoDetails = exports.LiveStreamSkeleton = exports.LiveStream = exports.useStickyBox = exports.UserLiveStreamWidgetSkeleton = exports.UserLiveStreamWidget = exports.UserSuggestionWidgetSkeleton = exports.UserSuggestionWidget = exports.UserSubscribedGroupsWidgetSkeleton = exports.UserSubscribedGroupsWidget = exports.UserSocialAssociation = exports.UserSkeleton = exports.UserProfileHeaderSkeleton = exports.UserProfileHeader = exports.UserProfileEditSkeleton = exports.UserProfileEditSectionSettings = exports.UserProfileEditSectionPublicInfo = exports.UserProfileEditSectionAccount = exports.UserProfileEdit = exports.UserProfileBlocked = void 0;
9
9
  const tslib_1 = require("tslib");
10
10
  /**
11
11
  * Components
@@ -327,6 +327,9 @@ Object.defineProperty(exports, "UserSubscribedGroupsWidgetSkeleton", { enumerabl
327
327
  const UserSuggestionWidget_1 = tslib_1.__importStar(require("./components/UserSuggestionWidget"));
328
328
  exports.UserSuggestionWidget = UserSuggestionWidget_1.default;
329
329
  Object.defineProperty(exports, "UserSuggestionWidgetSkeleton", { enumerable: true, get: function () { return UserSuggestionWidget_1.UserSuggestionWidgetSkeleton; } });
330
+ const UserLiveStreamWidget_1 = tslib_1.__importStar(require("./components/UserLiveStreamWidget"));
331
+ exports.UserLiveStreamWidget = UserLiveStreamWidget_1.default;
332
+ Object.defineProperty(exports, "UserLiveStreamWidgetSkeleton", { enumerable: true, get: function () { return UserLiveStreamWidget_1.UserLiveStreamWidgetSkeleton; } });
330
333
  const Widget_1 = tslib_1.__importDefault(require("./components/Widget"));
331
334
  exports.Widget = Widget_1.default;
332
335
  const Media_1 = require("./constants/Media");
@@ -8,7 +8,7 @@ export interface NotificationLiveStreamProps extends Pick<NotificationItemProps,
8
8
  notificationObject: SCNotificationLiveStreamActivityType;
9
9
  }
10
10
  /**
11
- * This component render the content of the notification of type event
11
+ * This component render the content of the notification of type live stream
12
12
  * @constructor
13
13
  * @param props
14
14
  */
@@ -4,7 +4,7 @@ import { useState } from 'react';
4
4
  import { styled } from '@mui/material/styles';
5
5
  import { Avatar, Box, Icon, Stack, Typography } from '@mui/material';
6
6
  import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
7
- import { FormattedMessage, useIntl } from 'react-intl';
7
+ import { FormattedMessage } from 'react-intl';
8
8
  import DateTimeAgo from '../../../shared/DateTimeAgo';
9
9
  import classNames from 'classnames';
10
10
  import { SCNotificationObjectTemplateType } from '../../../types';
@@ -13,9 +13,9 @@ import { LoadingButton } from '@mui/lab';
13
13
  import UserDeletedSnackBar from '../../../shared/UserDeletedSnackBar';
14
14
  import UserAvatar from '../../../shared/UserAvatar';
15
15
  import { PREFIX } from '../constants';
16
- import { default as EventItem } from '../../Event';
16
+ import LiveStream from '../../LiveStream';
17
17
  const classes = {
18
- root: `${PREFIX}-event-root`,
18
+ root: `${PREFIX}-live-root`,
19
19
  avatar: `${PREFIX}-avatar`,
20
20
  actions: `${PREFIX}-actions`,
21
21
  seeButton: `${PREFIX}see-button`,
@@ -25,10 +25,10 @@ const classes = {
25
25
  };
26
26
  const Root = styled(NotificationItem, {
27
27
  name: PREFIX,
28
- slot: 'EventRoot'
28
+ slot: 'LiveStreamRoot'
29
29
  })(() => ({}));
30
30
  /**
31
- * This component render the content of the notification of type event
31
+ * This component render the content of the notification of type live stream
32
32
  * @constructor
33
33
  * @param props
34
34
  */
@@ -42,28 +42,19 @@ export default function LiveStreamNotification(props) {
42
42
  // CONST
43
43
  const isSnippetTemplate = template === SCNotificationObjectTemplateType.SNIPPET;
44
44
  const isToastTemplate = template === SCNotificationObjectTemplateType.TOAST;
45
- const intl = useIntl();
46
45
  // RENDER
47
- if (isSnippetTemplate || isToastTemplate) {
46
+ if (isSnippetTemplate) {
48
47
  return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: _jsx(Link, Object.assign({}, (!notificationObject.user.deleted && {
49
48
  to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
50
49
  }), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !notificationObject.user.community_badge, smaller: true }, { children: _jsx(Avatar, { alt: notificationObject.user.username, variant: "circular", src: notificationObject.user.avatar, classes: { root: classes.avatar } }) })) })), primary: _jsxs(Box, { children: [_jsx(Link, Object.assign({}, (!notificationObject.user.deleted && {
51
50
  to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
52
- }), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.user.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.event.${notificationObject.type}`, defaultMessage: `ui.notification.event.${notificationObject.type}`, values: {
51
+ }), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.user.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.${notificationObject.type}.title`, defaultMessage: `ui.notification.${notificationObject.type}.title`, values: {
53
52
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
54
53
  // @ts-ignore
55
54
  icon: (...chunks) => _jsx(Icon, { children: chunks }),
56
- event: notificationObject.live_stream.title,
55
+ live: notificationObject.live_stream.title,
57
56
  link: (...chunks) => _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: chunks }))
58
- } })] }), secondary: _jsx(_Fragment, { children: _jsx(Typography, Object.assign({ component: "span" }, { children: _jsx(FormattedMessage, { id: "ui.notification.event.dateTime", defaultMessage: "ui.notification.event.dateTime", values: {
59
- date: intl.formatDate(notificationObject.live_stream.created_at, {
60
- weekday: 'long',
61
- day: 'numeric',
62
- year: 'numeric',
63
- month: 'long'
64
- }),
65
- hour: intl.formatDate(notificationObject.live_stream.created_at, { hour: 'numeric', minute: 'numeric' })
66
- } }) })) }), footer: isToastTemplate ? (_jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at }), _jsx(Typography, Object.assign({ color: "primary" }, { children: _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: _jsx(FormattedMessage, { id: "ui.notification.event.button.see", defaultMessage: "ui.notification.event.button.see" }) })) }))] }))) : (_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.snippetTime })) }, rest)));
57
+ } })] }), footer: isToastTemplate ? (_jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at }), _jsx(Typography, Object.assign({ color: "primary" }, { children: _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: _jsx(FormattedMessage, { id: "ui.notification.live_stream_started.join", defaultMessage: "ui.notification.live_stream_started.join" }) })) }))] }))) : (_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.snippetTime })) }, rest)));
67
58
  }
68
59
  return (_jsxs(_Fragment, { children: [_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: _jsx(Link, Object.assign({}, (!notificationObject.user.deleted && {
69
60
  to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.user)
@@ -72,8 +63,7 @@ export default function LiveStreamNotification(props) {
72
63
  }), { onClick: notificationObject.user.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.user.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.${notificationObject.type}`, defaultMessage: `ui.notification.${notificationObject.type}`, values: {
73
64
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
74
65
  // @ts-ignore
75
- icon: (...chunks) => _jsx(Icon, { children: chunks }),
76
- event: notificationObject.live_stream.title,
66
+ live: notificationObject.live_stream.title,
77
67
  link: (...chunks) => _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: chunks }))
78
- } }), _jsx(EventItem, { event: notificationObject.live_stream, actions: _jsx(_Fragment, {}), elevation: 0 })] }), actions: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt }), _jsx(LoadingButton, Object.assign({ color: 'primary', variant: "outlined", size: "small", classes: { root: classes.seeButton }, component: Link, to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: _jsx(FormattedMessage, { id: "ui.notification.event.button.see", defaultMessage: "ui.notification.event.button.see" }) }))] })) }, rest)), openAlert && _jsx(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
68
+ } }), _jsx(LiveStream, { liveStream: notificationObject.live_stream, actions: _jsx(_Fragment, {}), elevation: 0 })] }), actions: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt }), _jsx(LoadingButton, Object.assign({ color: 'primary', variant: "outlined", size: "small", classes: { root: classes.seeButton }, component: Link, disabled: Boolean(notificationObject.live_stream.closed_at_by_host), to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: _jsx(FormattedMessage, { id: "ui.notification.live_stream_started.join", defaultMessage: "ui.notification.live_stream_started.join" }) }))] })) }, rest)), openAlert && _jsx(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
79
69
  }