@selfcommunity/react-ui 0.7.50-events.44 → 0.7.50-events.47

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 (133) hide show
  1. package/lib/cjs/components/CreateEventButton/CreateEventButton.js +6 -4
  2. package/lib/cjs/components/CreateEventWidget/CreateEventWidget.d.ts +14 -0
  3. package/lib/cjs/components/CreateEventWidget/CreateEventWidget.js +63 -0
  4. package/lib/cjs/components/CreateEventWidget/Skeleton.d.ts +1 -0
  5. package/lib/cjs/components/CreateEventWidget/Skeleton.js +25 -0
  6. package/lib/cjs/components/CreateEventWidget/constants.d.ts +1 -0
  7. package/lib/cjs/components/CreateEventWidget/constants.js +4 -0
  8. package/lib/cjs/components/CreateEventWidget/index.d.ts +4 -0
  9. package/lib/cjs/components/CreateEventWidget/index.js +8 -0
  10. package/lib/cjs/components/Event/Event.d.ts +28 -0
  11. package/lib/cjs/components/Event/Event.js +64 -8
  12. package/lib/cjs/components/Event/Skeleton.d.ts +9 -3
  13. package/lib/cjs/components/Event/Skeleton.js +48 -6
  14. package/lib/cjs/components/EventHeader/EventHeader.js +10 -3
  15. package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +2 -1
  16. package/lib/cjs/components/EventInfoWidget/Skeleton.js +1 -1
  17. package/lib/cjs/components/EventLocationWidget/EventLocationWidget.js +8 -3
  18. package/lib/cjs/components/EventPartecipantsButton/EventPartecipantsButton.js +7 -8
  19. package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +3 -2
  20. package/lib/cjs/components/Events/Events.d.ts +6 -1
  21. package/lib/cjs/components/Events/Events.js +3 -3
  22. package/lib/cjs/components/FeedObjectMediaPreview/FeedObjectMediaPreview.d.ts +1 -1
  23. package/lib/cjs/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +1 -1
  24. package/lib/cjs/components/MyEventsWidget/MyEventsWidget.js +19 -10
  25. package/lib/cjs/components/MyEventsWidget/Skeleton.js +6 -26
  26. package/lib/cjs/components/Notification/Event/Event.d.ts +15 -0
  27. package/lib/cjs/components/Notification/Event/Event.js +71 -0
  28. package/lib/cjs/components/Notification/Event/index.d.ts +3 -0
  29. package/lib/cjs/components/Notification/Event/index.js +5 -0
  30. package/lib/cjs/components/Notification/Notification.js +26 -0
  31. package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +7 -0
  32. package/lib/cjs/components/SuggestedEventsWidget/Skeleton.d.ts +2 -0
  33. package/lib/cjs/components/SuggestedEventsWidget/Skeleton.js +28 -0
  34. package/lib/cjs/components/SuggestedEventsWidget/SuggestedEventsWidget.d.ts +14 -0
  35. package/lib/cjs/components/SuggestedEventsWidget/SuggestedEventsWidget.js +80 -0
  36. package/lib/cjs/components/SuggestedEventsWidget/constants.d.ts +1 -0
  37. package/lib/cjs/components/SuggestedEventsWidget/constants.js +4 -0
  38. package/lib/cjs/components/SuggestedEventsWidget/index.d.ts +4 -0
  39. package/lib/cjs/components/SuggestedEventsWidget/index.js +8 -0
  40. package/lib/cjs/components/ToastNotifications/ToastNotifications.js +7 -0
  41. package/lib/cjs/constants/EventActionsMenu.d.ts +6 -0
  42. package/lib/cjs/constants/EventActionsMenu.js +9 -0
  43. package/lib/cjs/constants/Media.d.ts +2 -0
  44. package/lib/cjs/constants/Media.js +3 -1
  45. package/lib/cjs/index.d.ts +4 -1
  46. package/lib/cjs/index.js +12 -4
  47. package/lib/cjs/shared/Calendar/index.js +1 -1
  48. package/lib/cjs/shared/EventActionsMenu/index.d.ts +49 -0
  49. package/lib/cjs/shared/EventActionsMenu/index.js +154 -0
  50. package/lib/cjs/shared/EventInfoDetails/index.d.ts +12 -0
  51. package/lib/cjs/shared/EventInfoDetails/index.js +3 -3
  52. package/lib/cjs/shared/Media/Event/DisplayComponent.d.ts +15 -0
  53. package/lib/cjs/shared/Media/Event/DisplayComponent.js +31 -0
  54. package/lib/cjs/shared/Media/Event/constants.d.ts +1 -0
  55. package/lib/cjs/shared/Media/Event/constants.js +4 -0
  56. package/lib/cjs/shared/Media/Event/filter.d.ts +3 -0
  57. package/lib/cjs/shared/Media/Event/filter.js +4 -0
  58. package/lib/cjs/shared/Media/Event/index.d.ts +3 -0
  59. package/lib/cjs/shared/Media/Event/index.js +14 -0
  60. package/lib/cjs/shared/Media/Link/PreviewComponent.js +1 -1
  61. package/lib/cjs/shared/Media/index.d.ts +2 -1
  62. package/lib/cjs/shared/Media/index.js +3 -1
  63. package/lib/cjs/types/event.d.ts +5 -0
  64. package/lib/cjs/types/event.js +9 -0
  65. package/lib/esm/components/CreateEventButton/CreateEventButton.js +6 -4
  66. package/lib/esm/components/CreateEventWidget/CreateEventWidget.d.ts +14 -0
  67. package/lib/esm/components/CreateEventWidget/CreateEventWidget.js +60 -0
  68. package/lib/esm/components/CreateEventWidget/Skeleton.d.ts +1 -0
  69. package/lib/esm/components/CreateEventWidget/Skeleton.js +21 -0
  70. package/lib/esm/components/CreateEventWidget/constants.d.ts +1 -0
  71. package/lib/esm/components/CreateEventWidget/constants.js +1 -0
  72. package/lib/esm/components/CreateEventWidget/index.d.ts +4 -0
  73. package/lib/esm/components/CreateEventWidget/index.js +4 -0
  74. package/lib/esm/components/Event/Event.d.ts +28 -0
  75. package/lib/esm/components/Event/Event.js +66 -10
  76. package/lib/esm/components/Event/Skeleton.d.ts +9 -3
  77. package/lib/esm/components/Event/Skeleton.js +50 -7
  78. package/lib/esm/components/EventHeader/EventHeader.js +11 -4
  79. package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +2 -1
  80. package/lib/esm/components/EventInfoWidget/Skeleton.js +1 -1
  81. package/lib/esm/components/EventLocationWidget/EventLocationWidget.js +8 -3
  82. package/lib/esm/components/EventPartecipantsButton/EventPartecipantsButton.js +8 -9
  83. package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +3 -2
  84. package/lib/esm/components/Events/Events.d.ts +6 -1
  85. package/lib/esm/components/Events/Events.js +3 -3
  86. package/lib/esm/components/FeedObjectMediaPreview/FeedObjectMediaPreview.d.ts +1 -1
  87. package/lib/esm/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +2 -2
  88. package/lib/esm/components/MyEventsWidget/MyEventsWidget.js +23 -14
  89. package/lib/esm/components/MyEventsWidget/Skeleton.js +7 -27
  90. package/lib/esm/components/Notification/Event/Event.d.ts +15 -0
  91. package/lib/esm/components/Notification/Event/Event.js +68 -0
  92. package/lib/esm/components/Notification/Event/index.d.ts +3 -0
  93. package/lib/esm/components/Notification/Event/index.js +2 -0
  94. package/lib/esm/components/Notification/Notification.js +26 -0
  95. package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +7 -0
  96. package/lib/esm/components/SuggestedEventsWidget/Skeleton.d.ts +2 -0
  97. package/lib/esm/components/SuggestedEventsWidget/Skeleton.js +24 -0
  98. package/lib/esm/components/SuggestedEventsWidget/SuggestedEventsWidget.d.ts +14 -0
  99. package/lib/esm/components/SuggestedEventsWidget/SuggestedEventsWidget.js +77 -0
  100. package/lib/esm/components/SuggestedEventsWidget/constants.d.ts +1 -0
  101. package/lib/esm/components/SuggestedEventsWidget/constants.js +1 -0
  102. package/lib/esm/components/SuggestedEventsWidget/index.d.ts +4 -0
  103. package/lib/esm/components/SuggestedEventsWidget/index.js +4 -0
  104. package/lib/esm/components/ToastNotifications/ToastNotifications.js +7 -0
  105. package/lib/esm/constants/EventActionsMenu.d.ts +6 -0
  106. package/lib/esm/constants/EventActionsMenu.js +6 -0
  107. package/lib/esm/constants/Media.d.ts +2 -0
  108. package/lib/esm/constants/Media.js +2 -0
  109. package/lib/esm/index.d.ts +4 -1
  110. package/lib/esm/index.js +6 -3
  111. package/lib/esm/shared/Calendar/index.js +1 -1
  112. package/lib/esm/shared/EventActionsMenu/index.d.ts +49 -0
  113. package/lib/esm/shared/EventActionsMenu/index.js +151 -0
  114. package/lib/esm/shared/EventInfoDetails/index.d.ts +12 -0
  115. package/lib/esm/shared/EventInfoDetails/index.js +3 -3
  116. package/lib/esm/shared/Media/Event/DisplayComponent.d.ts +15 -0
  117. package/lib/esm/shared/Media/Event/DisplayComponent.js +29 -0
  118. package/lib/esm/shared/Media/Event/constants.d.ts +1 -0
  119. package/lib/esm/shared/Media/Event/constants.js +1 -0
  120. package/lib/esm/shared/Media/Event/filter.d.ts +3 -0
  121. package/lib/esm/shared/Media/Event/filter.js +2 -0
  122. package/lib/esm/shared/Media/Event/index.d.ts +3 -0
  123. package/lib/esm/shared/Media/Event/index.js +11 -0
  124. package/lib/esm/shared/Media/Link/PreviewComponent.js +1 -1
  125. package/lib/esm/shared/Media/index.d.ts +2 -1
  126. package/lib/esm/shared/Media/index.js +2 -1
  127. package/lib/esm/types/event.d.ts +5 -0
  128. package/lib/esm/types/event.js +6 -0
  129. package/lib/umd/224.js +2 -0
  130. package/lib/umd/react-ui.js +1 -1
  131. package/package.json +7 -7
  132. package/lib/umd/84.js +0 -2
  133. /package/lib/umd/{84.js.LICENSE.txt → 224.js.LICENSE.txt} +0 -0
@@ -10,6 +10,7 @@ const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
10
  const react_1 = tslib_1.__importStar(require("react"));
11
11
  const react_intl_1 = require("react-intl");
12
12
  const EventForm_1 = tslib_1.__importDefault(require("../EventForm"));
13
+ const types_1 = require("@selfcommunity/types");
13
14
  const PREFIX = 'SCCreateEventButton';
14
15
  const classes = {
15
16
  root: `${PREFIX}-root`
@@ -52,11 +53,12 @@ function CreateEventButton(inProps) {
52
53
  const [open, setOpen] = react_1.default.useState(false);
53
54
  // CONST
54
55
  const authUserId = scUserContext.user ? scUserContext.user.id : null;
55
- const preferences = (0, react_core_1.useSCPreferences)();
56
- const onlyStaffEnabled = (0, react_1.useMemo)(() => preferences.preferences[react_core_1.SCPreferences.CONFIGURATIONS_GROUPS_ONLY_STAFF_ENABLED].value, [preferences.preferences]);
56
+ const { preferences, features } = (0, react_core_1.useSCPreferences)();
57
+ const eventsEnabled = (0, react_1.useMemo)(() => features && features.includes(types_1.SCFeatureName.EVENT) && features.includes(types_1.SCFeatureName.TAGGING), [features]);
58
+ const onlyStaffEnabled = (0, react_1.useMemo)(() => preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED].value, [preferences]);
57
59
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
58
60
  // @ts-ignore
59
- const canCreateEvent = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_group; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
61
+ const canCreateEvent = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_event; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
60
62
  /**
61
63
  * Handle click on button
62
64
  */
@@ -66,7 +68,7 @@ function CreateEventButton(inProps) {
66
68
  /**
67
69
  * If there's no authUserId, component is hidden.
68
70
  */
69
- if ((!canCreateEvent && onlyStaffEnabled) || !authUserId) {
71
+ if (!eventsEnabled || (!canCreateEvent && onlyStaffEnabled) || !authUserId) {
70
72
  return null;
71
73
  }
72
74
  /**
@@ -0,0 +1,14 @@
1
+ import { CreateEventButtonProps } from '../CreateEventButton';
2
+ import { WidgetProps } from '../Widget';
3
+ export interface CreateEventWidgetProps extends WidgetProps {
4
+ /**
5
+ * Props to spread to CreateEventButton component
6
+ * @default {}
7
+ */
8
+ CreateEventButtonComponentProps?: CreateEventButtonProps;
9
+ /**
10
+ * Other props
11
+ */
12
+ [p: string]: any;
13
+ }
14
+ export default function CreateEventWidget(inProps: CreateEventWidgetProps): JSX.Element;
@@ -0,0 +1,63 @@
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 react_core_1 = require("@selfcommunity/react-core");
7
+ const react_1 = require("react");
8
+ const react_intl_1 = require("react-intl");
9
+ const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
10
+ const CreateEventButton_1 = tslib_1.__importDefault(require("../CreateEventButton"));
11
+ const Widget_1 = tslib_1.__importDefault(require("../Widget"));
12
+ const constants_1 = require("./constants");
13
+ const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
14
+ const types_1 = require("@selfcommunity/types");
15
+ const classes = {
16
+ root: `${constants_1.PREFIX}-root`,
17
+ image: `${constants_1.PREFIX}-image`,
18
+ calendar: `${constants_1.PREFIX}-calendar`,
19
+ content: `${constants_1.PREFIX}-content`,
20
+ title: `${constants_1.PREFIX}-title`,
21
+ spaging: `${constants_1.PREFIX}-spacing`,
22
+ actions: `${constants_1.PREFIX}-actions`
23
+ };
24
+ const Root = (0, material_1.styled)(Widget_1.default, {
25
+ name: constants_1.PREFIX,
26
+ slot: 'Root',
27
+ overridesResolver: (_props, styles) => styles.root
28
+ })(() => ({}));
29
+ function CreateEventWidget(inProps) {
30
+ var _a;
31
+ // PROPS
32
+ const props = (0, material_1.useThemeProps)({
33
+ props: inProps,
34
+ name: constants_1.PREFIX
35
+ });
36
+ const { CreateEventButtonComponentProps = {} } = props, rest = tslib_1.__rest(props, ["CreateEventButtonComponentProps"]);
37
+ // STATE
38
+ const [loading, setLoading] = (0, react_1.useState)(true);
39
+ // CONTEXT
40
+ const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
41
+ // HOOK
42
+ const { preferences, features } = (0, react_core_1.useSCPreferences)();
43
+ const eventsEnabled = (0, react_1.useMemo)(() => features && features.includes(types_1.SCFeatureName.EVENT) && features.includes(types_1.SCFeatureName.TAGGING), [features]);
44
+ const authUserId = scUserContext.user ? scUserContext.user.id : null;
45
+ const onlyStaffEnabled = (0, react_1.useMemo)(() => preferences[react_core_1.SCPreferences.CONFIGURATIONS_GROUPS_ONLY_STAFF_ENABLED].value, [preferences]);
46
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
47
+ // @ts-ignore
48
+ const canCreateEvent = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_group; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
49
+ (0, react_1.useEffect)(() => {
50
+ setLoading(false);
51
+ }, []);
52
+ if (loading) {
53
+ return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
54
+ }
55
+ /**
56
+ * If there's no authUserId, component is hidden.
57
+ */
58
+ if (!eventsEnabled || (!canCreateEvent && onlyStaffEnabled) || !authUserId) {
59
+ return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
60
+ }
61
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative" }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: `${preferences[react_core_1.SCPreferences.IMAGES_USER_DEFAULT_COVER].value}`, alt: "placeholder image", className: classes.image }), (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.calendar, fontSize: "large" }, { children: "CalendarIcon" }))] })), (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: "h5", className: classes.title }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createEvent.title", defaultMessage: "ui.createEvent.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.spaging }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createEvent.description", defaultMessage: "ui.createEvent.description" }) })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.spaging })] })), (0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(CreateEventButton_1.default, Object.assign({}, CreateEventButtonComponentProps)) }))] })));
62
+ }
63
+ exports.default = CreateEventWidget;
@@ -0,0 +1 @@
1
+ export default function CreateEventWidgetSkeleton(): JSX.Element;
@@ -0,0 +1,25 @@
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 Skeleton_1 = tslib_1.__importDefault(require("@mui/material/Skeleton"));
7
+ const styles_1 = require("@mui/material/styles");
8
+ const Widget_1 = tslib_1.__importDefault(require("../Widget"));
9
+ const constants_1 = require("./constants");
10
+ const classes = {
11
+ root: `${constants_1.PREFIX}-skeleton-root`,
12
+ calendar: `${constants_1.PREFIX}-calendar`,
13
+ content: `${constants_1.PREFIX}-content`,
14
+ title: `${constants_1.PREFIX}-title`,
15
+ spacing: `${constants_1.PREFIX}-spacing`,
16
+ actions: `${constants_1.PREFIX}-actions`
17
+ };
18
+ const Root = (0, styles_1.styled)(Widget_1.default, {
19
+ name: constants_1.PREFIX,
20
+ slot: 'SkeletonRoot'
21
+ })(() => ({}));
22
+ function CreateEventWidgetSkeleton() {
23
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { variant: "rectangular", animation: "wave", width: "100%", height: "110px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { className: classes.calendar, variant: "rounded", animation: "wave", width: "50px", height: "50px" })] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { className: classes.title, animation: "wave", width: "26%", height: "30px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { className: classes.spacing, animation: "wave", width: "100%", height: "20px" }), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.spacing })] })), (0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rounded", width: "138px", height: "36px" }) }))] })));
24
+ }
25
+ exports.default = CreateEventWidgetSkeleton;
@@ -0,0 +1 @@
1
+ export declare const PREFIX = "SCCreateEventWidget";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PREFIX = void 0;
4
+ exports.PREFIX = 'SCCreateEventWidget';
@@ -0,0 +1,4 @@
1
+ import CreateEventWidget, { CreateEventWidgetProps } from './CreateEventWidget';
2
+ import CreateEventWidgetSkeleton from './Skeleton';
3
+ export default CreateEventWidget;
4
+ export { CreateEventWidgetSkeleton, CreateEventWidgetProps, type CreateEventWidget };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateEventWidgetSkeleton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const CreateEventWidget_1 = tslib_1.__importDefault(require("./CreateEventWidget"));
6
+ const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
7
+ exports.CreateEventWidgetSkeleton = Skeleton_1.default;
8
+ exports.default = CreateEventWidget_1.default;
@@ -1,5 +1,8 @@
1
+ import React from 'react';
1
2
  import { SCEventType } from '@selfcommunity/types';
2
3
  import { WidgetProps } from '../Widget';
4
+ import { EventSkeletonProps } from './Skeleton';
5
+ import { SCEventTemplateType } from '../../types/event';
3
6
  export interface EventProps extends WidgetProps {
4
7
  /**
5
8
  * Event Object
@@ -11,6 +14,31 @@ export interface EventProps extends WidgetProps {
11
14
  * @default null
12
15
  */
13
16
  eventId?: number;
17
+ /**
18
+ * Event template type
19
+ * @default 'preview'
20
+ */
21
+ template?: SCEventTemplateType;
22
+ /**
23
+ * Actions
24
+ * @default null
25
+ */
26
+ actions?: React.ReactNode;
27
+ /**
28
+ * Hide participants
29
+ * @default false
30
+ */
31
+ hideEventParticipants?: boolean;
32
+ /**
33
+ * Hide event planner
34
+ * @default false
35
+ */
36
+ hideEventPlanner?: boolean;
37
+ /**
38
+ * Props to spread to EventSkeleton component
39
+ * @default {}
40
+ */
41
+ EventSkeletonComponentProps?: EventSkeletonProps;
14
42
  /**
15
43
  * Any other properties
16
44
  */
@@ -10,20 +10,59 @@ const react_intl_1 = require("react-intl");
10
10
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
11
11
  const system_1 = require("@mui/system");
12
12
  const BaseItem_1 = tslib_1.__importDefault(require("../../shared/BaseItem"));
13
+ const Widget_1 = tslib_1.__importDefault(require("../Widget"));
13
14
  const constants_1 = require("./constants");
14
15
  const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
16
+ const Calendar_1 = tslib_1.__importDefault(require("../../shared/Calendar"));
17
+ const EventInfoDetails_1 = tslib_1.__importDefault(require("../../shared/EventInfoDetails"));
18
+ const User_1 = tslib_1.__importDefault(require("../User"));
19
+ const EventPartecipantsButton_1 = tslib_1.__importDefault(require("../EventPartecipantsButton"));
20
+ const event_1 = require("../../types/event");
15
21
  const classes = {
16
22
  root: `${constants_1.PREFIX}-root`,
17
- avatar: `${constants_1.PREFIX}-avatar`,
18
- primary: `${constants_1.PREFIX}-primary`,
19
- secondary: `${constants_1.PREFIX}-secondary`,
20
- actions: `${constants_1.PREFIX}-actions`
23
+ detailRoot: `${constants_1.PREFIX}-detail-root`,
24
+ previewRoot: `${constants_1.PREFIX}-preview-root`,
25
+ snippetRoot: `${constants_1.PREFIX}-snippet-root`,
26
+ detailImageWrapper: `${constants_1.PREFIX}-detail-image-wrapper`,
27
+ detailImage: `${constants_1.PREFIX}-detail-image`,
28
+ detailNameWrapper: `${constants_1.PREFIX}-detail-name-wrapper`,
29
+ detailName: `${constants_1.PREFIX}-detail-name`,
30
+ detailContent: `${constants_1.PREFIX}-detail-content`,
31
+ detailUser: `${constants_1.PREFIX}-detail-user`,
32
+ detailFirstDivider: `${constants_1.PREFIX}-detail-first-divider`,
33
+ detailSecondDivider: `${constants_1.PREFIX}-detail-second-divider`,
34
+ detailActions: `${constants_1.PREFIX}-detail-actions`,
35
+ previewImageWrapper: `${constants_1.PREFIX}-preview-image-wrapper`,
36
+ previewImage: `${constants_1.PREFIX}-preview-image`,
37
+ previewNameWrapper: `${constants_1.PREFIX}-preview-name-wrapper`,
38
+ previewName: `${constants_1.PREFIX}-preview-name`,
39
+ previewContent: `${constants_1.PREFIX}-preview-content`,
40
+ previewActions: `${constants_1.PREFIX}-preview-actions`,
41
+ snippetAvatar: `${constants_1.PREFIX}-snippet-avatar`,
42
+ snippetPrimary: `${constants_1.PREFIX}-snippet-primary`,
43
+ snippetSecondary: `${constants_1.PREFIX}-snippet-secondary`,
44
+ snippetActions: `${constants_1.PREFIX}-snippet-actions`
21
45
  };
22
- const Root = (0, styles_1.styled)(BaseItem_1.default, {
46
+ const Root = (0, styles_1.styled)(Widget_1.default, {
23
47
  name: constants_1.PREFIX,
24
48
  slot: 'Root',
25
49
  overridesResolver: (props, styles) => styles.root
26
50
  })(() => ({}));
51
+ const DetailRoot = (0, styles_1.styled)(material_1.Box, {
52
+ name: constants_1.PREFIX,
53
+ slot: 'DetailRoot',
54
+ overridesResolver: (props, styles) => styles.detailRoot
55
+ })(() => ({}));
56
+ const PreviewRoot = (0, styles_1.styled)(material_1.Box, {
57
+ name: constants_1.PREFIX,
58
+ slot: 'PreviewRoot',
59
+ overridesResolver: (props, styles) => styles.previewRoot
60
+ })(() => ({}));
61
+ const SnippetRoot = (0, styles_1.styled)(BaseItem_1.default, {
62
+ name: constants_1.PREFIX,
63
+ slot: 'SnippetRoot',
64
+ overridesResolver: (props, styles) => styles.snippetRoot
65
+ })(() => ({}));
27
66
  /**
28
67
  * > API documentation for the Community-JS Event component. Learn about the available props and the CSS API.
29
68
  *
@@ -62,7 +101,7 @@ function Event(inProps) {
62
101
  props: inProps,
63
102
  name: constants_1.PREFIX
64
103
  });
65
- const { eventId = null, event = null, className = null, elevation = 0 } = props, rest = tslib_1.__rest(props, ["eventId", "event", "className", "elevation"]);
104
+ const { id = `event_object_${props.eventId ? props.eventId : props.event ? props.event.id : ''}`, eventId = null, event = null, className = null, template = event_1.SCEventTemplateType.SNIPPET, hideEventParticipants = false, hideEventPlanner = false, actions, EventSkeletonComponentProps = {} } = props, rest = tslib_1.__rest(props, ["id", "eventId", "event", "className", "template", "hideEventParticipants", "hideEventPlanner", "actions", "EventSkeletonComponentProps"]);
66
105
  // STATE
67
106
  const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
68
107
  // CONTEXT
@@ -73,11 +112,28 @@ function Event(inProps) {
73
112
  * Renders event object
74
113
  */
75
114
  if (!scEvent) {
76
- return (0, jsx_runtime_1.jsx)(Skeleton_1.default, { elevation: elevation });
115
+ return (0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({ template: template }, EventSkeletonComponentProps, rest, { actions: actions }));
116
+ }
117
+ /**
118
+ * Renders event object
119
+ */
120
+ let contentObj;
121
+ if (template === event_1.SCEventTemplateType.DETAIL) {
122
+ contentObj = ((0, jsx_runtime_1.jsxs)(DetailRoot, Object.assign({ className: classes.detailRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.detailImageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: scEvent.image_medium, alt: scEvent.name, className: classes.detailImage }), (0, jsx_runtime_1.jsx)(Calendar_1.default, { day: new Date(scEvent.start_date).getDate() })] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.detailContent }, { children: [(0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.detailNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3", className: classes.detailName }, { children: scEvent.name })) })), (0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent }), !hideEventPlanner && ((0, jsx_runtime_1.jsx)(User_1.default, { user: scEvent.managed_by, elevation: 0, secondary: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.myEventsWidget.planner", defaultMessage: "ui.myEventsWidget.planner" }) })), actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), className: classes.detailUser })), !hideEventParticipants && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.detailFirstDivider }), (0, jsx_runtime_1.jsx)(EventPartecipantsButton_1.default, { event: scEvent, eventId: scEvent.id })] })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.detailSecondDivider })] })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.detailActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
123
+ }
124
+ else if (template === event_1.SCEventTemplateType.PREVIEW) {
125
+ contentObj = ((0, jsx_runtime_1.jsxs)(PreviewRoot, Object.assign({ className: classes.previewRoot }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ position: "relative", className: classes.previewImageWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", height: "100px", image: scEvent.image_medium, alt: scEvent.name, className: classes.previewImage }) })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.previewContent }, { children: [(0, jsx_runtime_1.jsx)(EventInfoDetails_1.default, { event: scEvent, hidePrivacyIcon: true, hasLocationInfo: false, beforePrivacyInfo: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: scEvent.name })) }), !hideEventParticipants && (0, jsx_runtime_1.jsx)(EventPartecipantsButton_1.default, { event: scEvent })] })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.previewActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })))] })));
126
+ }
127
+ else {
128
+ contentObj = ((0, jsx_runtime_1.jsx)(SnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.snippetRoot, image: (0, jsx_runtime_1.jsx)(material_1.Avatar, { variant: "square", alt: scEvent.name, src: scEvent.image_medium, className: classes.snippetAvatar }), primary: (0, jsx_runtime_1.jsxs)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent), className: classes.snippetPrimary }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span" }, { children: `${intl.formatDate(scEvent.start_date, {
129
+ weekday: 'long',
130
+ month: 'long',
131
+ day: 'numeric'
132
+ })}` })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: scEvent.name }))] })), secondary: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ component: "p", variant: "body2", className: classes.snippetSecondary }, { children: [(0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.privacy.${scEvent.privacy}`, defaultMessage: `ui.eventForm.privacy.${scEvent.privacy}` }), " -", ' ', (scEvent === null || scEvent === void 0 ? void 0 : scEvent.location) === types_1.SCEventLocationType.PERSON ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.address.live.label`, defaultMessage: `ui.eventForm.address.live.label` })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.address.online.label`, defaultMessage: `ui.eventForm.address.online.label` }))] })), actions: actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.snippetActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) }))) }));
77
133
  }
78
134
  /**
79
135
  * Renders root object
80
136
  */
81
- return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ elevation: elevation, disableTypography: true }, rest, { className: (0, classnames_1.default)(classes.root, className), image: (0, jsx_runtime_1.jsx)(material_1.Avatar, { variant: "square", alt: scEvent.name, src: scEvent.image_medium, className: classes.avatar }), primary: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ component: "div", className: classes.primary }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span" }, { children: `${intl.formatDate(scEvent.start_date, { weekday: 'long', month: 'long', day: 'numeric' })}` })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: scEvent.name }))] })), secondary: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ component: "p", variant: "body2", className: classes.secondary }, { children: [(0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.privacy.${scEvent.privacy}`, defaultMessage: `ui.eventForm.privacy.${scEvent.privacy}` }), " -", ' ', (scEvent === null || scEvent === void 0 ? void 0 : scEvent.location) === types_1.SCEventLocationType.PERSON ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.address.live.label`, defaultMessage: `ui.eventForm.address.live.label` })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.address.online.label`, defaultMessage: `ui.eventForm.address.online.label` }))] })), actions: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.EVENT_ROUTE_NAME, scEvent) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.event.see", id: "ui.event.see" }) })) })));
137
+ return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className, `${constants_1.PREFIX}-${template}`) }, rest, { children: contentObj })));
82
138
  }
83
139
  exports.default = Event;
@@ -1,15 +1,21 @@
1
1
  import React from 'react';
2
- import { BaseItemProps } from '../../shared/BaseItem';
3
- export interface EventSkeletonProps extends BaseItemProps {
2
+ import { SCEventTemplateType } from '../../types/event';
3
+ import { WidgetProps } from '../Widget';
4
+ export interface EventSkeletonProps extends WidgetProps {
4
5
  /**
5
6
  * Overrides or extends the styles applied to the component.
6
7
  * @default null
7
8
  */
8
9
  className?: string;
10
+ /**
11
+ * Event template type
12
+ * @default 'preview'
13
+ */
14
+ template?: SCEventTemplateType;
9
15
  /**
10
16
  * Prop to pass an action to be rendered next to the skeleton
11
17
  */
12
- action?: React.ReactNode;
18
+ actions?: React.ReactNode;
13
19
  }
14
20
  /**
15
21
  * > API documentation for the Community-JS Event Skeleton component. Learn about the available props and the CSS API.
@@ -6,17 +6,41 @@ const material_1 = require("@mui/material");
6
6
  const styles_1 = require("@mui/material/styles");
7
7
  const Skeleton_1 = tslib_1.__importDefault(require("@mui/material/Skeleton"));
8
8
  const constants_1 = require("./constants");
9
- const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
9
  const BaseItem_1 = tslib_1.__importDefault(require("../../shared/BaseItem"));
10
+ const event_1 = require("../../types/event");
11
+ const Widget_1 = tslib_1.__importDefault(require("../Widget"));
12
+ const system_1 = require("@mui/system");
13
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
11
14
  const classes = {
12
15
  root: `${constants_1.PREFIX}-skeleton-root`,
13
- image: `${constants_1.PREFIX}-skeleton-image`,
14
- action: `${constants_1.PREFIX}-skeleton-action`
16
+ skeletonDetailRoot: `${constants_1.PREFIX}-skeleton-detail-root`,
17
+ skeletonPreviewRoot: `${constants_1.PREFIX}-skeleton-preview-root`,
18
+ skeletonSnippetRoot: `${constants_1.PREFIX}-skeleton-snippet-root`,
19
+ skeletonDetailCalendar: `${constants_1.PREFIX}-skeleton-detail-calendar`,
20
+ skeletonDetailContent: `${constants_1.PREFIX}-skeleton-detail-content`,
21
+ skeletonDetailUser: `${constants_1.PREFIX}-skeleton-detail-user`,
22
+ skeletonDetailFirstDivider: `${constants_1.PREFIX}-skeleton-detail-first-divider`,
23
+ skeletonDetailSecondDivider: `${constants_1.PREFIX}-skeleton-detail-second-divider`,
24
+ skeletonPreviewContent: `${constants_1.PREFIX}-skeleton-preview-content`,
25
+ skeletonSnippetImage: `${constants_1.PREFIX}-skeleton-snippet-image`,
26
+ skeletonSnippetAction: `${constants_1.PREFIX}-skeleton-snippet-action`
15
27
  };
16
- const Root = (0, styles_1.styled)(BaseItem_1.default, {
28
+ const Root = (0, styles_1.styled)(Widget_1.default, {
17
29
  name: constants_1.PREFIX,
18
30
  slot: 'SkeletonRoot'
19
31
  })(() => ({}));
32
+ const SkeletonDetailRoot = (0, styles_1.styled)(material_1.Box, {
33
+ name: constants_1.PREFIX,
34
+ slot: 'SkeletonDetailRoot'
35
+ })(() => ({}));
36
+ const SkeletonPreviewRoot = (0, styles_1.styled)(material_1.Box, {
37
+ name: constants_1.PREFIX,
38
+ slot: 'SkeletonPreviewRoot'
39
+ })(() => ({}));
40
+ const SkeletonSnippetRoot = (0, styles_1.styled)(BaseItem_1.default, {
41
+ name: constants_1.PREFIX,
42
+ slot: 'SkeletonSnippetRoot'
43
+ })(() => ({}));
20
44
  /**
21
45
  * > API documentation for the Community-JS Event Skeleton component. Learn about the available props and the CSS API.
22
46
 
@@ -40,7 +64,25 @@ const Root = (0, styles_1.styled)(BaseItem_1.default, {
40
64
  *
41
65
  */
42
66
  function EventSkeleton(inProps) {
43
- const { className, action } = inProps;
44
- return ((0, jsx_runtime_1.jsx)(Root, { elevation: 0, className: (0, classnames_1.default)(classes.root, className), image: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.image }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", width: 100, height: 60 }), " ", (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "large" }, { children: "CalendarIcon" }))] })), primary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", height: 10, width: 100, style: { marginBottom: 12 } }), secondary: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", height: 10, width: 160, style: { marginBottom: 10 } }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", height: 10, width: 90 })] }), actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: action !== null && action !== void 0 ? action : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", disabled: true }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 30, style: { marginTop: 5, marginBottom: 5 } }) }))) }) }));
67
+ // PROPS
68
+ const props = (0, system_1.useThemeProps)({
69
+ props: inProps,
70
+ name: constants_1.PREFIX
71
+ });
72
+ const { className, template = event_1.SCEventTemplateType.SNIPPET, actions } = props, rest = tslib_1.__rest(props, ["className", "template", "actions"]);
73
+ /**
74
+ * Renders event object
75
+ */
76
+ let contentObj;
77
+ if (template === event_1.SCEventTemplateType.DETAIL) {
78
+ contentObj = ((0, jsx_runtime_1.jsxs)(SkeletonDetailRoot, Object.assign({ className: classes.skeletonDetailRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { variant: "rectangular", animation: "wave", width: "100%", height: "170px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { className: classes.skeletonDetailCalendar, variant: "rounded", animation: "wave", width: "60px", height: "60px" })] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.skeletonDetailContent }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "36%", height: "40px" }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px", marginBottom: "9px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "50%", height: "20px" })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px", marginBottom: "9px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "35%", height: "20px" })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px", marginBottom: "14px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "27%", height: "20px" })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", gap: "8px", className: classes.skeletonDetailUser }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "36px", height: "36px" }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ gap: "1px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "75px", height: "15px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "86px", height: "16px" })] }))] })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.skeletonDetailFirstDivider }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", gap: "8px", alignItems: "center", height: "28px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "68px", height: "20px" }), (0, jsx_runtime_1.jsxs)(material_1.AvatarGroup, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" })] })] })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.skeletonDetailSecondDivider })] }))] })));
79
+ }
80
+ else if (template === event_1.SCEventTemplateType.PREVIEW) {
81
+ contentObj = ((0, jsx_runtime_1.jsxs)(SkeletonPreviewRoot, Object.assign({ className: classes.skeletonPreviewRoot }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ position: "relative" }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { variant: "rectangular", animation: "wave", width: "100%", height: "80px" }) })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.skeletonPreviewContent }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "30%", height: "16px" })] })), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "46%", height: "20px" }), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px", marginBottom: "14px" }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "27%", height: "16px" }) })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", gap: "8px", alignItems: "center", height: "28px" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.AvatarGroup, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: "21px", height: "21px" })] }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "10%", height: "20px" })] }))] }))] })));
82
+ }
83
+ else {
84
+ contentObj = ((0, jsx_runtime_1.jsx)(SkeletonSnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.skeletonSnippetRoot, image: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.skeletonSnippetImage }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", width: 100, height: 60 }), " ", (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "large" }, { children: "CalendarIcon" }))] })), primary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", height: 10, width: "40%", style: { marginBottom: 12 } }), secondary: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", height: 10, width: "60%", style: { marginBottom: 10, marginRight: 5 } }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", height: 10, width: "35%" })] }), actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", disabled: true }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 30, style: { marginTop: 5, marginBottom: 5 } }) }))) }) }));
85
+ }
86
+ return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className, `${constants_1.PREFIX}-skeleton-${template}`) }, rest, { children: contentObj })));
45
87
  }
46
88
  exports.default = EventSkeleton;
@@ -20,6 +20,7 @@ const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
20
20
  const EditEventButton_1 = tslib_1.__importDefault(require("../EditEventButton"));
21
21
  const User_1 = tslib_1.__importDefault(require("../User"));
22
22
  const Calendar_1 = tslib_1.__importDefault(require("../../shared/Calendar"));
23
+ const EventActionsMenu_1 = tslib_1.__importDefault(require("../../shared/EventActionsMenu"));
23
24
  const classes = {
24
25
  root: `${constants_1.PREFIX}-root`,
25
26
  cover: `${constants_1.PREFIX}-cover`,
@@ -33,7 +34,8 @@ const classes = {
33
34
  };
34
35
  const Root = (0, styles_1.styled)(material_1.Box, {
35
36
  name: constants_1.PREFIX,
36
- slot: 'Root'
37
+ slot: 'Root',
38
+ shouldForwardProp: (prop) => prop !== 'isEventAdmin'
37
39
  })(() => ({}));
38
40
  /**
39
41
  * > API documentation for the Community-JS Event Header component. Learn about the available props and the CSS API.
@@ -88,6 +90,8 @@ function EventHeader(inProps) {
88
90
  const updatesSubscription = (0, react_1.useRef)(null);
89
91
  // CONST
90
92
  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]);
93
+ const theme = (0, material_1.useTheme)();
94
+ const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
91
95
  /**
92
96
  * Subscriber for pubsub callback
93
97
  */
@@ -122,7 +126,10 @@ function EventHeader(inProps) {
122
126
  const _backgroundCover = Object.assign({}, (scEvent.image_bigger
123
127
  ? { background: `url('${scEvent.image_bigger}') center / cover` }
124
128
  : { background: `url('${scPreferences.preferences[react_core_1.SCPreferences.IMAGES_USER_DEFAULT_COVER].value}') center / cover` }));
125
- return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, 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: {
129
+ return (
130
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
131
+ // @ts-ignore
132
+ (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: {
126
133
  startDate: intl.formatDate(scEvent.start_date, {
127
134
  weekday: 'long',
128
135
  day: 'numeric',
@@ -154,6 +161,6 @@ function EventHeader(inProps) {
154
161
  month: 'long'
155
162
  }),
156
163
  hour: intl.formatDate(scEvent.start_date, { hour: 'numeric', minute: 'numeric' })
157
- } })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.name }, { children: scEvent.name })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.visibility }, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: scEvent.privacy === types_1.SCEventPrivacyType.PUBLIC ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "public" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.visibility.public", defaultMessage: "ui.eventHeader.visibility.public" })] }))) : ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "private" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.visibility.private", defaultMessage: "ui.eventHeader.visibility.private" })] }))) }), (0, jsx_runtime_1.jsx)(Bullet_1.default, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: scEvent.location === types_1.SCEventLocationType.PERSON ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.location.live", defaultMessage: "ui.eventHeader.location.live" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.location.live", defaultMessage: "ui.eventHeader.location.online" })) }))] })), (0, jsx_runtime_1.jsx)(User_1.default, { userId: (_b = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _b === void 0 ? void 0 : _b.id, elevation: 0, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isEventAdmin ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.multiActions }, { children: [(0, jsx_runtime_1.jsx)(EventInviteButton_1.default, { size: "small", event: scEvent, eventId: scEvent.id }), (0, jsx_runtime_1.jsx)(EditEventButton_1.default, { size: "small", event: scEvent, eventId: scEvent.id, onEditSuccess: (data) => setSCEvent(data) })] }))) : ((0, jsx_runtime_1.jsx)(EventSubscribeButton_1.default, Object.assign({ event: scEvent }, EventSubscribeButtonProps))) }) })] }))] })));
164
+ } })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.name }, { children: scEvent.name })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.visibility }, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: scEvent.privacy === types_1.SCEventPrivacyType.PUBLIC ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "public" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.visibility.public", defaultMessage: "ui.eventHeader.visibility.public" })] }))) : ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "private" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.visibility.private", defaultMessage: "ui.eventHeader.visibility.private" })] }))) }), (0, jsx_runtime_1.jsx)(Bullet_1.default, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: scEvent.location === types_1.SCEventLocationType.PERSON ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.location.live", defaultMessage: "ui.eventHeader.location.live" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.location.live", defaultMessage: "ui.eventHeader.location.online" })) }))] })), (0, jsx_runtime_1.jsx)(User_1.default, { userId: (_b = scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by) === null || _b === void 0 ? void 0 : _b.id, secondary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.user.manager", defaultMessage: "ui.eventHeader.user.manager" }), elevation: 0, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isEventAdmin ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.multiActions }, { children: [(0, jsx_runtime_1.jsx)(EventInviteButton_1.default, { size: isMobile ? 'small' : 'medium', event: scEvent, eventId: scEvent.id }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(EditEventButton_1.default, { size: isMobile ? 'small' : 'medium', event: scEvent, eventId: scEvent.id, onEditSuccess: (data) => setSCEvent(data) }), (0, jsx_runtime_1.jsx)(EventActionsMenu_1.default, { eventId: scEvent === null || scEvent === void 0 ? void 0 : scEvent.id })] })] }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(EventSubscribeButton_1.default, Object.assign({ event: scEvent }, EventSubscribeButtonProps)), (0, jsx_runtime_1.jsx)(EventActionsMenu_1.default, { eventId: scEvent === null || scEvent === void 0 ? void 0 : scEvent.id })] })) }) })] }))] })));
158
165
  }
159
166
  exports.default = EventHeader;
@@ -22,7 +22,7 @@ const Root = (0, material_1.styled)(Widget_1.default, {
22
22
  name: constants_1.PREFIX,
23
23
  slot: 'Root',
24
24
  overridesResolver: (_props, styles) => styles.root
25
- })();
25
+ })(() => ({}));
26
26
  function isTextLongerThanLimit(text, limit = 125) {
27
27
  return text.length > limit;
28
28
  }
@@ -60,6 +60,7 @@ function EventInfoWidget(inProps) {
60
60
  const handleToggleSummary = (0, react_1.useCallback)(() => {
61
61
  setExpanded(!expanded);
62
62
  }, [expanded]);
63
+ // RENDER
63
64
  if (!scEvent && loading) {
64
65
  return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
65
66
  }
@@ -13,7 +13,7 @@ const Root = (0, material_1.styled)(Widget_1.default, {
13
13
  name: constants_1.PREFIX,
14
14
  slot: 'SkeletonRoot',
15
15
  overridesResolver: (_props, styles) => styles.root
16
- })();
16
+ })(() => ({}));
17
17
  function EventInfoWigetSkeleton() {
18
18
  return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, { 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({ direction: "row", alignItems: "center", gap: "8px", marginBottom: "8px" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "184px", height: "21px" })] })), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "100%" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "100%" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "50%" }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ gap: "16px", marginTop: "24px" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "223px", height: "21px" })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "223px", height: "21px" })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "223px", height: "21px" })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "223px", height: "21px" })] }))] }))] })) })));
19
19
  }
@@ -72,23 +72,28 @@ function EventLocationWidget(inProps) {
72
72
  googleMapsApiKey: scContext.settings.integrations.geocoding.apiKey,
73
73
  libraries: ['maps']
74
74
  });
75
+ const mapOptions = {
76
+ fullscreenControl: false,
77
+ mapTypeControl: false,
78
+ streetViewControl: false,
79
+ zoomControl: false // Disables the zoom control (+/- buttons)
80
+ };
75
81
  if (!((_c = (_b = (_a = scContext === null || scContext === void 0 ? void 0 : scContext.settings) === null || _a === void 0 ? void 0 : _a.integrations) === null || _b === void 0 ? void 0 : _b.geocoding) === null || _c === void 0 ? void 0 : _c.apiKey) || (scEvent && (scEvent === null || scEvent === void 0 ? void 0 : scEvent.location) === types_1.SCEventLocationType.ONLINE)) {
76
82
  return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
77
83
  }
78
84
  /**
79
85
  * Loading event
80
86
  */
81
- console.log(isLoaded, scEvent);
82
87
  if (!isLoaded || !scEvent) {
83
88
  return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
84
89
  }
85
90
  /**
86
91
  * Renders root object
87
92
  */
88
- return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, { 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.eventLocationWidget.title", defaultMessage: "ui.eventLocationWidget.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.map }, { children: (0, jsx_runtime_1.jsx)(api_1.GoogleMap, Object.assign({ mapContainerClassName: classes.map, center: {
93
+ return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.title, gutterBottom: true }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventLocationWidget.title", defaultMessage: "ui.eventLocationWidget.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.map }, { children: (0, jsx_runtime_1.jsx)(api_1.GoogleMap, Object.assign({ mapContainerClassName: classes.map, center: {
89
94
  lat: scEvent === null || scEvent === void 0 ? void 0 : scEvent.geolocation_lat,
90
95
  lng: scEvent === null || scEvent === void 0 ? void 0 : scEvent.geolocation_lng
91
- }, zoom: 15 }, { children: (0, jsx_runtime_1.jsx)(api_1.MarkerF, { position: {
96
+ }, options: mapOptions, zoom: 15 }, { children: (0, jsx_runtime_1.jsx)(api_1.MarkerF, { position: {
92
97
  lat: scEvent === null || scEvent === void 0 ? void 0 : scEvent.geolocation_lat,
93
98
  lng: scEvent === null || scEvent === void 0 ? void 0 : scEvent.geolocation_lng
94
99
  } }) })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.locationTitle }, { children: (0, string_1.formatEventLocationGeolocation)(scEvent === null || scEvent === void 0 ? void 0 : scEvent.geolocation, true) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.address }, { children: (0, string_1.formatEventLocationGeolocation)(scEvent === null || scEvent === void 0 ? void 0 : scEvent.geolocation) }))] }) })));