@selfcommunity/react-ui 0.10.4-alpha.8 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/Category/Skeleton.js +1 -1
- package/lib/cjs/components/Composer/Composer.js +19 -13
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.d.ts +6 -1
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +3 -2
- package/lib/cjs/components/EventForm/EventForm.js +25 -7
- package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +7 -7
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +11 -6
- package/lib/cjs/components/Events/Events.js +10 -10
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +2 -2
- package/lib/cjs/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +19 -19
- package/lib/cjs/components/MyEventsWidget/Skeleton.js +2 -4
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.js +3 -2
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +24 -0
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerSkeleton.js +40 -0
- package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +1 -1
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +1 -1
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +6 -0
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +2 -2
- package/lib/cjs/components/VoteButton/VoteButton.js +1 -1
- package/lib/cjs/index.d.ts +2 -1
- package/lib/cjs/index.js +7 -5
- package/lib/cjs/shared/BackdropScrollDisabled/BackdropScrollDisabled.js +1 -1
- package/lib/cjs/shared/ContributionActionsMenu/index.js +1 -1
- package/lib/esm/components/Category/Skeleton.js +1 -1
- package/lib/esm/components/Composer/Composer.js +20 -14
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.d.ts +6 -1
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +3 -2
- package/lib/esm/components/EventForm/EventForm.js +26 -8
- package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +7 -7
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +11 -6
- package/lib/esm/components/Events/Events.js +10 -10
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +2 -2
- package/lib/esm/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +20 -20
- package/lib/esm/components/MyEventsWidget/Skeleton.js +1 -3
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.js +3 -2
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +24 -0
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerSkeleton.js +35 -0
- package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +1 -1
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +1 -1
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +6 -0
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +2 -2
- package/lib/esm/components/VoteButton/VoteButton.js +1 -1
- package/lib/esm/index.d.ts +2 -1
- package/lib/esm/index.js +2 -1
- package/lib/esm/shared/BackdropScrollDisabled/BackdropScrollDisabled.js +1 -1
- package/lib/esm/shared/ContributionActionsMenu/index.js +1 -1
- package/lib/umd/react-ui.js +2 -2
- package/package.json +7 -7
|
@@ -41,6 +41,6 @@ const Root = (0, styles_1.styled)(BaseItem_1.default, {
|
|
|
41
41
|
*/
|
|
42
42
|
function CategorySkeleton(props) {
|
|
43
43
|
const theme = (0, material_1.useTheme)();
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, props, { image: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", width: theme.selfcommunity.category.icon.sizeMedium, height: theme.selfcommunity.category.icon.sizeMedium, className: classes.image }), primary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 120, className: classes.primary }), secondary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 70, className: classes.secondary }), actions: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", disabled: true, className: classes.button }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 50, className: classes.action }) })) })));
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, props, { image: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", width: theme.selfcommunity.category.icon.sizeMedium, height: theme.selfcommunity.category.icon.sizeMedium, className: classes.image }), primary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 120, className: classes.primary }), secondary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 70, className: classes.secondary }), actions: props.actions !== undefined ? (props.actions) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", disabled: true, className: classes.button }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 50, className: classes.action }) }))) })));
|
|
45
45
|
}
|
|
46
46
|
exports.default = CategorySkeleton;
|
|
@@ -272,22 +272,28 @@ function Composer(inProps) {
|
|
|
272
272
|
*/
|
|
273
273
|
dialogRef.current.addEventListener('touchstart', handleTouchStart);
|
|
274
274
|
dialogRef.current.addEventListener('touchmove', handleTouchmove);
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
275
|
+
/**
|
|
276
|
+
* To disable scroll on iOS
|
|
277
|
+
*/
|
|
278
|
+
// dialogRef.current &&
|
|
279
|
+
// disableBodyScroll(dialogRef.current, {
|
|
280
|
+
// allowTouchMove: (el) => {
|
|
281
|
+
// while (el && el !== document.body) {
|
|
282
|
+
// if (el.getAttribute('class') !== null && el.getAttribute('class').includes('SCComposer-content')) {
|
|
283
|
+
// return true;
|
|
284
|
+
// }
|
|
285
|
+
// el = el.parentElement;
|
|
286
|
+
// }
|
|
287
|
+
// }
|
|
288
|
+
// });
|
|
286
289
|
return () => {
|
|
287
290
|
var _a, _b;
|
|
288
291
|
(_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('touchstart', handleTouchStart);
|
|
289
292
|
(_b = dialogRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('touchmove', handleTouchmove);
|
|
290
|
-
|
|
293
|
+
/**
|
|
294
|
+
* To re-enable scroll on iOS
|
|
295
|
+
*/
|
|
296
|
+
// dialogRef.current && enableBodyScroll(dialogRef.current);
|
|
291
297
|
};
|
|
292
298
|
}, [dialogRef.current, isIOS]);
|
|
293
299
|
/* Handlers */
|
|
@@ -583,7 +589,7 @@ function Composer(inProps) {
|
|
|
583
589
|
if (!scUserContext.user && !(scUserContext.loading && open)) {
|
|
584
590
|
return null;
|
|
585
591
|
}
|
|
586
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ ref: dialogRef, TransitionComponent: DialogTransition, BackdropComponent: BackdropScrollDisabled_1.default, onClose: handleClose }, rest, { disableEscapeKeyDown: true, className: (0, classnames_1.default)(classes.root, { [classes.ios]: isIOS }), scroll: "
|
|
592
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ ref: dialogRef, TransitionComponent: DialogTransition, BackdropComponent: BackdropScrollDisabled_1.default, onClose: handleClose }, rest, { disableEscapeKeyDown: true, className: (0, classnames_1.default)(classes.root, { [classes.ios]: isIOS }), scroll: "body", fullScreen: fullScreen, tabIndex: -1 }, { children: [(0, jsx_runtime_1.jsxs)("form", Object.assign({ onSubmit: handleSubmit, method: "post" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, Object.assign({ className: classes.title }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleClosePrompt }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "close" }) })), (0, jsx_runtime_1.jsx)(LoadingButton_1.default, Object.assign({ size: "small", type: "submit", color: "secondary", variant: "contained", disabled: !canSubmit, loading: isSubmitting }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.submit", defaultMessage: "ui.composer.submit" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(Attributes_1.default, { value: { categories, event, group, addressing, location }, className: classes.attributes, onChange: handleChangeAttributes, onClick: handleClickAttributes }), content, medias && medias.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.medias }, { children: mediaObjectTypes.map((mediaObjectType) => {
|
|
587
593
|
if (mediaObjectType.previewComponent) {
|
|
588
594
|
return (0, jsx_runtime_1.jsx)(mediaObjectType.previewComponent, { value: medias, onChange: handleChangeMedias }, mediaObjectType.name);
|
|
589
595
|
}
|
|
@@ -7,6 +7,11 @@ export interface ComposerIconButtonProps extends IconButtonProps {
|
|
|
7
7
|
* @default null
|
|
8
8
|
*/
|
|
9
9
|
ComposerProps?: ComposerProps;
|
|
10
|
+
/**
|
|
11
|
+
* Callback onClose Composer dialog
|
|
12
|
+
* @default null
|
|
13
|
+
*/
|
|
14
|
+
onClose?: () => void;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* > API documentation for the Community-JS Composer Icon Button component. Learn about the available props and the CSS API.
|
|
@@ -30,5 +35,5 @@ export interface ComposerIconButtonProps extends IconButtonProps {
|
|
|
30
35
|
|
|
31
36
|
* @param inProps
|
|
32
37
|
*/
|
|
33
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<ComposerIconButtonProps, "id" | "role" | "className" | "style" | "classes" | "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "component" | "name" | "type" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "action" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "ComposerProps"> & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<ComposerIconButtonProps, "id" | "role" | "className" | "style" | "classes" | "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "component" | "name" | "onClose" | "type" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "action" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge" | "ComposerProps"> & React.RefAttributes<HTMLButtonElement>>;
|
|
34
39
|
export default _default;
|
|
@@ -48,7 +48,7 @@ exports.default = react_1.default.forwardRef(function ComposerIconButton(inProps
|
|
|
48
48
|
props: inProps,
|
|
49
49
|
name: PREFIX
|
|
50
50
|
});
|
|
51
|
-
const { className = null, ComposerProps = {}, onClick } = props, rest = tslib_1.__rest(props, ["className", "ComposerProps", "onClick"]);
|
|
51
|
+
const { className = null, ComposerProps = {}, onClick, onClose } = props, rest = tslib_1.__rest(props, ["className", "ComposerProps", "onClick", "onClose"]);
|
|
52
52
|
// STATE
|
|
53
53
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
54
54
|
// CONTEXT
|
|
@@ -76,6 +76,7 @@ exports.default = react_1.default.forwardRef(function ComposerIconButton(inProps
|
|
|
76
76
|
}, [onClick, enqueueSnackbar, scContext.settings, scUserContext.user]);
|
|
77
77
|
const handleClose = (0, react_1.useCallback)(() => {
|
|
78
78
|
setOpen(false);
|
|
79
|
+
onClose && onClose();
|
|
79
80
|
}, []);
|
|
80
81
|
const handleSuccess = (0, react_1.useMemo)(() => (feedObject) => {
|
|
81
82
|
setOpen(false);
|
|
@@ -85,5 +86,5 @@ exports.default = react_1.default.forwardRef(function ComposerIconButton(inProps
|
|
|
85
86
|
autoHideDuration: 7000
|
|
86
87
|
});
|
|
87
88
|
}, []);
|
|
88
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { onClick: handleClick, ref: ref }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "add_circle_outline" }) })), open && (0, jsx_runtime_1.jsx)(Composer_1.default, Object.assign({
|
|
89
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { onClick: handleClick, ref: ref }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "add_circle_outline" }) })), open && (0, jsx_runtime_1.jsx)(Composer_1.default, Object.assign({ open: open, fullWidth: true, onClose: handleClose, onSuccess: handleSuccess }, ComposerProps))] }));
|
|
89
90
|
});
|
|
@@ -76,7 +76,8 @@ const classes = {
|
|
|
76
76
|
actions: `${constants_1.PREFIX}-actions`,
|
|
77
77
|
privacySection: `${constants_1.PREFIX}-privacy-section`,
|
|
78
78
|
privacySectionInfo: `${constants_1.PREFIX}-privacy-section-info`,
|
|
79
|
-
error: `${constants_1.PREFIX}-error
|
|
79
|
+
error: `${constants_1.PREFIX}-error`,
|
|
80
|
+
genericError: `${constants_1.PREFIX}-generic-error`
|
|
80
81
|
};
|
|
81
82
|
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
82
83
|
name: constants_1.PREFIX,
|
|
@@ -148,6 +149,7 @@ function EventForm(inProps) {
|
|
|
148
149
|
// STATE
|
|
149
150
|
const [field, setField] = (0, react_1.useState)(initialFieldState);
|
|
150
151
|
const [error, setError] = (0, react_1.useState)({});
|
|
152
|
+
const [genericError, setGenericError] = (0, react_1.useState)(null);
|
|
151
153
|
// PREFERENCES
|
|
152
154
|
const scPreferences = (0, react_core_1.useSCPreferences)();
|
|
153
155
|
const privateEnabled = (0, react_1.useMemo)(() => scPreferences.preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED].value, [scPreferences.preferences]);
|
|
@@ -168,6 +170,7 @@ function EventForm(inProps) {
|
|
|
168
170
|
delete error.imageOriginalError;
|
|
169
171
|
setError(error);
|
|
170
172
|
}
|
|
173
|
+
setGenericError(null);
|
|
171
174
|
}, [error]);
|
|
172
175
|
/**
|
|
173
176
|
* Notify when a group info changed
|
|
@@ -185,9 +188,11 @@ function EventForm(inProps) {
|
|
|
185
188
|
}, [event]);
|
|
186
189
|
const handleGeoData = (0, react_1.useCallback)((data) => {
|
|
187
190
|
setField((prev) => (Object.assign(Object.assign({}, prev), data)));
|
|
191
|
+
setGenericError(null);
|
|
188
192
|
}, []);
|
|
189
193
|
const handleSubmit = (0, react_1.useCallback)(() => {
|
|
190
194
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: true })));
|
|
195
|
+
setGenericError(null);
|
|
191
196
|
const formData = new FormData();
|
|
192
197
|
if (field.imageOriginalFile) {
|
|
193
198
|
formData.append('image_original', field.imageOriginalFile);
|
|
@@ -227,12 +232,23 @@ function EventForm(inProps) {
|
|
|
227
232
|
})
|
|
228
233
|
.catch((e) => {
|
|
229
234
|
const _error = (0, api_services_1.formatHttpErrorCode)(e);
|
|
230
|
-
if (Object.
|
|
231
|
-
|
|
235
|
+
if ('errorsError' in _error || !Object.keys(_error).length) {
|
|
236
|
+
setGenericError(intl.formatMessage({
|
|
237
|
+
id: 'ui.eventForm.genericError',
|
|
238
|
+
defaultMessage: 'ui.eventForm.genericError'
|
|
239
|
+
}));
|
|
232
240
|
}
|
|
233
241
|
else {
|
|
234
|
-
|
|
242
|
+
setGenericError(null);
|
|
235
243
|
}
|
|
244
|
+
let __errors = {};
|
|
245
|
+
if ('coverError' in _error) {
|
|
246
|
+
__errors = Object.assign(Object.assign({}, __errors), { ['coverError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.ui.eventForm.cover.error", defaultMessage: "ui.ui.eventForm.cover.error" }) });
|
|
247
|
+
}
|
|
248
|
+
if ('nameError' in _error || ('nonFieldErrorsError' in _error && _error['nonFieldErrorsError'].error === 'unique')) {
|
|
249
|
+
__errors = Object.assign(Object.assign({}, __errors), { ['nameError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.name.error.unique", defaultMessage: "ui.eventForm.name.error.unique" }) });
|
|
250
|
+
}
|
|
251
|
+
setError(__errors);
|
|
236
252
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
|
|
237
253
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
238
254
|
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
@@ -245,6 +261,7 @@ function EventForm(inProps) {
|
|
|
245
261
|
delete error[`${name}Error`];
|
|
246
262
|
setError(error);
|
|
247
263
|
}
|
|
264
|
+
setGenericError(null);
|
|
248
265
|
}, [setField, error]);
|
|
249
266
|
const handleChangeDateTime = (0, react_1.useCallback)((value, name) => {
|
|
250
267
|
setField((prev) => (Object.assign(Object.assign({}, prev), { [name]: value })));
|
|
@@ -256,6 +273,7 @@ function EventForm(inProps) {
|
|
|
256
273
|
delete error['endDateError'];
|
|
257
274
|
setError(error);
|
|
258
275
|
}
|
|
276
|
+
setGenericError(null);
|
|
259
277
|
}, [setField, error]);
|
|
260
278
|
const shouldDisableDate = (0, react_1.useCallback)((date) => {
|
|
261
279
|
let disabled = false;
|
|
@@ -279,7 +297,7 @@ function EventForm(inProps) {
|
|
|
279
297
|
/**
|
|
280
298
|
* Renders root object
|
|
281
299
|
*/
|
|
282
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ 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)(UploadEventCover_1.default, { isCreationMode: true, onChange: handleChangeCover }) })), (0, jsx_runtime_1.jsxs)(material_1.FormGroup, Object.assign({ className: classes.form }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: field.name, name: "name", onChange: handleChange, InputProps: {
|
|
300
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ 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)(UploadEventCover_1.default, { isCreationMode: true, onChange: handleChangeCover }) })), Boolean(error['coverError']) && (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ color: "error" }, { children: error['coverError'] })), (0, jsx_runtime_1.jsxs)(material_1.FormGroup, Object.assign({ className: classes.form }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: field.name, name: "name", onChange: handleChange, InputProps: {
|
|
283
301
|
endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: Event_1.EVENT_TITLE_MAX_LENGTH - field.name.length }))
|
|
284
302
|
}, error: Boolean(field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH) || Boolean(error['nameError']), helperText: field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.name.error.maxLength", defaultMessage: "ui.eventForm.name.error.maxLength" })) : error['nameError'] ? (error['nameError']) : null }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.dateTime }, { children: (0, jsx_runtime_1.jsxs)(x_date_pickers_1.LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns_1.AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ? it_1.default : en_US_1.default }, { children: [(0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileDatePicker, { className: classes.picker, disablePast: true, label: field.startDate && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.date.placeholder", defaultMessage: "ui.eventForm.date.placeholder" }), value: field.startDate, slots: {
|
|
285
303
|
textField: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.startDate)}`, startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "CalendarIcon" }) }) }))) }) })))
|
|
@@ -331,7 +349,7 @@ function EventForm(inProps) {
|
|
|
331
349
|
b: (chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
332
350
|
} })) }))] }))), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
333
351
|
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_a = field.description) === null || _a === void 0 ? void 0 : _a.length) ? Event_1.EVENT_DESCRIPTION_MAX_LENGTH - field.description.length : Event_1.EVENT_DESCRIPTION_MAX_LENGTH })))
|
|
334
|
-
}, error: Boolean(((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
|
|
352
|
+
}, error: Boolean(((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null }), genericError && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.genericError }, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
|
|
335
353
|
!field.startDate ||
|
|
336
354
|
!field.startTime ||
|
|
337
355
|
!field.endDate ||
|
|
@@ -339,7 +357,7 @@ function EventForm(inProps) {
|
|
|
339
357
|
(field.location === types_1.SCEventLocationType.ONLINE && !field.link) ||
|
|
340
358
|
(field.location === types_1.SCEventLocationType.PERSON && !field.geolocation) ||
|
|
341
359
|
(field.recurring !== types_1.SCEventRecurrenceType.NEVER && !field.endDate && !field.endTime) ||
|
|
342
|
-
|
|
360
|
+
field.isSubmitting ||
|
|
343
361
|
field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH ||
|
|
344
362
|
field.description.length > Event_1.EVENT_DESCRIPTION_MAX_LENGTH, variant: "contained", onClick: handleSubmit, color: "secondary" }, { children: event ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.button.edit", defaultMessage: "ui.eventForm.button.edit" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.button.create", defaultMessage: "ui.eventForm.button.create" })) })) }))] }))] })));
|
|
345
363
|
}
|
|
@@ -99,7 +99,7 @@ function EventMembersWidget(inProps) {
|
|
|
99
99
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
}, [participants.isLoadingNext, participants.initialized, scEvent, dispatchParticipants, setParticipantsCount]);
|
|
102
|
+
}, [participants.isLoadingNext, participants.initialized, scEvent, endpointQueryParams, dispatchParticipants, setParticipantsCount]);
|
|
103
103
|
const _initInvited = (0, react_1.useCallback)(() => {
|
|
104
104
|
if (!invited.initialized && !invited.isLoadingNext && hasAllow) {
|
|
105
105
|
dispatchInvited({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
@@ -113,7 +113,7 @@ function EventMembersWidget(inProps) {
|
|
|
113
113
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
}, [invited.isLoadingNext, invited.initialized, scEvent, dispatchInvited, setInvitedCount]);
|
|
116
|
+
}, [invited.isLoadingNext, invited.initialized, scEvent, hasAllow, endpointQueryParams, dispatchInvited, setInvitedCount]);
|
|
117
117
|
const _initRequests = (0, react_1.useCallback)(() => {
|
|
118
118
|
if (!requests.initialized && !requests.isLoadingNext && hasAllow) {
|
|
119
119
|
dispatchRequests({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
@@ -128,7 +128,7 @@ function EventMembersWidget(inProps) {
|
|
|
128
128
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
}, [requests.isLoadingNext, requests.initialized, scEvent, dispatchRequests, setRequestsCount, setRequestsUsers]);
|
|
131
|
+
}, [requests.isLoadingNext, requests.initialized, scEvent, hasAllow, endpointQueryParams, dispatchRequests, setRequestsCount, setRequestsUsers]);
|
|
132
132
|
// EFFECTS
|
|
133
133
|
(0, react_1.useEffect)(() => {
|
|
134
134
|
let _t;
|
|
@@ -152,18 +152,18 @@ function EventMembersWidget(inProps) {
|
|
|
152
152
|
clearTimeout(_t);
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
}, [scUserContext.user, scEvent, refresh]);
|
|
155
|
+
}, [scUserContext.user, scEvent, refresh, _initParticipants, _initInvited, _initRequests]);
|
|
156
156
|
(0, react_1.useEffect)(() => {
|
|
157
157
|
if (participants.initialized && scEvent && Boolean((eventId !== undefined && scEvent.id !== eventId) || (event && scEvent.id !== event.id))) {
|
|
158
158
|
dispatchParticipants({ type: widget_1.actionWidgetTypes.RESET, payload: {} });
|
|
159
159
|
dispatchRequests({ type: widget_1.actionWidgetTypes.RESET, payload: {} });
|
|
160
160
|
dispatchInvited({ type: widget_1.actionWidgetTypes.RESET, payload: {} });
|
|
161
161
|
}
|
|
162
|
-
}, [participants.initialized, scEvent, eventId, event]);
|
|
162
|
+
}, [participants.initialized, scEvent, eventId, event, dispatchParticipants, dispatchInvited, dispatchRequests]);
|
|
163
163
|
// HANDLERS
|
|
164
164
|
const handleTabChange = (0, react_1.useCallback)((_evt, newTabValue) => {
|
|
165
165
|
setTabValue(newTabValue);
|
|
166
|
-
}, []);
|
|
166
|
+
}, [setTabValue]);
|
|
167
167
|
const handleRefresh = (0, react_1.useCallback)((_tabValue) => {
|
|
168
168
|
if (_tabValue === types_1.TabContentEnum.PARTICIPANTS) {
|
|
169
169
|
dispatchParticipants({ type: widget_1.actionWidgetTypes.RESET });
|
|
@@ -172,7 +172,7 @@ function EventMembersWidget(inProps) {
|
|
|
172
172
|
dispatchInvited({ type: widget_1.actionWidgetTypes.RESET });
|
|
173
173
|
}
|
|
174
174
|
setRefresh(_tabValue);
|
|
175
|
-
}, []);
|
|
175
|
+
}, [dispatchParticipants, dispatchInvited, setRefresh]);
|
|
176
176
|
if (!scUserContext.user) {
|
|
177
177
|
return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
|
|
178
178
|
}
|
|
@@ -43,7 +43,7 @@ function TabContentComponent(props) {
|
|
|
43
43
|
// HOOKS
|
|
44
44
|
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
45
45
|
// CONSTS
|
|
46
|
-
const users = (0, react_1.useMemo)(() => (tabValue === types_1.TabContentEnum.REQUESTS ? actionProps === null || actionProps === void 0 ? void 0 : actionProps.users : state.results), [tabValue, actionProps, state]);
|
|
46
|
+
const users = (0, react_1.useMemo)(() => (tabValue === types_1.TabContentEnum.REQUESTS ? actionProps === null || actionProps === void 0 ? void 0 : actionProps.users : state.results), [tabValue, actionProps === null || actionProps === void 0 ? void 0 : actionProps.users, state.results]);
|
|
47
47
|
// EFFECTS
|
|
48
48
|
(0, react_1.useEffect)(() => {
|
|
49
49
|
updatesInvited.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.EVENT}.${PubSub_1.SCGroupEventType.INVITE_MEMBER}`, handleInviteMember);
|
|
@@ -53,6 +53,11 @@ function TabContentComponent(props) {
|
|
|
53
53
|
updatesParticipants.current && pubsub_js_1.default.unsubscribe(updatesParticipants.current);
|
|
54
54
|
};
|
|
55
55
|
}, []);
|
|
56
|
+
(0, react_1.useEffect)(() => {
|
|
57
|
+
if (openDialog && state.next && state.initialized) {
|
|
58
|
+
handleNext();
|
|
59
|
+
}
|
|
60
|
+
}, [openDialog, state.next, state.initialized]);
|
|
56
61
|
// HANDLERS
|
|
57
62
|
/**
|
|
58
63
|
* Handles pagination
|
|
@@ -70,16 +75,16 @@ function TabContentComponent(props) {
|
|
|
70
75
|
.catch((error) => {
|
|
71
76
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
72
77
|
});
|
|
73
|
-
}, [state.next, state.isLoadingNext, state.initialized]);
|
|
78
|
+
}, [state.next, state.isLoadingNext, state.initialized, dispatch]);
|
|
74
79
|
const handleToggleDialogOpen = (0, react_1.useCallback)(() => {
|
|
75
80
|
setOpenDialog((prev) => !prev);
|
|
76
|
-
}, []);
|
|
81
|
+
}, [setOpenDialog]);
|
|
77
82
|
const handleToggleMember = (0, react_1.useCallback)(() => {
|
|
78
83
|
handleRefresh === null || handleRefresh === void 0 ? void 0 : handleRefresh(types_1.TabContentEnum.PARTICIPANTS);
|
|
79
|
-
}, []);
|
|
84
|
+
}, [handleRefresh]);
|
|
80
85
|
const handleInviteMember = (0, react_1.useCallback)(() => {
|
|
81
86
|
handleRefresh === null || handleRefresh === void 0 ? void 0 : handleRefresh(types_1.TabContentEnum.INVITED);
|
|
82
|
-
}, []);
|
|
87
|
+
}, [handleRefresh]);
|
|
83
88
|
const getActionsComponent = (0, react_1.useCallback)((userId) => {
|
|
84
89
|
if (tabValue === types_1.TabContentEnum.INVITED && actionProps) {
|
|
85
90
|
const _handleInvitations = (invited) => {
|
|
@@ -130,6 +135,6 @@ function TabContentComponent(props) {
|
|
|
130
135
|
else if (tabValue === types_1.TabContentEnum.REQUESTS && (actionProps === null || actionProps === void 0 ? void 0 : actionProps.count) === 0) {
|
|
131
136
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noOtherRequests", defaultMessage: "ui.eventMembersWidget.noOtherRequests" }) })));
|
|
132
137
|
}
|
|
133
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.List, { children: users === null || users === void 0 ? void 0 : users.map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps, { actions: getActionsComponent(user.id) })) }, user.id))) }), state.count > state.visibleItems && ((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.eventMembersWidget.showAll", defaultMessage: "ui.eventMembersWidget.showAll" }) })) }))), openDialog && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventMembersWidget.title", id: "ui.eventMembersWidget.title" }), 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)(User_1.UserSkeleton, Object.assign({ elevation: 0 }, userProps)), 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.eventMembersWidget.noMoreResults", defaultMessage: "ui.eventMembersWidget.noMoreResults" }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, { children: state.results.map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps)) }, user.id))) }) })) })))] }));
|
|
138
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.List, { children: users === null || users === void 0 ? void 0 : users.slice(0, state.visibleItems).map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps, { actions: getActionsComponent(user.id) })) }, user.id))) }), state.count > state.visibleItems && ((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.eventMembersWidget.showAll", defaultMessage: "ui.eventMembersWidget.showAll" }) })) }))), openDialog && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventMembersWidget.title", id: "ui.eventMembersWidget.title" }), 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)(User_1.UserSkeleton, Object.assign({ elevation: 0 }, userProps)), 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.eventMembersWidget.noMoreResults", defaultMessage: "ui.eventMembersWidget.noMoreResults" }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, { children: state.results.map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps)) }, user.id))) }) })) })))] }));
|
|
134
139
|
}
|
|
135
140
|
exports.default = TabContentComponent;
|
|
@@ -121,14 +121,14 @@ function Events(inProps) {
|
|
|
121
121
|
/**
|
|
122
122
|
* Fetches events list
|
|
123
123
|
*/
|
|
124
|
-
const fetchEvents = (
|
|
124
|
+
const fetchEvents = () => {
|
|
125
125
|
setLoading(true);
|
|
126
126
|
return api_services_1.http
|
|
127
127
|
.request({
|
|
128
128
|
url: endpoint.url({}),
|
|
129
129
|
method: endpoint.method,
|
|
130
130
|
params: Object.assign(Object.assign({}, endpointQueryParams), (general
|
|
131
|
-
? Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (
|
|
131
|
+
? Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (query && { search: query })), (dateSearch !== types_1.SCEventDateFilterType.ANY && { date_filter: dateSearch })), (location !== types_1.SCEventLocationFilterType.ANY && { location })), (showFollowed && { follows: showFollowed })), (showPastEvents && { date_filter: types_1.SCEventDateFilterType.PAST })) : Object.assign(Object.assign(Object.assign({ subscription_status: types_1.SCEventSubscriptionStatusType.GOING }, (location !== types_1.SCEventLocationFilterType.ANY && { location })), (showPastEvents && { past: showPastEvents })), (showMyEvents && { created_by: authUserId }))))
|
|
132
132
|
})
|
|
133
133
|
.then((res) => {
|
|
134
134
|
setEvents(res.data.results);
|
|
@@ -147,9 +147,9 @@ function Events(inProps) {
|
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
else {
|
|
150
|
-
|
|
150
|
+
fetchEvents();
|
|
151
151
|
}
|
|
152
|
-
}, [contentAvailability, authUserId, dateSearch, location, showFollowed, showPastEvents, showMyEvents
|
|
152
|
+
}, [contentAvailability, authUserId, dateSearch, location, showFollowed, showPastEvents, showMyEvents]);
|
|
153
153
|
/**
|
|
154
154
|
* Subscriber for pubsub callback
|
|
155
155
|
*/
|
|
@@ -212,18 +212,18 @@ function Events(inProps) {
|
|
|
212
212
|
/**
|
|
213
213
|
* Renders events list
|
|
214
214
|
*/
|
|
215
|
-
const c = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showFilters && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(
|
|
215
|
+
const c = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showFilters && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.EventsChipRoot, { color: showMyEvents ? 'secondary' : 'default', variant: showMyEvents ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByCreatedByMe", defaultMessage: "ui.events.filterByCreatedByMe" }), onClick: () => setShowMyEvents(!showMyEvents),
|
|
216
216
|
// @ts-expect-error this is needed to use showFollowed into SCEvents
|
|
217
|
-
showFollowed: showMyEvents, deleteIcon: showMyEvents ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showMyEvents ?
|
|
217
|
+
showFollowed: showMyEvents, deleteIcon: showMyEvents ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showMyEvents ? () => setShowMyEvents(false) : null, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(PastEventsFilter_1.default, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsx)(LocationEventsFilter_1.default, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 3 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.search, size: 'small', fullWidth: true, value: query, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
|
|
218
218
|
e.preventDefault();
|
|
219
219
|
if (e.key === 'Enter') {
|
|
220
|
-
fetchEvents(
|
|
220
|
+
fetchEvents();
|
|
221
221
|
}
|
|
222
222
|
}, InputProps: {
|
|
223
|
-
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: isMobile ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => fetchEvents(
|
|
224
|
-
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ disabled: showPastEvents || loading
|
|
223
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: isMobile ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => fetchEvents(), disabled: loading }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "search" }) }))) : ((0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", variant: "contained", color: "secondary", onClick: () => fetchEvents(), endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "search" }), disabled: loading })) })))
|
|
224
|
+
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ disabled: showPastEvents || loading, size: 'small', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }), value: dateSearch, onChange: handleOnChangeTimeFrame, renderValue: (selected) => options.find((option) => option.value === selected).label }, { children: options.map((option) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ value: option.value }, { children: [(0, jsx_runtime_1.jsx)(material_1.Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsx)(LocationEventsFilter_1.default, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) })), authUserId && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.EventsChipRoot, { color: showFollowed ? 'secondary' : 'default', variant: showFollowed ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByFollowedInterest", defaultMessage: "ui.events.filterByFollowedInterest" }), onClick: handleChipClick,
|
|
225
225
|
// @ts-expect-error this is needed to use showFollowed into SCEvents
|
|
226
|
-
showFollowed: showFollowed, deleteIcon: showFollowed ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showFollowed ? handleDeleteClick : null, disabled: loading
|
|
226
|
+
showFollowed: showFollowed, deleteIcon: showFollowed ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showFollowed ? handleDeleteClick : null, disabled: loading }) }))), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(PastEventsFilter_1.default, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, disabled: dateSearch !== types_1.SCEventDateFilterType.ANY || loading }) }))] })) }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({}, EventsSkeletonComponentProps, { EventSkeletonProps: EventSkeletonComponentProps }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !events.length ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.noResults }, { children: general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (onlyStaffEnabled && react_core_1.UserUtils.isStaff(scUserContext.user)) || !onlyStaffEnabled ? (0, jsx_runtime_1.jsx)(CreateEventButton_1.default, {}) : null })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.noEvents.title", defaultMessage: "ui.events.noEvents.title" }) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (onlyStaffEnabled && react_core_1.UserUtils.isStaff(scUserContext.user)) || !onlyStaffEnabled ? (0, jsx_runtime_1.jsx)(CreateEventButton_1.default, {}) : null })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.noEvents.title.personal", defaultMessage: "ui.events.noEvents.title.personal" }) }))] })) }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: { xs: 2 }, className: classes.events }, GridContainerComponentProps, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [events.map((event) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, className: classes.item }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Event_1.default, Object.assign({ event: event, eventId: event.id }, EventComponentProps)) }), event.id))), authUserId && events.length % 2 !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, className: classes.itemSkeleton }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (0, jsx_runtime_1.jsx)(CreateEventButton_1.default, Object.assign({ variant: "outlined", color: "primary", size: "small" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.skeleton.action.add", defaultMessage: "ui.events.skeleton.action.add" }) })) })) }), 'skeleton-item'))] }) })), Boolean(next) && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "secondary", variant: "text", onClick: handleNext, className: classes.showMore }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.button.seeMore", defaultMessage: "ui.events.button.seeMore" }) })))] })) })) })] }));
|
|
227
227
|
/**
|
|
228
228
|
* Renders root object (if content availability community option is false and user is anonymous, component is hidden)
|
|
229
229
|
*/
|
|
@@ -197,7 +197,7 @@ function Share(props) {
|
|
|
197
197
|
* @return {JSX.Element}
|
|
198
198
|
*/
|
|
199
199
|
function renderShareBtn() {
|
|
200
|
-
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: withAction && ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [!inlineAction && withAudience && (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.divider }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: `${intl.formatMessage(messages.share)}` }, { children: (0, jsx_runtime_1.jsx)(LoadingButton_1.default, Object.assign({ loading: isSharing, onClick: handleOpenShareMenu, className: classes.button }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "share" }) })) })), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !isMobile ? ((0, jsx_runtime_1.jsx)(material_1.Menu, Object.assign({ anchorEl: anchorEl, open:
|
|
200
|
+
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: withAction && ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [!inlineAction && withAudience && (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.divider }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: `${intl.formatMessage(messages.share)}` }, { children: (0, jsx_runtime_1.jsx)(LoadingButton_1.default, Object.assign({ loading: isSharing, onClick: handleOpenShareMenu, className: classes.button }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "share" }) })) })), Boolean(anchorEl) && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !isMobile ? ((0, jsx_runtime_1.jsx)(material_1.Menu, Object.assign({ anchorEl: anchorEl, open: true, onClose: handleClose, onClick: handleClose, slotProps: {
|
|
201
201
|
paper: {
|
|
202
202
|
elevation: 0,
|
|
203
203
|
sx: {
|
|
@@ -218,7 +218,7 @@ function Share(props) {
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
}, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' } }, { children: renderShareMenuItems() }))) : ((0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, Object.assign({ open:
|
|
221
|
+
}, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' } }, { children: renderShareMenuItems() }))) : ((0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, Object.assign({ open: true, onClick: handleClose, onClose: handleClose, onOpen: handleOpenShareMenu, anchor: "bottom", disableSwipeToOpen: true }, { children: renderShareMenuItems() }))) })), isComposerOpen && ((0, jsx_runtime_1.jsx)(Composer_1.default, { open: true, defaultValue: composerShareProps, onClose: handleComposerOnClose, onSuccess: handleComposerOnSuccess, maxWidth: "sm", fullWidth: true }))] })) }));
|
|
222
222
|
}
|
|
223
223
|
/**
|
|
224
224
|
* Renders share action
|
|
@@ -80,25 +80,25 @@ function ActivitiesMenu(props) {
|
|
|
80
80
|
*/
|
|
81
81
|
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsx)(Box_1.default, Object.assign({ className: classes.selector }, { children: (0, jsx_runtime_1.jsx)(Tooltip_1.default, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.activitiesMenu.tooltipTitle", defaultMessage: "ui.feedObject.activitiesMenu.tooltipTitle" }) }, { children: (0, jsx_runtime_1.jsxs)(material_1.Button, Object.assign({ variant: "text", size: "small", onClick: handleOpen }, { children: [selectedActivities === feedObject_1.SCFeedObjectActivitiesType.CONNECTIONS_COMMENTS && followEnabled
|
|
82
82
|
? intl.formatMessage(messages.followedComments)
|
|
83
|
-
: intl.formatMessage(messages[`${(0, utils_1.camelCase)(selectedActivities)}`]), "\u00A0 ", (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "expand_more" })] })) })) })), isMobile ? ((0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, Object.assign({ open:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
83
|
+
: intl.formatMessage(messages[`${(0, utils_1.camelCase)(selectedActivities)}`]), "\u00A0 ", (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "expand_more" })] })) })) })), open && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isMobile ? ((0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, Object.assign({ open: true, onClose: handleClose, onOpen: handleOpen, anchor: "bottom", disableSwipeToOpen: true }, { children: renderMenuContent() }))) : ((0, jsx_runtime_1.jsx)(Menu_1.default, Object.assign({ anchorEl: anchorEl, open: true, onClose: handleClose, onClick: handleClose, PaperProps: {
|
|
84
|
+
elevation: 0,
|
|
85
|
+
sx: {
|
|
86
|
+
overflow: 'visible',
|
|
87
|
+
filter: 'drop-shadow(0px 2px 8px rgba(0,0,0,0.32))',
|
|
88
|
+
mt: 1.5,
|
|
89
|
+
'&:before': {
|
|
90
|
+
content: '""',
|
|
91
|
+
display: 'block',
|
|
92
|
+
position: 'absolute',
|
|
93
|
+
top: 0,
|
|
94
|
+
right: 14,
|
|
95
|
+
width: 10,
|
|
96
|
+
height: 10,
|
|
97
|
+
bgcolor: 'background.paper',
|
|
98
|
+
transform: 'translateY(-50%) rotate(45deg)',
|
|
99
|
+
zIndex: 0
|
|
100
|
+
}
|
|
100
101
|
}
|
|
101
|
-
}
|
|
102
|
-
}, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' } }, { children: renderMenuContent() })))] })));
|
|
102
|
+
}, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' } }, { children: renderMenuContent() }))) }))] })));
|
|
103
103
|
}
|
|
104
104
|
exports.default = ActivitiesMenu;
|
|
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
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
6
|
const Widget_1 = tslib_1.__importDefault(require("../Widget"));
|
|
9
7
|
const constants_1 = require("./constants");
|
|
10
8
|
const event_1 = require("../../types/event");
|
|
@@ -17,12 +15,12 @@ const classes = {
|
|
|
17
15
|
secondDivider: `${constants_1.PREFIX}-second-divider`,
|
|
18
16
|
actions: `${constants_1.PREFIX}-actions`
|
|
19
17
|
};
|
|
20
|
-
const Root = (0,
|
|
18
|
+
const Root = (0, material_1.styled)(Widget_1.default, {
|
|
21
19
|
name: constants_1.PREFIX,
|
|
22
20
|
slot: 'SkeletonRoot',
|
|
23
21
|
overridesResolver: (_props, styles) => styles.skeletonRoot
|
|
24
22
|
})(() => ({}));
|
|
25
23
|
function MyEventsWidgetSkeleton() {
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ padding: "12px 16px" }, { children: (0, jsx_runtime_1.jsx)(
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ padding: "12px 16px" }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "141px", height: "33px" }) })), (0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, { template: event_1.SCEventTemplateType.DETAIL, elevation: 0, square: true, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}) }), (0, jsx_runtime_1.jsxs)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rounded", width: "14px", height: "14px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", width: "52px", height: "20px" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rounded", width: "14px", height: "14px" })] }))] })));
|
|
27
25
|
}
|
|
28
26
|
exports.default = MyEventsWidgetSkeleton;
|