@selfcommunity/react-ui 0.11.0-mui7.16 → 0.11.0-mui7.18
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/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +1 -2
- package/lib/cjs/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +1 -2
- package/lib/cjs/components/AccountDataPortability/AccountDataPortability.js +4 -9
- package/lib/cjs/components/AccountDelete/AccountDelete.js +2 -9
- package/lib/cjs/components/BuyButton/BuyButton.js +1 -2
- package/lib/cjs/components/Categories/Categories.js +1 -1
- package/lib/cjs/components/Categories/Skeleton.js +1 -1
- package/lib/cjs/components/CategoryFollowButton/CategoryFollowButton.js +3 -4
- package/lib/cjs/components/ChangeGroupCover/ChangeGroupCover.js +1 -2
- package/lib/cjs/components/ChangeGroupPicture/ChangeGroupPicture.js +1 -2
- package/lib/cjs/components/Checkout/Skeleton.js +1 -1
- package/lib/cjs/components/CommentObjectReply/CommentObjectReply.js +1 -2
- package/lib/cjs/components/CommunityPaywalls/CommunityPaywalls.js +1 -1
- package/lib/cjs/components/Composer/Composer.js +1 -2
- package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.js +4 -4
- package/lib/cjs/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +5 -5
- package/lib/cjs/components/CourseDashboard/Student/ActionButton.d.ts +1 -2
- package/lib/cjs/components/CourseDashboard/Student/ActionButton.js +1 -2
- package/lib/cjs/components/CourseDashboard/Teacher/Comments.js +1 -2
- package/lib/cjs/components/CourseForm/CourseForm.js +1 -2
- package/lib/cjs/components/CourseForm/UploadCourseCover.js +1 -2
- package/lib/cjs/components/CourseJoinButton/CourseJoinButton.js +3 -4
- package/lib/cjs/components/Courses/Courses.js +3 -3
- package/lib/cjs/components/Courses/Skeleton.js +1 -1
- package/lib/cjs/components/CreatePaymentProductForm/CreatePaymentProductForm.js +1 -2
- package/lib/cjs/components/EditCourse/Lessons/ChangeLessonStatus.js +2 -3
- package/lib/cjs/components/EditCourse/Lessons/FieldName.js +1 -2
- package/lib/cjs/components/EditCourse/Options.js +1 -2
- package/lib/cjs/components/EventForm/EventForm.js +5 -6
- package/lib/cjs/components/EventForm/UploadEventCover.js +1 -2
- package/lib/cjs/components/EventInviteButton/EventInviteButton.js +1 -2
- package/lib/cjs/components/EventMediaWidget/EventMediaWidget.js +1 -2
- package/lib/cjs/components/EventMediaWidget/TriggerButton.d.ts +2 -2
- package/lib/cjs/components/EventMediaWidget/TriggerButton.js +1 -2
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +1 -2
- package/lib/cjs/components/Events/Events.js +4 -4
- package/lib/cjs/components/Events/Skeleton.js +1 -1
- package/lib/cjs/components/Feed/Feed.js +1 -1
- package/lib/cjs/components/Feed/Skeleton.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js +2 -3
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +1 -2
- package/lib/cjs/components/FeedObject/Poll/Choice/Choice.js +1 -2
- package/lib/cjs/components/FollowUserButton/FollowUserButton.js +1 -2
- package/lib/cjs/components/FriendshipUserButton/FriendshipUserButton.js +2 -3
- package/lib/cjs/components/GroupForm/GroupForm.js +1 -2
- package/lib/cjs/components/GroupInviteButton/GroupInviteButton.js +1 -2
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +3 -4
- package/lib/cjs/components/Groups/Groups.js +2 -2
- package/lib/cjs/components/Groups/Skeleton.js +1 -1
- package/lib/cjs/components/IncubatorListWidget/CreateIncubatorDialog/CreateIncubatorDialog.js +2 -3
- package/lib/cjs/components/IncubatorSubscribeButton/IncubatorSubscribeButton.js +3 -4
- package/lib/cjs/components/InviteUserEventButton/InviteUserEventButton.js +1 -2
- package/lib/cjs/components/LessonAppbar/LessonAppbar.js +3 -4
- package/lib/cjs/components/LessonEditForm/LessonEditForm.js +1 -2
- package/lib/cjs/components/LessonReleaseMenu/LessonReleaseMenu.js +3 -3
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +1 -2
- package/lib/cjs/components/Notification/Course/Course.js +1 -6
- package/lib/cjs/components/Notification/Event/Event.js +3 -8
- package/lib/cjs/components/Notification/Group/Group.js +1 -2
- package/lib/cjs/components/Notification/LiveStream/LiveStream.js +1 -6
- package/lib/cjs/components/Notification/Notification.js +13 -5
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js +1 -2
- package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/Appearance.js +3 -4
- package/lib/cjs/components/PaymentOrders/PaymentOrders.js +5 -6
- package/lib/cjs/components/PaymentProducts/Skeleton.js +1 -1
- package/lib/cjs/components/Paywalls/Skeleton.js +1 -1
- package/lib/cjs/components/PaywallsConfigurator/Skeleton.js +1 -1
- package/lib/cjs/components/PdfPreviewDialog/PdfPreviewDialog.js +1 -1
- package/lib/cjs/components/PlatformWidget/Skeleton.js +1 -1
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +2 -2
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.js +1 -1
- package/lib/cjs/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +2 -4
- package/lib/cjs/components/UserBillingInfo/Skeleton.js +1 -1
- package/lib/cjs/components/UserBillingInfo/UserBillingInfo.js +8 -9
- package/lib/cjs/components/UserChangeAddressDialog/UserChangeAddressDialog.js +1 -2
- package/lib/cjs/components/UserProfileBlocked/UserProfileBlocked.js +1 -2
- package/lib/cjs/components/UserProfileEdit/Section/AccountCredentials.js +1 -2
- package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.js +4 -5
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.d.ts +2 -2
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js +4 -5
- package/lib/cjs/components/VoteButton/VoteButton.d.ts +2 -2
- package/lib/cjs/components/VoteButton/VoteButton.js +2 -3
- package/lib/cjs/shared/AddUsersButton/AddUsersButton.js +1 -2
- package/lib/cjs/shared/ConfirmDialog/ConfirmDialog.js +1 -2
- package/lib/cjs/shared/CourseUsersTable/ChangeUsersStatus.js +1 -2
- package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.js +2 -3
- package/lib/cjs/shared/CourseUsersTable/RemoveButton.js +1 -2
- package/lib/cjs/shared/CourseUsersTable/RequestButton.js +1 -2
- package/lib/cjs/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +3 -4
- package/lib/cjs/shared/Media/File/DisplayComponent.js +2 -2
- package/lib/cjs/shared/ScrollContainer/index.js +2 -2
- package/lib/cjs/shared/VirtualizedScroller/VirtualizedScroller.d.ts +1 -1
- package/lib/esm/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +2 -3
- package/lib/esm/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +2 -3
- package/lib/esm/components/AccountDataPortability/AccountDataPortability.js +5 -10
- package/lib/esm/components/AccountDelete/AccountDelete.js +3 -10
- package/lib/esm/components/BuyButton/BuyButton.js +2 -3
- package/lib/esm/components/Categories/Categories.js +1 -1
- package/lib/esm/components/Categories/Skeleton.js +1 -1
- package/lib/esm/components/CategoryFollowButton/CategoryFollowButton.js +4 -5
- package/lib/esm/components/ChangeGroupCover/ChangeGroupCover.js +2 -3
- package/lib/esm/components/ChangeGroupPicture/ChangeGroupPicture.js +2 -3
- package/lib/esm/components/Checkout/Skeleton.js +1 -1
- package/lib/esm/components/CommentObjectReply/CommentObjectReply.js +2 -3
- package/lib/esm/components/CommunityPaywalls/CommunityPaywalls.js +1 -1
- package/lib/esm/components/Composer/Composer.js +2 -3
- package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.js +4 -4
- package/lib/esm/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +6 -6
- package/lib/esm/components/CourseDashboard/Student/ActionButton.d.ts +1 -2
- package/lib/esm/components/CourseDashboard/Student/ActionButton.js +1 -2
- package/lib/esm/components/CourseDashboard/Teacher/Comments.js +1 -2
- package/lib/esm/components/CourseForm/CourseForm.js +2 -3
- package/lib/esm/components/CourseForm/UploadCourseCover.js +2 -3
- package/lib/esm/components/CourseJoinButton/CourseJoinButton.js +4 -5
- package/lib/esm/components/Courses/Courses.js +3 -3
- package/lib/esm/components/Courses/Skeleton.js +1 -1
- package/lib/esm/components/CreatePaymentProductForm/CreatePaymentProductForm.js +1 -2
- package/lib/esm/components/EditCourse/Lessons/ChangeLessonStatus.js +3 -4
- package/lib/esm/components/EditCourse/Lessons/FieldName.js +2 -3
- package/lib/esm/components/EditCourse/Options.js +2 -3
- package/lib/esm/components/EventForm/EventForm.js +6 -7
- package/lib/esm/components/EventForm/UploadEventCover.js +2 -3
- package/lib/esm/components/EventInviteButton/EventInviteButton.js +1 -2
- package/lib/esm/components/EventMediaWidget/EventMediaWidget.js +1 -2
- package/lib/esm/components/EventMediaWidget/TriggerButton.d.ts +2 -2
- package/lib/esm/components/EventMediaWidget/TriggerButton.js +2 -3
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +1 -2
- package/lib/esm/components/Events/Events.js +4 -4
- package/lib/esm/components/Events/Skeleton.js +1 -1
- package/lib/esm/components/Feed/Feed.js +1 -1
- package/lib/esm/components/Feed/Skeleton.js +1 -1
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.js +3 -4
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +1 -2
- package/lib/esm/components/FeedObject/Poll/Choice/Choice.js +2 -3
- package/lib/esm/components/FollowUserButton/FollowUserButton.js +2 -3
- package/lib/esm/components/FriendshipUserButton/FriendshipUserButton.js +3 -4
- package/lib/esm/components/GroupForm/GroupForm.js +2 -3
- package/lib/esm/components/GroupInviteButton/GroupInviteButton.js +1 -2
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +4 -5
- package/lib/esm/components/Groups/Groups.js +2 -2
- package/lib/esm/components/Groups/Skeleton.js +1 -1
- package/lib/esm/components/IncubatorListWidget/CreateIncubatorDialog/CreateIncubatorDialog.js +3 -4
- package/lib/esm/components/IncubatorSubscribeButton/IncubatorSubscribeButton.js +4 -5
- package/lib/esm/components/InviteUserEventButton/InviteUserEventButton.js +2 -3
- package/lib/esm/components/LessonAppbar/LessonAppbar.js +4 -5
- package/lib/esm/components/LessonEditForm/LessonEditForm.js +2 -3
- package/lib/esm/components/LessonReleaseMenu/LessonReleaseMenu.js +3 -3
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +2 -3
- package/lib/esm/components/Notification/Course/Course.js +2 -7
- package/lib/esm/components/Notification/Event/Event.js +4 -9
- package/lib/esm/components/Notification/Group/Group.js +2 -3
- package/lib/esm/components/Notification/LiveStream/LiveStream.js +2 -7
- package/lib/esm/components/Notification/Notification.js +14 -6
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js +2 -3
- package/lib/esm/components/OnBoardingWidget/Steps/Appearance/Appearance.js +3 -4
- package/lib/esm/components/PaymentOrders/PaymentOrders.js +5 -6
- package/lib/esm/components/PaymentProducts/Skeleton.js +1 -1
- package/lib/esm/components/Paywalls/Skeleton.js +1 -1
- package/lib/esm/components/PaywallsConfigurator/Skeleton.js +1 -1
- package/lib/esm/components/PdfPreviewDialog/PdfPreviewDialog.js +1 -1
- package/lib/esm/components/PlatformWidget/Skeleton.js +1 -1
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +2 -2
- package/lib/esm/components/PrivateMessageComponent/Skeleton.js +1 -1
- package/lib/esm/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +2 -4
- package/lib/esm/components/UserBillingInfo/Skeleton.js +1 -1
- package/lib/esm/components/UserBillingInfo/UserBillingInfo.js +8 -9
- package/lib/esm/components/UserChangeAddressDialog/UserChangeAddressDialog.js +1 -2
- package/lib/esm/components/UserProfileBlocked/UserProfileBlocked.js +2 -3
- package/lib/esm/components/UserProfileEdit/Section/AccountCredentials.js +1 -2
- package/lib/esm/components/UserProfileEdit/Section/PublicInfo.js +5 -6
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.d.ts +2 -2
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js +5 -6
- package/lib/esm/components/VoteButton/VoteButton.d.ts +2 -2
- package/lib/esm/components/VoteButton/VoteButton.js +3 -4
- package/lib/esm/shared/AddUsersButton/AddUsersButton.js +1 -2
- package/lib/esm/shared/ConfirmDialog/ConfirmDialog.js +1 -2
- package/lib/esm/shared/CourseUsersTable/ChangeUsersStatus.js +2 -3
- package/lib/esm/shared/CourseUsersTable/CourseUsersTable.js +3 -4
- package/lib/esm/shared/CourseUsersTable/RemoveButton.js +2 -3
- package/lib/esm/shared/CourseUsersTable/RequestButton.js +2 -3
- package/lib/esm/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +3 -4
- package/lib/esm/shared/Media/File/DisplayComponent.js +2 -2
- package/lib/esm/shared/ScrollContainer/index.js +1 -1
- package/lib/esm/shared/VirtualizedScroller/VirtualizedScroller.d.ts +1 -1
- package/lib/umd/484.js +2 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +14 -14
- package/lib/umd/54.js +0 -2
- /package/lib/umd/{54.js.LICENSE.txt → 484.js.LICENSE.txt} +0 -0
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Icon, MenuItem, Select, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
2
|
+
import { Box, Button, Icon, MenuItem, Select, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
3
3
|
import { Fragment, memo, useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl';
|
|
5
5
|
import { PREFIX } from '../constants';
|
|
6
6
|
import MenuRow from '../MenuRow';
|
|
7
7
|
import { Logger } from '@selfcommunity/utils';
|
|
8
8
|
import { SCOPE_SC_UI } from '../../../constants/Errors';
|
|
9
|
-
import { LoadingButton } from '@mui/lab';
|
|
10
9
|
import { useSnackbar } from 'notistack';
|
|
11
10
|
import { SCCourseLessonStatusType } from '@selfcommunity/types';
|
|
12
11
|
import { CourseService } from '@selfcommunity/api-services';
|
|
@@ -74,12 +73,12 @@ function ChangeLessonStatus(props) {
|
|
|
74
73
|
handleAction(newValue);
|
|
75
74
|
}
|
|
76
75
|
}, [handleAction, value]);
|
|
77
|
-
return (_jsx(Fragment, { children: isMobile ? (_jsx(MenuRow, Object.assign({ buttonClassName: hasPublished ? classes.changeLessonStatusPublishedWrapper : undefined, icon: icon }, { children: OPTIONS.map((option, i) => (_jsx(MenuItem, { children: _jsx(
|
|
76
|
+
return (_jsx(Fragment, { children: isMobile ? (_jsx(MenuRow, Object.assign({ buttonClassName: hasPublished ? classes.changeLessonStatusPublishedWrapper : undefined, icon: icon }, { children: OPTIONS.map((option, i) => (_jsx(MenuItem, { children: _jsx(Button, Object.assign({ size: "small", color: "inherit", onClick: handleClick, loading: loading, disabled: loading, "data-value": option.value, sx: {
|
|
78
77
|
padding: 0,
|
|
79
78
|
':hover': {
|
|
80
79
|
backgroundColor: 'unset'
|
|
81
80
|
}
|
|
82
|
-
} }, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: option.id, defaultMessage: option.id }) })) })) }, i))) }))) : (_jsx(Select, Object.assign({ className: hasPublished ? classes.changeLessonStatusPublishedWrapper : undefined, size: "small", value: value, onChange: handleChange, disabled: disabled }, { children: OPTIONS.map((option, i) => (_jsx(MenuItem, Object.assign({ value: option.value }, { children: _jsx(
|
|
81
|
+
} }, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: option.id, defaultMessage: option.id }) })) })) }, i))) }))) : (_jsx(Select, Object.assign({ className: hasPublished ? classes.changeLessonStatusPublishedWrapper : undefined, size: "small", value: value, onChange: handleChange, disabled: disabled }, { children: OPTIONS.map((option, i) => (_jsx(MenuItem, Object.assign({ value: option.value }, { children: _jsx(Button, Object.assign({ size: "small", color: "inherit", loading: loading, disabled: loading, sx: {
|
|
83
82
|
padding: 0,
|
|
84
83
|
':hover': {
|
|
85
84
|
backgroundColor: 'unset'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { debounce, Icon, IconButton, Stack, TextField, Typography } from '@mui/material';
|
|
2
|
+
import { Button, debounce, Icon, IconButton, Stack, TextField, Typography } from '@mui/material';
|
|
4
3
|
import { Fragment, memo, useCallback, useState } from 'react';
|
|
5
4
|
import { PREFIX } from '../constants';
|
|
6
5
|
import { Logger } from '@selfcommunity/utils';
|
|
@@ -75,6 +74,6 @@ function FieldName(props) {
|
|
|
75
74
|
handleDisableEditMode();
|
|
76
75
|
}
|
|
77
76
|
}, [row, isNewRow, handleManageRow, setName, handleDisableEditMode]);
|
|
78
|
-
return (_jsx(Fragment, { children: isNewRow || editMode ? (_jsxs(Stack, Object.assign({ className: classes.editModeWrapper }, { children: [_jsx(TextField, { type: "text", variant: "outlined", size: "small", focused: true, autoFocus: true, defaultValue: row.name, onChange: handleChange }), _jsx(
|
|
77
|
+
return (_jsx(Fragment, { children: isNewRow || editMode ? (_jsxs(Stack, Object.assign({ className: classes.editModeWrapper }, { children: [_jsx(TextField, { type: "text", variant: "outlined", size: "small", focused: true, autoFocus: true, defaultValue: row.name, onChange: handleChange }), _jsx(Button, Object.assign({ size: "small", color: "primary", variant: "outlined", onClick: handleSubmit, loading: loading, disabled: loading, className: classes.editModeSaveButton }, { children: _jsx(Icon, { children: "check" }) })), _jsx(IconButton, Object.assign({ color: "default", size: "small", onClick: handleClose, className: classes.editModeCloseButton }, { children: _jsx(Icon, { children: "close" }) }))] }))) : (_jsx(Typography, Object.assign({ variant: "body1" }, { children: row.name }))) }));
|
|
79
78
|
}
|
|
80
79
|
export default memo(FieldName);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Stack, Typography } from '@mui/material';
|
|
2
|
+
import { Box, Button, Stack, Typography } from '@mui/material';
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
import { PREFIX } from './constants';
|
|
5
5
|
import { memo, useCallback, useState } from 'react';
|
|
@@ -8,7 +8,6 @@ import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
|
8
8
|
import { useSnackbar } from 'notistack';
|
|
9
9
|
import SwitchForm from './Options/SwitchForm';
|
|
10
10
|
import useDeepCompareEffect from 'use-deep-compare-effect';
|
|
11
|
-
import { LoadingButton } from '@mui/lab';
|
|
12
11
|
import { CourseService } from '@selfcommunity/api-services';
|
|
13
12
|
const classes = {
|
|
14
13
|
optionsContainer: `${PREFIX}-options-container`,
|
|
@@ -88,6 +87,6 @@ function Options(props) {
|
|
|
88
87
|
});
|
|
89
88
|
});
|
|
90
89
|
}, [course, tempOptions, setCanSave, setLoading]);
|
|
91
|
-
return (_jsxs(Box, Object.assign({ className: classes.optionsContainer }, { children: [_jsx(Stack, Object.assign({ className: classes.optionsWrapper }, { children: Object.entries(OPTIONS).map(([key, value], i) => (_jsx(SwitchForm, { name: key, title: value.title, description: value.description, checked: course[key], handleChangeOptions: handleChange }, i))) })), _jsx(Stack, Object.assign({ className: classes.optionsButtonWrapper }, { children: _jsx(
|
|
90
|
+
return (_jsxs(Box, Object.assign({ className: classes.optionsContainer }, { children: [_jsx(Stack, Object.assign({ className: classes.optionsWrapper }, { children: Object.entries(OPTIONS).map(([key, value], i) => (_jsx(SwitchForm, { name: key, title: value.title, description: value.description, checked: course[key], handleChangeOptions: handleChange }, i))) })), _jsx(Stack, Object.assign({ className: classes.optionsButtonWrapper }, { children: _jsx(Button, Object.assign({ size: "small", variant: "contained", disabled: !canSave, onClick: handleSubmit, loading: loading }, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.editCourse.tab.options.button.save", defaultMessage: "ui.editCourse.tab.options.button.save" }) })) })) }))] })));
|
|
92
91
|
}
|
|
93
92
|
export default memo(Options);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { Alert, Box, FormControl, FormGroup, Icon, IconButton, InputAdornment, InputLabel, MenuItem, Paper, Select, Stack, Switch, TextField, Typography, styled } from '@mui/material';
|
|
3
|
+
import { Alert, Box, Button, FormControl, FormGroup, Icon, IconButton, InputAdornment, InputLabel, MenuItem, Paper, Select, Stack, Switch, TextField, Typography, styled } from '@mui/material';
|
|
5
4
|
import { useThemeProps } from '@mui/system';
|
|
6
5
|
import { LocalizationProvider, MobileDatePicker, MobileTimePicker } from '@mui/x-date-pickers';
|
|
7
6
|
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
|
@@ -10,8 +9,8 @@ import { SCPreferences, UserUtils, useSCContext, useSCPaymentsEnabled, useSCPref
|
|
|
10
9
|
import { SCContentType, SCEventLocationType, SCEventPrivacyType, SCEventRecurrenceType, SCFeatureName } from '@selfcommunity/types';
|
|
11
10
|
import { Logger } from '@selfcommunity/utils';
|
|
12
11
|
import classNames from 'classnames';
|
|
13
|
-
import
|
|
14
|
-
import
|
|
12
|
+
import { it } from 'date-fns/locale/it';
|
|
13
|
+
import { enUS } from 'date-fns/locale/en-US';
|
|
15
14
|
import PubSub from 'pubsub-js';
|
|
16
15
|
import { useCallback, useMemo, useState } from 'react';
|
|
17
16
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
@@ -374,7 +373,7 @@ export default function EventForm(inProps) {
|
|
|
374
373
|
input: {
|
|
375
374
|
endAdornment: _jsx(Typography, Object.assign({ variant: "body2" }, { children: EVENT_TITLE_MAX_LENGTH - field.name.length }))
|
|
376
375
|
}
|
|
377
|
-
}, error: Boolean(field.name.length > EVENT_TITLE_MAX_LENGTH) || Boolean(error['nameError']), helperText: field.name.length > EVENT_TITLE_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.eventForm.name.error.maxLength", defaultMessage: "ui.eventForm.name.error.maxLength" })) : error['nameError'] ? (error['nameError']) : null }), _jsx(Box, Object.assign({ className: classes.dateTime }, { children: _jsxs(LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ?
|
|
376
|
+
}, error: Boolean(field.name.length > EVENT_TITLE_MAX_LENGTH) || Boolean(error['nameError']), helperText: field.name.length > EVENT_TITLE_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.eventForm.name.error.maxLength", defaultMessage: "ui.eventForm.name.error.maxLength" })) : error['nameError'] ? (error['nameError']) : null }), _jsx(Box, Object.assign({ className: classes.dateTime }, { children: _jsxs(LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ? it : enUS, localeText: {
|
|
378
377
|
cancelButtonLabel: `${intl.formatMessage(messages.pickerCancelAction)}`
|
|
379
378
|
} }, { children: [_jsx(MobileDatePicker, { className: classes.picker, disablePast: !event, minDate: minStartDate, label: field.startDate && _jsx(FormattedMessage, { id: "ui.eventForm.date.placeholder", defaultMessage: "ui.eventForm.date.placeholder" }), value: field.startDate, slots: {
|
|
380
379
|
textField: (params) => (_jsx(TextField, Object.assign({}, params, { slotProps: {
|
|
@@ -407,7 +406,7 @@ export default function EventForm(inProps) {
|
|
|
407
406
|
return _jsx("em", { children: `${intl.formatMessage(messages.frequencyPlaceholder)}` });
|
|
408
407
|
}
|
|
409
408
|
return (_jsx(FormattedMessage, { id: `ui.eventForm.frequency.${selected}.placeholder`, defaultMessage: `ui.eventForm.frequency.${selected}.placeholder` }));
|
|
410
|
-
}, startAdornment: _jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(IconButton, { children: _jsx(Icon, { children: "frequency" }) }) })) }, { children: Object.values(SCEventRecurrenceType).map((f) => (_jsx(MenuItem, Object.assign({ value: f }, { children: _jsx(FormattedMessage, { id: `ui.eventForm.frequency.${f}.placeholder`, defaultMessage: `ui.eventForm.frequency.${f}.placeholder` }) }), f))) }))] })), _jsx(Box, Object.assign({ className: classes.dateTime }, { children: _jsxs(LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ?
|
|
409
|
+
}, startAdornment: _jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(IconButton, { children: _jsx(Icon, { children: "frequency" }) }) })) }, { children: Object.values(SCEventRecurrenceType).map((f) => (_jsx(MenuItem, Object.assign({ value: f }, { children: _jsx(FormattedMessage, { id: `ui.eventForm.frequency.${f}.placeholder`, defaultMessage: `ui.eventForm.frequency.${f}.placeholder` }) }), f))) }))] })), _jsx(Box, Object.assign({ className: classes.dateTime }, { children: _jsxs(LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ? it : enUS, localeText: {
|
|
411
410
|
cancelButtonLabel: `${intl.formatMessage(messages.pickerCancelAction)}`
|
|
412
411
|
} }, { children: [_jsx(MobileDatePicker, { className: classes.picker, minDate: field.startDate, label: _jsx(FormattedMessage, { id: "ui.eventForm.date.end.placeholder", defaultMessage: "ui.eventForm.date.end.placeholder" }), value: field.endDate, slots: {
|
|
413
412
|
textField: (params) => (_jsx(TextField, Object.assign({}, params, { slotProps: {
|
|
@@ -449,7 +448,7 @@ export default function EventForm(inProps) {
|
|
|
449
448
|
input: {
|
|
450
449
|
endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_f = field.description) === null || _f === void 0 ? void 0 : _f.length) ? EVENT_DESCRIPTION_MAX_LENGTH - field.description.length : EVENT_DESCRIPTION_MAX_LENGTH })))
|
|
451
450
|
}
|
|
452
|
-
}, error: Boolean(((_g = field.description) === null || _g === void 0 ? void 0 : _g.length) > EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_h = field.description) === null || _h === void 0 ? void 0 : _h.length) > EVENT_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null }), isPaymentsEnabled && isStaff && (_jsx(Box, Object.assign({ className: classes.paywallsConfiguratorWrap }, { children: _jsx(PaywallsConfigurator, Object.assign({}, (event && { contentId: event.id }), { contentType: SCContentType.EVENT, onChangeContentAccessType: handleChangeContentAccessType, onChangePaymentProducts: handleChangePaymentsProducts })) }))), genericError && (_jsx(Box, Object.assign({ className: classes.genericError }, { children: _jsx(Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), _jsx(Box, Object.assign({ className: classes.actions }, { children: _jsx(
|
|
451
|
+
}, error: Boolean(((_g = field.description) === null || _g === void 0 ? void 0 : _g.length) > EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_h = field.description) === null || _h === void 0 ? void 0 : _h.length) > EVENT_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null }), isPaymentsEnabled && isStaff && (_jsx(Box, Object.assign({ className: classes.paywallsConfiguratorWrap }, { children: _jsx(PaywallsConfigurator, Object.assign({}, (event && { contentId: event.id }), { contentType: SCContentType.EVENT, onChangeContentAccessType: handleChangeContentAccessType, onChangePaymentProducts: handleChangePaymentsProducts })) }))), genericError && (_jsx(Box, Object.assign({ className: classes.genericError }, { children: _jsx(Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), _jsx(Box, Object.assign({ className: classes.actions }, { children: _jsx(Button, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
|
|
453
452
|
!field.startDate ||
|
|
454
453
|
!field.startTime ||
|
|
455
454
|
!field.endDate ||
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useRef, useState } from 'react';
|
|
4
|
-
import { Alert, styled, Icon } from '@mui/material';
|
|
4
|
+
import { Alert, styled, Icon, Button } from '@mui/material';
|
|
5
5
|
import { SCUserContext } from '@selfcommunity/react-core';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { useThemeProps } from '@mui/system';
|
|
8
8
|
import { PREFIX } from './constants';
|
|
9
|
-
import { LoadingButton } from '@mui/lab';
|
|
10
9
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
11
10
|
import { EventService } from '@selfcommunity/api-services';
|
|
12
11
|
import { Logger } from '@selfcommunity/utils';
|
|
@@ -20,7 +19,7 @@ const messages = defineMessages({
|
|
|
20
19
|
const classes = {
|
|
21
20
|
root: `${PREFIX}-upload-event-cover-root`
|
|
22
21
|
};
|
|
23
|
-
const Root = styled(
|
|
22
|
+
const Root = styled(Button, {
|
|
24
23
|
name: PREFIX,
|
|
25
24
|
slot: 'UploadEventCoverRoot'
|
|
26
25
|
})(() => ({}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { LoadingButton } from '@mui/lab';
|
|
4
3
|
import { Avatar, Box, Button, Chip, Icon, IconButton, InputAdornment, TextField, Typography, styled, Autocomplete } from '@mui/material';
|
|
5
4
|
import { useThemeProps } from '@mui/system';
|
|
6
5
|
import { EventService } from '@selfcommunity/api-services';
|
|
@@ -242,7 +241,7 @@ export default function EventInviteButton(inProps) {
|
|
|
242
241
|
/**
|
|
243
242
|
* Renders root object
|
|
244
243
|
*/
|
|
245
|
-
return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClose, variant: scEvent ? 'contained' : 'outlined', color: scEvent ? 'secondary' : 'inherit', startIcon: _jsx(Icon, { children: "add" }) }, rest, { children: _jsx(FormattedMessage, { id: "ui.eventInviteButton", defaultMessage: "ui.eventInviteButton" }) })), open && (_jsx(DialogRoot, Object.assign({ DialogContentProps: { dividers: false }, open: true, className: classes.dialogRoot, title: _jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ onClick: handleClose }, { children: _jsx(Icon, { children: "close" }) })), _jsx(Typography, Object.assign({ className: classes.dialogTitle }, { children: _jsx(FormattedMessage, { id: "ui.eventInviteButton.dialog.title", defaultMessage: "ui.eventInviteButton.dialog.title" }) })), _jsx(
|
|
244
|
+
return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClose, variant: scEvent ? 'contained' : 'outlined', color: scEvent ? 'secondary' : 'inherit', startIcon: _jsx(Icon, { children: "add" }) }, rest, { children: _jsx(FormattedMessage, { id: "ui.eventInviteButton", defaultMessage: "ui.eventInviteButton" }) })), open && (_jsx(DialogRoot, Object.assign({ DialogContentProps: { dividers: false }, open: true, className: classes.dialogRoot, title: _jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ onClick: handleClose }, { children: _jsx(Icon, { children: "close" }) })), _jsx(Typography, Object.assign({ className: classes.dialogTitle }, { children: _jsx(FormattedMessage, { id: "ui.eventInviteButton.dialog.title", defaultMessage: "ui.eventInviteButton.dialog.title" }) })), _jsx(Button, Object.assign({ size: "small", color: "secondary", variant: "contained", onClick: handleSendInvitations, loading: isSending, disabled: !invited.length }, { children: _jsx(FormattedMessage, { id: "ui.eventInviteButton.dialog.button.end", defaultMessage: "ui.eventInviteButton.dialog.button.end" }) }))] }) }, { children: _jsxs(Box, Object.assign({ className: classes.dialogContent }, { children: [_jsx(Autocomplete, { className: classes.autocomplete, loading: loading, size: "small", multiple: true, freeSolo: true, disableClearable: true, options: suggested, onChange: handleChange, onInputChange: handleInputChange, inputValue: value, filterOptions: filterOptions, value: invited, getOptionLabel: (option) => (option ? option.username : '...'), isOptionEqualToValue: (option, value) => (option ? value.id === option.id : false), renderTags: () => null, renderOption: (props, option) => (_jsxs(Box, Object.assign({ component: "li" }, props, { children: [_jsx(Avatar, { alt: option.username, src: option.avatar }), _jsx(Typography, Object.assign({ ml: 1 }, { children: option.username }))] }))), renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { variant: "outlined", placeholder: `${intl.formatMessage(messages.placeholder)}`, slotProps: {
|
|
246
245
|
input: Object.assign(Object.assign({}, params.InputProps), { className: classes.input, startAdornment: (_jsxs(_Fragment, { children: [_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, Object.assign({ className: classes.icon }, { children: "search" })) })), params.InputProps.startAdornment] })) })
|
|
247
246
|
} }))) }), _jsx(Box, Object.assign({ className: classes.invitedBox }, { children: invited.map((option, index) => (_jsx(Chip, { avatar: _jsx(Avatar, { alt: option.username, src: option.avatar }), label: option.username, onDelete: () => {
|
|
248
247
|
handleDelete(option);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { LoadingButton } from '@mui/lab';
|
|
4
3
|
import { Button, CardActions, CardContent, CardHeader, Divider, Icon, Stack, Tooltip, Typography, useMediaQuery, useTheme, styled } from '@mui/material';
|
|
5
4
|
import { Box, useThemeProps } from '@mui/system';
|
|
6
5
|
import { Endpoints, EventService, http } from '@selfcommunity/api-services';
|
|
@@ -246,7 +245,7 @@ export default function EventMediaWidget(inProps) {
|
|
|
246
245
|
background: `url(${media.image}) no-repeat center`
|
|
247
246
|
}, className: classes.media }, { children: medias.length > array.length && i === array.length - 1 && (_jsxs(Fragment, { children: [_jsx(Box, { className: classes.mediaLayer }), _jsx(Box, Object.assign({ className: classes.countHiddenMediaWrapper }, { children: _jsxs(Typography, Object.assign({ className: classes.countHiddenMedia }, { children: ["+", countHiddenMedia] })) }))] })) }), media.id))), hasAllow && mediasCount === 0 && (_jsx(Tooltip, Object.assign({ title: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.add", defaultMessage: "ui.eventMediaWidget.add" }) }, { children: _jsx(TriggerButton, { size: "large", onAdd: handleAddMedia, isSquare: true }) })))] })), preview !== -1 && _jsx(Lightbox, { onClose: handleCloseLightbox, index: preview, medias: medias, onIndexChange: _fetchNext })] })), hasAllow && mediasCount > 0 && (_jsx(CardActions, Object.assign({ className: classes.actions }, { children: _jsx(Button, Object.assign({ onClick: handleToggleDialogOpen }, { children: _jsx(Typography, Object.assign({ variant: "caption" }, { children: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.showAll", defaultMessage: "ui.eventMediaWidget.showAll" }) })) })) }))), openDialog && (_jsx(DialogRoot, Object.assign({ className: classes.dialogRoot, title: intl.formatMessage(messages.title, { user: scEvent.managed_by.username }), onClose: handleToggleDialogOpen, open: true }, dialogProps, { children: _jsx(InfiniteScroll, Object.assign({ dataLength: medias.length, height: isMobile ? '100%' : '515px', next: handleNext, hasMoreNext: Boolean(state.next), className: classes.dialogInfiniteScroll, endMessage: _jsx(Typography, Object.assign({ className: classes.endMessage }, { children: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.noMoreResults", defaultMessage: "ui.eventMediaWidget.noMoreResults" }) })) }, { children: _jsxs(Box, Object.assign({ className: classes.grid }, { children: [medias.map((media) => (_jsx(Box, Object.assign({ sx: {
|
|
248
247
|
background: `url(${media.image}) no-repeat center`
|
|
249
|
-
}, className: classes.dialogMediaWrapper }, { children: _jsx(Stack, Object.assign({ className: classes.dialogButtonWrapper }, { children: _jsx(
|
|
248
|
+
}, className: classes.dialogMediaWrapper }, { children: _jsx(Stack, Object.assign({ className: classes.dialogButtonWrapper }, { children: _jsx(Button, Object.assign({ className: classes.dialogLoadingButton, loading: mediaId === media.id, size: "large", onClick: () => handleRemoveMedia(media.id), sx: {
|
|
250
249
|
color: (theme) => (mediaId === media.id ? 'transparent' : theme.palette.common.white)
|
|
251
250
|
} }, { children: _jsx(Icon, Object.assign({ fontSize: "inherit" }, { children: "delete" })) })) })) }), media.id))), showSkeleton === 'dialog' && Array.from(Array(countHiddenMedia)).map((_, i) => _jsx(EventMediaSkeleton, {}, i))] })) })) }))), openDialogConfirm && (_jsx(ConfirmDialog, { open: true, title: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.dialog.title", defaultMessage: "ui.eventMediaWidget.dialog.title" }), content: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.dialog.msg", defaultMessage: "ui.eventMediaWidget.dialog.msg" }), btnConfirm: _jsx(FormattedMessage, { id: "ui.eventMediaWidget.dialog.confirm", defaultMessage: "ui.eventMediaWidget.dialog.confirm" }), isUpdating: loading, onConfirm: handleConfirmAction, onClose: handleCloseAction }))] })));
|
|
252
251
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ButtonProps } from '@mui/material';
|
|
3
3
|
import { SCMediaType } from '@selfcommunity/types';
|
|
4
|
-
export interface TriggerIconButtonProps extends
|
|
4
|
+
export interface TriggerIconButtonProps extends ButtonProps {
|
|
5
5
|
/**
|
|
6
6
|
* Callback triggered when a media is added
|
|
7
7
|
* @param media
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { Stack, Typography, Icon, styled } from '@mui/material';
|
|
3
|
+
import { Stack, Typography, Icon, styled, Button } from '@mui/material';
|
|
5
4
|
import ChunkedUploady from '@rpldy/chunked-uploady';
|
|
6
5
|
import { Endpoints } from '@selfcommunity/api-services';
|
|
7
6
|
import classNames from 'classnames';
|
|
@@ -16,7 +15,7 @@ const classes = {
|
|
|
16
15
|
triggerContent: `${PREFIX}-trigger-content`,
|
|
17
16
|
triggerIcon: `${PREFIX}-trigger-icon`
|
|
18
17
|
};
|
|
19
|
-
const Root = styled(
|
|
18
|
+
const Root = styled(Button, {
|
|
20
19
|
name: PREFIX,
|
|
21
20
|
slot: 'TriggerRoot',
|
|
22
21
|
overridesResolver: (_props, styles) => styles.triggerRoot,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { LoadingButton } from '@mui/lab';
|
|
4
3
|
import { Box, Button, Checkbox, CircularProgress, FormControlLabel, Icon, Menu, MenuItem, SwipeableDrawer, useMediaQuery, useTheme, styled } from '@mui/material';
|
|
5
4
|
import { useThemeProps } from '@mui/system';
|
|
6
5
|
import { useSCContext, useSCFetchEvent, useSCPaymentsEnabled, useSCUser } from '@selfcommunity/react-core';
|
|
@@ -34,7 +33,7 @@ const options = [
|
|
|
34
33
|
label: _jsx(FormattedMessage, { id: "ui.eventSubscribeButton.notGoing", defaultMessage: "ui.eventSubscribeButton.notGoing" })
|
|
35
34
|
}
|
|
36
35
|
];
|
|
37
|
-
const RequestRoot = styled(
|
|
36
|
+
const RequestRoot = styled(Button, {
|
|
38
37
|
name: PREFIX,
|
|
39
38
|
slot: 'RequestRoot'
|
|
40
39
|
})(() => ({}));
|
|
@@ -222,7 +222,7 @@ export default function Events(inProps) {
|
|
|
222
222
|
*/
|
|
223
223
|
const content = (_jsxs(_Fragment, { children: [showFilters && (_jsx(Grid, Object.assign({ container: true, width: "100%", className: classes.filters, gap: 2 }, { children: filters ? (filters) : showUserEvents ? (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(EventsChipRoot, { color: showMyEvents ? 'secondary' : 'default', variant: showMyEvents ? 'filled' : 'outlined', label: _jsx(FormattedMessage, { id: "ui.events.filterByCreatedByMe", defaultMessage: "ui.events.filterByCreatedByMe" }), onClick: () => setShowMyEvents(!showMyEvents),
|
|
224
224
|
// @ts-expect-error this is needed to use showFollowed into SCEvents
|
|
225
|
-
showFollowed: showMyEvents, deleteIcon: showMyEvents ? _jsx(Icon, { children: "close" }) : null, onDelete: showMyEvents ? () => setShowMyEvents(false) : null, disabled: loading }) })), _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(PastEventsFilter, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, disabled: loading }) })), _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(LocationEventsFilter, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) }))] })) : general ? (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ size: { md: 3 } }, { children: _jsx(TextField, { className: classes.search, size: "small", fullWidth: true, value: query, label: _jsx(FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
|
|
225
|
+
showFollowed: showMyEvents, deleteIcon: showMyEvents ? _jsx(Icon, { children: "close" }) : null, onDelete: showMyEvents ? () => setShowMyEvents(false) : null, disabled: loading }) })), _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(PastEventsFilter, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, disabled: loading }) })), _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(LocationEventsFilter, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) }))] })) : general ? (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ size: { xs: 12, md: 3 } }, { children: _jsx(TextField, { className: classes.search, size: "small", fullWidth: true, value: query, label: _jsx(FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
|
|
226
226
|
e.preventDefault();
|
|
227
227
|
if (e.key === 'Enter') {
|
|
228
228
|
fetchEvents();
|
|
@@ -231,13 +231,13 @@ export default function Events(inProps) {
|
|
|
231
231
|
input: {
|
|
232
232
|
endAdornment: (_jsx(InputAdornment, Object.assign({ position: "end" }, { children: isMobile ? (_jsx(IconButton, Object.assign({ onClick: () => fetchEvents(), disabled: loading }, { children: _jsx(Icon, { children: "search" }) }))) : (_jsx(Button, { size: "small", variant: "contained", color: "secondary", onClick: () => fetchEvents(), endIcon: _jsx(Icon, { children: "search" }), disabled: loading })) })))
|
|
233
233
|
}
|
|
234
|
-
} }) })), _jsx(Grid, Object.assign({ size: { md: 2 } }, { children: _jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [_jsx(InputLabel, { children: _jsx(FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), _jsx(Select, Object.assign({ disabled: showOngoingEvents || loading, size: "small", label: _jsx(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) => (_jsxs(MenuItem, Object.assign({ value: option.value }, { children: [_jsx(Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", slotProps: {
|
|
234
|
+
} }) })), _jsx(Grid, Object.assign({ size: { xs: 12, md: 2 } }, { children: _jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [_jsx(InputLabel, { children: _jsx(FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), _jsx(Select, Object.assign({ disabled: showOngoingEvents || loading, size: "small", label: _jsx(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) => (_jsxs(MenuItem, Object.assign({ value: option.value }, { children: [_jsx(Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", slotProps: {
|
|
235
235
|
input: {
|
|
236
236
|
'aria-label': `${option.label}`
|
|
237
237
|
}
|
|
238
|
-
} }), option.label] }), option.value))) }))] })) })), _jsx(Grid, Object.assign({ size: { md: 2 } }, { children: _jsx(LocationEventsFilter, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) })), authUserId && (_jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(EventsChipRoot, { color: showFollowed ? 'secondary' : 'default', variant: showFollowed ? 'filled' : 'outlined', label: _jsx(FormattedMessage, { id: "ui.events.filterByFollowedInterest", defaultMessage: "ui.events.filterByFollowedInterest" }), onClick: handleChipClick,
|
|
238
|
+
} }), option.label] }), option.value))) }))] })) })), _jsx(Grid, Object.assign({ size: { xs: 12, md: 2 } }, { children: _jsx(LocationEventsFilter, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) })), authUserId && (_jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(EventsChipRoot, { color: showFollowed ? 'secondary' : 'default', variant: showFollowed ? 'filled' : 'outlined', label: _jsx(FormattedMessage, { id: "ui.events.filterByFollowedInterest", defaultMessage: "ui.events.filterByFollowedInterest" }), onClick: handleChipClick,
|
|
239
239
|
// @ts-expect-error this is needed to use showFollowed into SCEvents
|
|
240
|
-
showFollowed: showFollowed, deleteIcon: showFollowed ? _jsx(Icon, { children: "close" }) : null, onDelete: showFollowed ? handleDeleteClick : null, disabled: loading }) }))), _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(OngoingEventsFilter, { showOngoingEvents: showOngoingEvents, handleClick: handleChipOngoingClick, handleDeleteClick: handleDeleteOngoingClick, disabled: dateSearch !== SCEventDateFilterType.ALL || loading }) }))] })) : null }))), _jsx(_Fragment, { children: loading ? (_jsx(Skeleton, Object.assign({}, EventsSkeletonComponentProps, { EventSkeletonProps: EventSkeletonComponentProps }))) : (_jsx(_Fragment, { children: !events.length ? (_jsx(Box, Object.assign({ className: classes.noResults }, { children: general ? (_jsxs(_Fragment, { children: [_jsx(EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (onlyStaffEnabled && UserUtils.isStaff(scUserContext.user)) || !onlyStaffEnabled ? (_jsx(CreateEventButton, Object.assign({}, CreateEventButtonProps))) : null })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.events.noEvents.title", defaultMessage: "ui.events.noEvents.title" }) }))] })) : showUserEvents ? (_jsx(_Fragment, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.events.noEvents.title.personal", defaultMessage: "ui.events.noEvents.title.personal" }) })) })) : null }))) : (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 2 }, className: classes.events }, GridContainerComponentProps, { children: _jsxs(_Fragment, { children: [events.map((event) => (_jsx(Grid, Object.assign({ size: { md: 6 }, className: classes.item }, GridItemComponentProps, { children: _jsx(Event, Object.assign({ event: event, eventId: event.id }, EventComponentProps)) }), event.id))), authUserId && events.length % 2 !== 0 && (_jsx(Grid, Object.assign({ size: { md: 6 }, className: classes.itemSkeleton }, GridItemComponentProps, { children: _jsx(EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: _jsx(CreateEventButton, Object.assign({ variant: "outlined", color: "primary", size: "small" }, CreateEventButtonProps, { children: _jsx(FormattedMessage, { id: "ui.events.skeleton.action.add", defaultMessage: "ui.events.skeleton.action.add" }) })) })) }), "skeleton-item"))] }) })), Boolean(next) && (_jsx(Button, Object.assign({ color: "secondary", variant: "text", onClick: handleNext, className: classes.showMore }, { children: _jsx(FormattedMessage, { id: "ui.events.button.seeMore", defaultMessage: "ui.events.button.seeMore" }) })))] })) })) })] }));
|
|
240
|
+
showFollowed: showFollowed, deleteIcon: showFollowed ? _jsx(Icon, { children: "close" }) : null, onDelete: showFollowed ? handleDeleteClick : null, disabled: loading }) }))), _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(OngoingEventsFilter, { showOngoingEvents: showOngoingEvents, handleClick: handleChipOngoingClick, handleDeleteClick: handleDeleteOngoingClick, disabled: dateSearch !== SCEventDateFilterType.ALL || loading }) }))] })) : null }))), _jsx(_Fragment, { children: loading ? (_jsx(Skeleton, Object.assign({}, EventsSkeletonComponentProps, { EventSkeletonProps: EventSkeletonComponentProps }))) : (_jsx(_Fragment, { children: !events.length ? (_jsx(Box, Object.assign({ className: classes.noResults }, { children: general ? (_jsxs(_Fragment, { children: [_jsx(EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (onlyStaffEnabled && UserUtils.isStaff(scUserContext.user)) || !onlyStaffEnabled ? (_jsx(CreateEventButton, Object.assign({}, CreateEventButtonProps))) : null })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.events.noEvents.title", defaultMessage: "ui.events.noEvents.title" }) }))] })) : showUserEvents ? (_jsx(_Fragment, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.events.noEvents.title.personal", defaultMessage: "ui.events.noEvents.title.personal" }) })) })) : null }))) : (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 2 }, className: classes.events }, GridContainerComponentProps, { children: _jsxs(_Fragment, { children: [events.map((event) => (_jsx(Grid, Object.assign({ size: { xs: 12, md: 6 }, className: classes.item }, GridItemComponentProps, { children: _jsx(Event, Object.assign({ event: event, eventId: event.id }, EventComponentProps)) }), event.id))), authUserId && events.length % 2 !== 0 && (_jsx(Grid, Object.assign({ size: { xs: 12, md: 6 }, className: classes.itemSkeleton }, GridItemComponentProps, { children: _jsx(EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: _jsx(CreateEventButton, Object.assign({ variant: "outlined", color: "primary", size: "small" }, CreateEventButtonProps, { children: _jsx(FormattedMessage, { id: "ui.events.skeleton.action.add", defaultMessage: "ui.events.skeleton.action.add" }) })) })) }), "skeleton-item"))] }) })), Boolean(next) && (_jsx(Button, Object.assign({ color: "secondary", variant: "text", onClick: handleNext, className: classes.showMore }, { children: _jsx(FormattedMessage, { id: "ui.events.button.seeMore", defaultMessage: "ui.events.button.seeMore" }) })))] })) })) })] }));
|
|
241
241
|
/**
|
|
242
242
|
* Renders root object (if content availability community option is false and user is anonymous, component is hidden)
|
|
243
243
|
*/
|
|
@@ -36,5 +36,5 @@ const Root = styled(Box, {
|
|
|
36
36
|
*/
|
|
37
37
|
export default function EventsSkeleton(inProps) {
|
|
38
38
|
const { className, EventSkeletonProps = {}, eventsNumber = 8, GridContainerComponentProps = {}, GridItemComponentProps = {} } = inProps, rest = __rest(inProps, ["className", "EventSkeletonProps", "eventsNumber", "GridContainerComponentProps", "GridItemComponentProps"]);
|
|
39
|
-
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 3 }, className: classes.events }, GridContainerComponentProps, { children: [...Array(eventsNumber)].map((_event, index) => (_jsx(Grid, Object.assign({ size: { md: 6 } }, GridItemComponentProps, { className: classes.item }, { children: _jsx(EventSkeleton, Object.assign({}, EventSkeletonProps)) }), index))) })) })));
|
|
39
|
+
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 3 }, className: classes.events }, GridContainerComponentProps, { children: [...Array(eventsNumber)].map((_event, index) => (_jsx(Grid, Object.assign({ size: { xs: 12, md: 6 } }, GridItemComponentProps, { className: classes.item }, { children: _jsx(EventSkeleton, Object.assign({}, EventSkeletonProps)) }), index))) })) })));
|
|
40
40
|
}
|
|
@@ -427,6 +427,6 @@ const Feed = (inProps, ref) => {
|
|
|
427
427
|
if (feedDataObject.isLoadingNext && !feedDataLeft.length) {
|
|
428
428
|
return (_jsx(FeedSkeleton, { children: [...Array(3)].map((_v, i) => (_jsx(ItemSkeleton, Object.assign({}, ItemSkeletonProps), i))) }));
|
|
429
429
|
}
|
|
430
|
-
return (_jsxs(Root, Object.assign({ container: true, width: "100%", spacing: 2, id: id, className: classNames(classes.root, className) }, { children: [advEnabled && !hideAdvs && enabledCustomAdvPositions.includes(SCCustomAdvPosition.POSITION_BELOW_TOPBAR) ? (_jsx(Grid, Object.assign({ size:
|
|
430
|
+
return (_jsxs(Root, Object.assign({ container: true, width: "100%", spacing: 2, id: id, className: classNames(classes.root, className) }, { children: [advEnabled && !hideAdvs && enabledCustomAdvPositions.includes(SCCustomAdvPosition.POSITION_BELOW_TOPBAR) ? (_jsx(Grid, Object.assign({ size: 12 }, { children: _jsx(CustomAdv, Object.assign({ position: SCCustomAdvPosition.POSITION_BELOW_TOPBAR }, CustomAdvProps)) }))) : null, _jsx(Grid, Object.assign({ size: { xs: 12, md: 7 } }, { children: _jsxs(InfiniteScroll, Object.assign({ ref: containerRef, className: classes.left, dataLength: feedDataLeft.length, next: getNextPage, previous: getPreviousPage, hasMoreNext: Boolean(feedDataObject.next), hasMorePrevious: Boolean(feedDataObject.previous), header: PreviousPageLink, footer: NextPageLink, loaderNext: _jsx(ItemSkeleton, Object.assign({}, ItemSkeletonProps)), loaderPrevious: _jsx(ItemSkeleton, Object.assign({}, ItemSkeletonProps)), scrollThreshold: "90%", endMessage: _jsxs(Box, Object.assign({ className: classes.end }, { children: [_jsx(Widget, Object.assign({ className: classes.endMessage }, { children: _jsx(CardContent, { children: endMessage }) })), FooterComponent ? _jsx(FooterComponent, Object.assign({}, FooterComponentProps)) : null] })), refreshFunction: refresh, pullDownToRefresh: true, pullDownToRefreshThreshold: 1000, pullDownToRefreshContent: null, releaseToRefreshContent: _jsx(Button, Object.assign({ color: "secondary", variant: "contained", className: classes.refresh }, { children: refreshMessage })), style: { overflow: 'visible' } }, (scrollableTargetId && { scrollableTarget: scrollableTargetId }), { children: [renderHeaderComponent(), feedDataObject.count === 0 && emptyFeedPlaceholder && emptyFeedPlaceholder, _jsx(VirtualizedScroller, Object.assign({ className: classes.leftItems, items: feedDataLeft, itemComponent: InnerItem, onMount: onScrollerMount, onScrollerStateChange: onScrollerStateChange, getItemId: getScrollItemId, preserveScrollPosition: true, preserveScrollPositionOnPrependItems: true, cacheScrollStateKey: SCCache.getVirtualizedScrollStateCacheKey(id), cacheScrollerPositionKey: SCCache.getFeedSPCacheKey(id), cacheStrategy: cacheStrategy }, (scrollableTargetId && { getScrollableContainer: () => document.getElementById(scrollableTargetId) }), VirtualizedScrollerProps))] })) })), feedDataRight.length > 0 && !hideAdvs && (_jsx(Grid, Object.assign({ sx: { display: { xs: 'none', sm: 'block' } }, size: { xs: 12, md: 5 } }, { children: _jsx(StickyBoxComp, Object.assign({ className: classes.right }, FeedSidebarProps, { children: _jsx(React.Suspense, Object.assign({ fallback: _jsx(GenericSkeleton, {}) }, { children: feedDataRight.map((d, i) => (_jsx(d.component, Object.assign({}, d.componentProps), i))) })) })) })))] })));
|
|
431
431
|
};
|
|
432
432
|
export default forwardRef(Feed);
|
|
@@ -38,5 +38,5 @@ const Root = styled(Grid, {
|
|
|
38
38
|
export default function FeedSkeleton(props) {
|
|
39
39
|
// PROPS
|
|
40
40
|
const { children = (_jsxs(React.Fragment, { children: [_jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } })] })), sidebar = (_jsxs(React.Fragment, { children: [_jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } })] })), className } = props;
|
|
41
|
-
return (_jsxs(Root, Object.assign({ container: true, width: "100%", spacing: 2, className: classNames(classes.root, className) }, { children: [_jsx(Grid, Object.assign({ size: { md: 7 } }, { children: _jsx("div", Object.assign({ className: classes.left }, { children: children })) })), _jsx(Grid, Object.assign({ sx: { display: {
|
|
41
|
+
return (_jsxs(Root, Object.assign({ container: true, width: "100%", spacing: 2, className: classNames(classes.root, className) }, { children: [_jsx(Grid, Object.assign({ size: { xs: 12, md: 7 } }, { children: _jsx("div", Object.assign({ className: classes.left }, { children: children })) })), _jsx(Grid, Object.assign({ sx: { display: { xs: 'none', sm: 'block' } }, size: { xs: 12, md: 5 } }, { children: _jsx("div", Object.assign({ className: classes.right }, { children: sidebar })) }))] })));
|
|
42
42
|
}
|
|
@@ -2,8 +2,7 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useMemo, useState } from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl';
|
|
5
|
-
import
|
|
6
|
-
import { Box, Tooltip, styled, Icon } from '@mui/material';
|
|
5
|
+
import { Box, Tooltip, styled, Icon, Button } from '@mui/material';
|
|
7
6
|
import { SCOPE_SC_UI } from '../../../../constants/Errors';
|
|
8
7
|
import classNames from 'classnames';
|
|
9
8
|
import { useSnackbar } from 'notistack';
|
|
@@ -61,7 +60,7 @@ export default function Follow(props) {
|
|
|
61
60
|
else {
|
|
62
61
|
setIsFollowing(true);
|
|
63
62
|
performFollow()
|
|
64
|
-
.then((
|
|
63
|
+
.then(() => {
|
|
65
64
|
const isFollow = !obj.followed;
|
|
66
65
|
setObj(Object.assign({}, obj, { followed: isFollow }));
|
|
67
66
|
setIsFollowing(false);
|
|
@@ -88,7 +87,7 @@ export default function Follow(props) {
|
|
|
88
87
|
if (obj.followed) {
|
|
89
88
|
btnLabel = _jsx(FormattedMessage, { id: "ui.feedObject.unfollow", defaultMessage: "ui.feedObject.unfollow" });
|
|
90
89
|
}
|
|
91
|
-
return (_jsx(React.Fragment, { children: scUserContext.user && obj.author.id !== scUserContext.user.id && !obj.deleted && (_jsx(Tooltip, Object.assign({ title: btnLabel }, { children: _jsx(
|
|
90
|
+
return (_jsx(React.Fragment, { children: scUserContext.user && obj.author.id !== scUserContext.user.id && !obj.deleted && (_jsx(Tooltip, Object.assign({ title: btnLabel }, { children: _jsx(Button, Object.assign({ className: classNames(classes.button, { [classes.iconized]: iconized, [classes.followed]: obj.followed }), loading: isFollowing, variant: iconized ? 'text' : 'contained', disabled: isFollowing, onClick: follow }, { children: iconized ? _jsx(Icon, { children: obj.followed ? 'bookmark_added' : 'bookmark_border' }) : btnLabel })) }))) }));
|
|
92
91
|
}
|
|
93
92
|
/**
|
|
94
93
|
* Renders share action
|
|
@@ -2,7 +2,6 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React, { useContext, useMemo, useState } from 'react';
|
|
4
4
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
5
|
-
import LoadingButton from '@mui/lab/LoadingButton';
|
|
6
5
|
import SharesDialog from './SharesDialog';
|
|
7
6
|
import { Box, Button, Divider, ListItemText, Menu, SwipeableDrawer, Tooltip, useMediaQuery, useTheme, Icon, MenuItem, ListItemIcon, styled, Skeleton } from '@mui/material';
|
|
8
7
|
import { MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_TYPE_SHARE } from '../../../../constants/Media';
|
|
@@ -193,7 +192,7 @@ export default function Share(props) {
|
|
|
193
192
|
* @return {JSX.Element}
|
|
194
193
|
*/
|
|
195
194
|
function renderShareBtn() {
|
|
196
|
-
return (_jsx(React.Fragment, { children: withAction && (_jsxs(React.Fragment, { children: [!inlineAction && withAudience && _jsx(Divider, { className: classes.divider }), _jsx(Tooltip, Object.assign({ title: `${intl.formatMessage(messages.share)}` }, { children: _jsx(
|
|
195
|
+
return (_jsx(React.Fragment, { children: withAction && (_jsxs(React.Fragment, { children: [!inlineAction && withAudience && _jsx(Divider, { className: classes.divider }), _jsx(Tooltip, Object.assign({ title: `${intl.formatMessage(messages.share)}` }, { children: _jsx(Button, Object.assign({ loading: isSharing, onClick: handleOpenShareMenu, className: classes.button }, { children: _jsx(Icon, { children: "share" }) })) })), Boolean(anchorEl) && (_jsx(_Fragment, { children: !isMobile ? (_jsx(Menu, Object.assign({ anchorEl: anchorEl, open: true, onClose: handleClose, onClick: handleClose, slotProps: {
|
|
197
196
|
paper: {
|
|
198
197
|
elevation: 0,
|
|
199
198
|
sx: {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useSCContext, useSCUser } from '@selfcommunity/react-core';
|
|
4
|
-
import { Box, Card, Typography, styled, Icon, LinearProgress } from '@mui/material';
|
|
4
|
+
import { Box, Card, Typography, styled, Icon, LinearProgress, Button } from '@mui/material';
|
|
5
5
|
import { FormattedMessage } from 'react-intl';
|
|
6
|
-
import { LoadingButton } from '@mui/lab';
|
|
7
6
|
import classNames from 'classnames';
|
|
8
7
|
import { PREFIX } from '../../constants';
|
|
9
8
|
const classes = {
|
|
@@ -47,5 +46,5 @@ export default function Choice(props) {
|
|
|
47
46
|
/**
|
|
48
47
|
* Renders root element
|
|
49
48
|
*/
|
|
50
|
-
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Typography, Object.assign({ className: classes.label }, { children: choiceObj.choice })), _jsx(LinearProgressWithLabel, { className: classes.progress, value: renderVotes(choiceObj.vote_count, votes) }), _jsx(
|
|
49
|
+
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Typography, Object.assign({ className: classes.label }, { children: choiceObj.choice })), _jsx(LinearProgressWithLabel, { className: classes.progress, value: renderVotes(choiceObj.vote_count, votes) }), _jsx(Button, Object.assign({ loading: isVoting === choiceObj.id, variant: choiceObj.voted ? 'contained' : 'outlined', size: "small", disabled: disabled || isVoting !== null || votable || feedObject.draft, className: classes.vote, onClick: handleVoteAction }, { children: choiceObj.voted ? (_jsx(Icon, { children: "check" })) : (_jsx(FormattedMessage, { id: "ui.feedObject.poll.choice.vote", defaultMessage: "ui.feedObject.poll.choice.vote" })) }))] })));
|
|
51
50
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useEffect, useState } from 'react';
|
|
4
|
-
import { styled } from '@mui/material';
|
|
4
|
+
import { Button, styled } from '@mui/material';
|
|
5
5
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
6
|
-
import { LoadingButton } from '@mui/lab';
|
|
7
6
|
import { FormattedMessage } from 'react-intl';
|
|
8
7
|
import { useSnackbar } from 'notistack';
|
|
9
8
|
import classNames from 'classnames';
|
|
@@ -15,7 +14,7 @@ const PREFIX = 'SCFollowUserButton';
|
|
|
15
14
|
const classes = {
|
|
16
15
|
root: `${PREFIX}-root`
|
|
17
16
|
};
|
|
18
|
-
const FollowButton = styled(
|
|
17
|
+
const FollowButton = styled(Button, {
|
|
19
18
|
name: PREFIX,
|
|
20
19
|
slot: 'Root',
|
|
21
20
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useEffect, useState } from 'react';
|
|
4
|
-
import { styled } from '@mui/material';
|
|
4
|
+
import { Button, styled } from '@mui/material';
|
|
5
5
|
import { SCConnectionStatus } from '@selfcommunity/types';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { useThemeProps } from '@mui/system';
|
|
8
8
|
import { useSnackbar } from 'notistack';
|
|
9
9
|
import { FormattedMessage } from 'react-intl';
|
|
10
|
-
import { LoadingButton } from '@mui/lab';
|
|
11
10
|
import { Logger } from '@selfcommunity/utils';
|
|
12
11
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
13
12
|
import { catchUnauthorizedActionByBlockedUser } from '../../utils/errors';
|
|
@@ -16,10 +15,10 @@ const PREFIX = 'SCFriendshipUserButton';
|
|
|
16
15
|
const classes = {
|
|
17
16
|
root: `${PREFIX}-root`
|
|
18
17
|
};
|
|
19
|
-
const Root = styled(
|
|
18
|
+
const Root = styled(Button, {
|
|
20
19
|
name: PREFIX,
|
|
21
20
|
slot: 'Root',
|
|
22
|
-
overridesResolver: (
|
|
21
|
+
overridesResolver: (_props, styles) => styles.root
|
|
23
22
|
})(() => ({}));
|
|
24
23
|
// TODO: fix component
|
|
25
24
|
/**
|
|
@@ -2,13 +2,12 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo, useState } from 'react';
|
|
4
4
|
import { useThemeProps } from '@mui/system';
|
|
5
|
-
import { Avatar, Box, Divider, FormGroup, Icon, Paper, Stack, Switch, TextField, Typography, styled } from '@mui/material';
|
|
5
|
+
import { Avatar, Box, Button, Divider, FormGroup, Icon, Paper, Stack, Switch, TextField, Typography, styled } from '@mui/material';
|
|
6
6
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
7
7
|
import { SCPreferences, UserUtils, useSCPaymentsEnabled, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { PREFIX } from './constants';
|
|
10
10
|
import BaseDialog from '../../shared/BaseDialog';
|
|
11
|
-
import { LoadingButton } from '@mui/lab';
|
|
12
11
|
import ChangeGroupPicture from '../ChangeGroupPicture';
|
|
13
12
|
import ChangeGroupCover from '../ChangeGroupCover';
|
|
14
13
|
import { GROUP_DESCRIPTION_MAX_LENGTH, GROUP_TITLE_MAX_LENGTH } from '../../constants/Group';
|
|
@@ -247,7 +246,7 @@ export default function GroupForm(inProps) {
|
|
|
247
246
|
/**
|
|
248
247
|
* Renders root object
|
|
249
248
|
*/
|
|
250
|
-
return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, title: group ? (_jsx(FormattedMessage, { id: "ui.groupForm.title.edit", defaultMessage: "ui.groupForm.title.edit" })) : (_jsx(FormattedMessage, { id: "ui.groupForm.title", defaultMessage: "ui.groupForm.title" })), open: open, disableEscapeKeyDown: true, onClose: handleClose, className: classNames(classes.root, className), actions: _jsx(
|
|
249
|
+
return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, title: group ? (_jsx(FormattedMessage, { id: "ui.groupForm.title.edit", defaultMessage: "ui.groupForm.title.edit" })) : (_jsx(FormattedMessage, { id: "ui.groupForm.title", defaultMessage: "ui.groupForm.title" })), open: open, disableEscapeKeyDown: true, onClose: handleClose, className: classNames(classes.root, className), actions: _jsx(Button, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
|
|
251
250
|
Object.keys(error).length !== 0 ||
|
|
252
251
|
field.name.length > GROUP_TITLE_MAX_LENGTH ||
|
|
253
252
|
field.name.description > GROUP_DESCRIPTION_MAX_LENGTH, variant: "contained", onClick: handleSubmit, color: "secondary" }, { children: group ? (_jsx(FormattedMessage, { id: "ui.groupForm.button.edit", defaultMessage: "ui.groupForm.button.edit" })) : (_jsx(FormattedMessage, { id: "ui.groupForm.button.create", defaultMessage: "ui.groupForm.button.create" })) })) }, rest, { children: _jsxs(_Fragment, { children: [_jsxs(_Fragment, { children: [_jsxs(Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: [_jsx(Box, Object.assign({ className: classes.avatar }, { children: _jsx(Avatar, { children: field.imageOriginal ? _jsx("img", { src: field.imageOriginal, alt: "avatar" }) : _jsx(Icon, { children: "icon_image" }) }) })), _jsxs(_Fragment, { children: [_jsx(ChangeGroupPicture, { isCreationMode: true, onChange: handleChangeAvatar }), _jsx(ChangeGroupCover, { isCreationMode: true, onChange: handleChangeCover })] })] })), _jsx(Typography, Object.assign({ className: classNames(classes.header, { [classes.error]: error.emotionalImageOriginalError || error.imageOriginalError }), align: "center" }, { children: error.emotionalImageOriginalError || error.imageOriginalError ? (_jsx(FormattedMessage, { id: "ui.groupForm.header.error", defaultMessage: "ui.groupForm.header.error" })) : (_jsx(FormattedMessage, { id: "ui.groupForm.header", defaultMessage: "ui.groupForm.header" })) }))] }), _jsxs(FormGroup, Object.assign({ className: classes.form }, { children: [_jsx(TextField, { required: true, className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: field.name, name: "name", onChange: handleChange, slotProps: {
|
|
@@ -7,7 +7,6 @@ import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
|
7
7
|
import { SCUserContext, useSCFetchGroup } from '@selfcommunity/react-core';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import BaseDialog from '../../shared/BaseDialog';
|
|
10
|
-
import { LoadingButton } from '@mui/lab';
|
|
11
10
|
import { GroupService } from '@selfcommunity/api-services';
|
|
12
11
|
import User from '../User';
|
|
13
12
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
@@ -253,7 +252,7 @@ export default function GroupInviteButton(inProps) {
|
|
|
253
252
|
/**
|
|
254
253
|
* Renders root object
|
|
255
254
|
*/
|
|
256
|
-
return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClose, variant: scGroup ? 'contained' : 'outlined', color: scGroup ? 'secondary' : 'inherit', startIcon: _jsx(Icon, { children: "add" }) }, rest, { children: _jsx(FormattedMessage, { id: "ui.groupInviteButton", defaultMessage: "ui.groupInviteButton" }) })), open && (_jsx(DialogRoot, Object.assign({ DialogContentProps: { dividers: false }, open: true, className: classes.dialogRoot, title: _jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ onClick: handleClose }, { children: _jsx(Icon, { children: "arrow_back" }) })), _jsx(Typography, Object.assign({ className: classes.dialogTitle }, { children: _jsx(FormattedMessage, { id: "ui.groupInviteButton.dialog.title", defaultMessage: "ui.groupInviteButton.dialog.title" }) })), _jsx(
|
|
255
|
+
return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClose, variant: scGroup ? 'contained' : 'outlined', color: scGroup ? 'secondary' : 'inherit', startIcon: _jsx(Icon, { children: "add" }) }, rest, { children: _jsx(FormattedMessage, { id: "ui.groupInviteButton", defaultMessage: "ui.groupInviteButton" }) })), open && (_jsx(DialogRoot, Object.assign({ DialogContentProps: { dividers: false }, open: true, className: classes.dialogRoot, title: _jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ onClick: handleClose }, { children: _jsx(Icon, { children: "arrow_back" }) })), _jsx(Typography, Object.assign({ className: classes.dialogTitle }, { children: _jsx(FormattedMessage, { id: "ui.groupInviteButton.dialog.title", defaultMessage: "ui.groupInviteButton.dialog.title" }) })), _jsx(Button, Object.assign({ size: "small", color: "secondary", variant: "contained", onClick: handleSendInvitations, loading: isSending, disabled: !invited.length }, { children: _jsx(FormattedMessage, { id: "ui.groupInviteButton.dialog.button.end", defaultMessage: "ui.groupInviteButton.dialog.button.end" }) }))] }) }, { children: _jsxs(Box, Object.assign({ className: classes.dialogContent }, { children: [_jsx(Autocomplete, { className: classes.autocomplete, loading: loading, size: "small", multiple: true, freeSolo: true, disableClearable: true, options: suggested, onChange: handleChange, onInputChange: handleInputChange, inputValue: value, filterOptions: filterOptions, value: invited, getOptionLabel: (option) => (option ? option.username : '...'), isOptionEqualToValue: (option, value) => (option ? value.id === option.id : false), renderTags: () => null, renderOption: (props, option) => (_jsxs(Box, Object.assign({ component: "li" }, props, { children: [_jsx(Avatar, { alt: option.username, src: option.avatar }), _jsx(Typography, Object.assign({ ml: 1 }, { children: option.username }))] }))), renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { variant: "outlined", placeholder: `${intl.formatMessage(messages.placeholder)}`, slotProps: {
|
|
257
256
|
input: Object.assign(Object.assign({}, params.InputProps), { className: classes.input, startAdornment: (_jsxs(_Fragment, { children: [_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, Object.assign({ className: classes.icon }, { children: "search" })) })), params.InputProps.startAdornment] })) })
|
|
258
257
|
} }))) }), _jsx(Box, Object.assign({ className: classes.invitedBox }, { children: invited.map((option, index) => (_jsx(Chip, { avatar: _jsx(Avatar, { alt: option.username, src: option.avatar }), label: option.username, onDelete: () => {
|
|
259
258
|
handleDelete(option);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useMemo, useState } from 'react';
|
|
4
|
-
import { styled } from '@mui/material';
|
|
4
|
+
import { Button, styled } from '@mui/material';
|
|
5
5
|
import { CacheStrategies, Logger } from '@selfcommunity/utils';
|
|
6
6
|
import { useSCContext, useSCFetchGroup, useSCPaymentsEnabled, useSCUser } from '@selfcommunity/react-core';
|
|
7
7
|
import { SCContentType, SCGroupPrivacyType, SCGroupSubscriptionStatusType } from '@selfcommunity/types';
|
|
8
|
-
import { LoadingButton } from '@mui/lab';
|
|
9
8
|
import { FormattedMessage } from 'react-intl';
|
|
10
9
|
import classNames from 'classnames';
|
|
11
10
|
import { useThemeProps } from '@mui/system';
|
|
@@ -17,11 +16,11 @@ const PREFIX = 'SCGroupSubscribeButton';
|
|
|
17
16
|
const classes = {
|
|
18
17
|
root: `${PREFIX}-root`
|
|
19
18
|
};
|
|
20
|
-
const Root = styled(
|
|
19
|
+
const Root = styled(Button, {
|
|
21
20
|
name: PREFIX,
|
|
22
21
|
slot: 'Root',
|
|
23
|
-
overridesResolver: (
|
|
24
|
-
})((
|
|
22
|
+
overridesResolver: (_props, styles) => styles.root
|
|
23
|
+
})(() => ({}));
|
|
25
24
|
const BuyButtonRoot = styled(BuyButton, {
|
|
26
25
|
name: PREFIX,
|
|
27
26
|
slot: 'BuyButtonRoot'
|
|
@@ -172,7 +172,7 @@ export default function Groups(inProps) {
|
|
|
172
172
|
/**
|
|
173
173
|
* Renders groups list
|
|
174
174
|
*/
|
|
175
|
-
const content = (_jsxs(_Fragment, { children: [showFilters && (groups.length !== 0 || search.length !== 0) && (_jsx(Grid, Object.assign({ container: true, width: "100%", direction: "row", justifyContent: "center", alignItems: "center", className: classes.filters }, { children: filters ? (filters) : (_jsx(Grid, Object.assign({ size: { md: 6 } }, { children: _jsx(TextField, { className: classes.search, fullWidth: true, value: search, label: _jsx(FormattedMessage, { id: "ui.groups.filterByName", defaultMessage: "ui.groups.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
|
|
175
|
+
const content = (_jsxs(_Fragment, { children: [showFilters && (groups.length !== 0 || search.length !== 0) && (_jsx(Grid, Object.assign({ container: true, width: "100%", direction: "row", justifyContent: "center", alignItems: "center", className: classes.filters }, { children: filters ? (filters) : (_jsx(Grid, Object.assign({ size: { xs: 12, md: 6 } }, { children: _jsx(TextField, { className: classes.search, fullWidth: true, value: search, label: _jsx(FormattedMessage, { id: "ui.groups.filterByName", defaultMessage: "ui.groups.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
|
|
176
176
|
e.preventDefault();
|
|
177
177
|
if (e.key === 'Enter') {
|
|
178
178
|
fetchGroups();
|
|
@@ -186,7 +186,7 @@ export default function Groups(inProps) {
|
|
|
186
186
|
}
|
|
187
187
|
} }) }))) }))), _jsx(_Fragment, { children: !groups.length ? (_jsx(Box, Object.assign({ className: classes.noResults }, { children: search.length ? (_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.groups.noResults", defaultMessage: "ui.groups.noResults" }) }))) : !onlyStaffEnabled ? (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx(FormattedMessage, { id: "ui.groups.noGroups.title", defaultMessage: "ui.groups.noGroups.title" }) })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.groups.noGroups.subtitle", defaultMessage: "ui.groups.noGroups.subtitle" }) }))] })) : (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx(FormattedMessage, { id: "ui.groups.noGroups.title.onlyStaff", defaultMessage: "ui.groups.noGroups.title.onlyStaff" }) })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.groups.noGroups.subtitle.onlyStaff", defaultMessage: "ui.groups.noGroups.subtitle.onlyStaff" }) }))] })) }))) : (_jsx(InfiniteScroll, Object.assign({ dataLength: groups.length, next: handleNext, hasMoreNext: Boolean(next), loaderNext: isMobile ? _jsx(GroupSkeleton, {}) : _jsx(Skeleton, { groupsNumber: 2 }), endMessage: _jsx(Typography, Object.assign({ component: "div", className: classes.endMessage }, { children: _jsx(FormattedMessage, { id: "ui.groups.endMessage", defaultMessage: "ui.groups.endMessage", values: {
|
|
188
188
|
button: (chunk) => (_jsx(Button, Object.assign({ color: "secondary", variant: "text", onClick: handleScrollUp }, { children: chunk })))
|
|
189
|
-
} }) })) }, { children: _jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 2 }, className: classes.groups }, { children: groups.map((group) => (_jsx(Grid, Object.assign({ size: { sm: 8, md: 6 }, className: classes.item }, { children: _jsx(Group, Object.assign({ group: group, groupId: group.id, actionRedirect: true }, GroupComponentProps)) }), group.id))) })) }))) })] }));
|
|
189
|
+
} }) })) }, { children: _jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 2 }, className: classes.groups }, { children: groups.map((group) => (_jsx(Grid, Object.assign({ size: { xs: 12, sm: 8, md: 6 }, className: classes.item }, { children: _jsx(Group, Object.assign({ group: group, groupId: group.id, actionRedirect: true }, GroupComponentProps)) }), group.id))) })) }))) })] }));
|
|
190
190
|
// RENDER
|
|
191
191
|
if (!contentAvailability && !scUserContext.user) {
|
|
192
192
|
return _jsx(HiddenPlaceholder, {});
|
|
@@ -35,5 +35,5 @@ const Root = styled(Box, {
|
|
|
35
35
|
*/
|
|
36
36
|
export default function GroupsSkeleton(inProps) {
|
|
37
37
|
const { className, GroupSkeletonProps = {}, groupsNumber = 20 } = inProps, rest = __rest(inProps, ["className", "GroupSkeletonProps", "groupsNumber"]);
|
|
38
|
-
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 3 }, className: classes.groups }, { children: [...Array(groupsNumber)].map((_category, index) => (_jsx(Grid, Object.assign({ size: { sm: 8, md: 6 } }, { children: _jsx(GroupSkeleton, Object.assign({ elevation: 0, variant: "outlined" }, GroupSkeletonProps)) }), index))) })) })));
|
|
38
|
+
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 3 }, className: classes.groups }, { children: [...Array(groupsNumber)].map((_category, index) => (_jsx(Grid, Object.assign({ size: { xs: 12, sm: 8, md: 6 } }, { children: _jsx(GroupSkeleton, Object.assign({ elevation: 0, variant: "outlined" }, GroupSkeletonProps)) }), index))) })) })));
|
|
39
39
|
}
|