@selfcommunity/react-ui 0.11.0-mui7.17 → 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 +13 -13
- package/lib/umd/54.js +0 -2
- /package/lib/umd/{54.js.LICENSE.txt → 484.js.LICENSE.txt} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { styled } from '@mui/material';
|
|
3
|
+
import { Button, styled } from '@mui/material';
|
|
5
4
|
import { useThemeProps } from '@mui/system';
|
|
6
5
|
import { EventService } from '@selfcommunity/api-services';
|
|
7
6
|
import { useSCFetchEvent, useSCFetchUser } from '@selfcommunity/react-core';
|
|
@@ -16,7 +15,7 @@ const PREFIX = 'SCAcceptRequestUserEventButton';
|
|
|
16
15
|
const classes = {
|
|
17
16
|
root: `${PREFIX}-root`
|
|
18
17
|
};
|
|
19
|
-
const AcceptButton = styled(
|
|
18
|
+
const AcceptButton = styled(Button, {
|
|
20
19
|
name: PREFIX,
|
|
21
20
|
slot: 'Root',
|
|
22
21
|
overridesResolver: (_props, styles) => styles.root
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { styled } from '@mui/material';
|
|
3
|
+
import { Button, styled } from '@mui/material';
|
|
5
4
|
import { useThemeProps } from '@mui/system';
|
|
6
5
|
import { GroupService } from '@selfcommunity/api-services';
|
|
7
6
|
import { useSCFetchGroup, useSCFetchUser } from '@selfcommunity/react-core';
|
|
@@ -18,7 +17,7 @@ const PREFIX = 'SCAcceptRequestUserEventButton';
|
|
|
18
17
|
const classes = {
|
|
19
18
|
root: `${PREFIX}-root`
|
|
20
19
|
};
|
|
21
|
-
const AcceptButton = styled(
|
|
20
|
+
const AcceptButton = styled(Button, {
|
|
22
21
|
name: PREFIX,
|
|
23
22
|
slot: 'Root',
|
|
24
23
|
overridesResolver: (_props, styles) => styles.root
|
|
@@ -2,9 +2,8 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useEffect, useState } from 'react';
|
|
4
4
|
import { useThemeProps } from '@mui/system';
|
|
5
|
-
import { Box, Typography, styled, Icon } from '@mui/material';
|
|
5
|
+
import { Box, Typography, styled, Icon, Button } from '@mui/material';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import { LoadingButton } from '@mui/lab';
|
|
8
7
|
import { DataPortabilityService } from '@selfcommunity/api-services';
|
|
9
8
|
import { capitalize, Logger } from '@selfcommunity/utils';
|
|
10
9
|
import { SCUserContext } from '@selfcommunity/react-core';
|
|
@@ -21,8 +20,8 @@ const classes = {
|
|
|
21
20
|
const Root = styled(Box, {
|
|
22
21
|
name: PREFIX,
|
|
23
22
|
slot: 'Root',
|
|
24
|
-
overridesResolver: (
|
|
25
|
-
})((
|
|
23
|
+
overridesResolver: (_props, styles) => styles.root
|
|
24
|
+
})(() => ({}));
|
|
26
25
|
/**
|
|
27
26
|
* > API documentation for the Community-JS AccountDataPortability component. Learn about the available props and the CSS API.
|
|
28
27
|
*
|
|
@@ -150,16 +149,12 @@ export default function AccountDataPortability(inProps) {
|
|
|
150
149
|
* Renders root object
|
|
151
150
|
*/
|
|
152
151
|
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Typography, Object.assign({ variant: "h6" }, { children: _jsx(FormattedMessage, { id: "ui.accountDataPortability.title", defaultMessage: "ui.accountDataPortability.title", values: { username: capitalize(scUserContext.user.username) } }) })), _jsx(Typography, Object.assign({ variant: "body2", component: "div" }, { children: _jsx(FormattedMessage, { id: "ui.accountDataPortability.info", defaultMessage: "ui.accountDataPortability.info", values: {
|
|
153
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
154
|
-
// @ts-ignore
|
|
155
152
|
li: (chunks) => _jsx("li", { children: chunks }),
|
|
156
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
157
|
-
// @ts-ignore
|
|
158
153
|
ul: (chunks) => _jsx("ul", { children: chunks })
|
|
159
|
-
} }) })), _jsx(
|
|
154
|
+
} }) })), _jsx(Button, Object.assign({ size: "small", loading: (dataPortability && dataPortability.computing) || loading, disabled: !dataPortability ||
|
|
160
155
|
(dataPortability &&
|
|
161
156
|
(dataPortability.computing ||
|
|
162
|
-
(dataPortability.requested_at && differenceInHours(new Date(), parseISO(dataPortability.requested_at.toString())) < 24))), loadingPosition: "start", startIcon: _jsx(Icon, { children: "folder_open" }), variant: "outlined", className: classes.createButton, onClick: handleCreateDataPortabilityFile }, { children: (dataPortability && dataPortability.computing) || loading ? (_jsx(FormattedMessage, { id: "ui.accountDataPortability.createLoadingButton", defaultMessage: "ui.accountDataPortability.createLoadingButton" })) : (_jsx(FormattedMessage, { id: "ui.accountDataPortability.createButton", defaultMessage: "ui.accountDataPortability.createButton" })) })), dataPortability && !dataPortability.computing && dataPortability.generated_at && (_jsx(
|
|
157
|
+
(dataPortability.requested_at && differenceInHours(new Date(), parseISO(dataPortability.requested_at.toString())) < 24))), loadingPosition: "start", startIcon: _jsx(Icon, { children: "folder_open" }), variant: "outlined", className: classes.createButton, onClick: handleCreateDataPortabilityFile }, { children: (dataPortability && dataPortability.computing) || loading ? (_jsx(FormattedMessage, { id: "ui.accountDataPortability.createLoadingButton", defaultMessage: "ui.accountDataPortability.createLoadingButton" })) : (_jsx(FormattedMessage, { id: "ui.accountDataPortability.createButton", defaultMessage: "ui.accountDataPortability.createButton" })) })), dataPortability && !dataPortability.computing && dataPortability.generated_at && (_jsx(Button, Object.assign({ size: "small", loading: downloadingDataPortability, loadingPosition: "start", startIcon: _jsx(Icon, { children: "cloud_download_outlined" }), variant: "outlined", className: classes.downloadButton, onClick: handleDownloadDataPortabilityFile }, { children: _jsx(FormattedMessage, { id: "ui.accountDataPortability.downloadButton", defaultMessage: "ui.accountDataPortability.downloadButton" }) }))), _jsx("br", {}), dataPortability && !dataPortability.computing && dataPortability.generated_at && (_jsx(Typography, Object.assign({ className: classes.generationInfo, variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.accountDataPortability.generatedInfo", defaultMessage: "ui.accountDataPortability.generatedInfo", values: {
|
|
163
158
|
date: _jsx(FormattedDate, { value: dataPortability.requested_at, day: "numeric", month: "long", year: "numeric" }),
|
|
164
159
|
time: _jsx(FormattedTime, { value: dataPortability.requested_at })
|
|
165
160
|
} }) })))] })));
|
|
@@ -2,14 +2,13 @@ import { __rest } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useMemo, useState } from 'react';
|
|
4
4
|
import { useThemeProps } from '@mui/system';
|
|
5
|
-
import { Box, TextField, Typography, styled } from '@mui/material';
|
|
5
|
+
import { Box, Button, TextField, Typography, styled } from '@mui/material';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { UserService } from '@selfcommunity/api-services';
|
|
8
8
|
import { Logger } from '@selfcommunity/utils';
|
|
9
9
|
import { SCPreferences, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
|
|
10
10
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
11
11
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
12
|
-
import LoadingButton from '@mui/lab/LoadingButton';
|
|
13
12
|
const PREFIX = 'SCAccountDelete';
|
|
14
13
|
const classes = {
|
|
15
14
|
root: `${PREFIX}-root`,
|
|
@@ -20,7 +19,7 @@ const classes = {
|
|
|
20
19
|
const Root = styled(Box, {
|
|
21
20
|
name: PREFIX,
|
|
22
21
|
slot: 'Root',
|
|
23
|
-
overridesResolver: (
|
|
22
|
+
overridesResolver: (_props, styles) => styles.root
|
|
24
23
|
})(() => ({}));
|
|
25
24
|
/**
|
|
26
25
|
* > API documentation for the Community-JS AccountDelete component. Learn about the available props and the CSS API.
|
|
@@ -109,16 +108,10 @@ export default function AccountDelete(inProps) {
|
|
|
109
108
|
*/
|
|
110
109
|
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Typography, Object.assign({ className: classes.message, component: Box }, { children: _jsx(FormattedMessage, { id: "ui.accountDelete.message", defaultMessage: "ui.accountDelete.message", values: {
|
|
111
110
|
communityName,
|
|
112
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
113
|
-
// @ts-ignore
|
|
114
111
|
li: (chunks) => _jsx("li", { children: chunks }),
|
|
115
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
116
|
-
// @ts-ignore
|
|
117
112
|
ul: (chunks) => _jsx("ul", { children: chunks })
|
|
118
113
|
} }) })), _jsxs(Typography, Object.assign({ className: classes.confirm, component: Box }, { children: [_jsx(FormattedMessage, { id: "ui.accountDelete.confirmMessage", defaultMessage: "ui.accountDelete.confirmMessage", values: {
|
|
119
114
|
username: scUserContext.user.username,
|
|
120
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
121
|
-
// @ts-ignore
|
|
122
115
|
b: (chunks) => _jsx("b", { children: chunks })
|
|
123
|
-
} }), _jsx(TextField, { name: "confirm", value: confirm, onChange: handleChange, autoComplete: "off", size: "small" })] })), error && _jsx(Typography, Object.assign({ color: "error" }, { children: error })), _jsx(
|
|
116
|
+
} }), _jsx(TextField, { name: "confirm", value: confirm, onChange: handleChange, autoComplete: "off", size: "small" })] })), error && _jsx(Typography, Object.assign({ color: "error" }, { children: error })), _jsx(Button, Object.assign({ className: classes.button, size: "small", disabled: isDeleting || confirm !== scUserContext.user.username, variant: "outlined", onClick: handleDelete }, { children: _jsx(FormattedMessage, { id: "ui.accountDelete.buttonLabel", defaultMessage: "ui.accountDelete.buttonLabel" }) }))] })));
|
|
124
117
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { Icon, styled, SwipeableDrawer, Tooltip, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
3
|
+
import { Button, Icon, styled, SwipeableDrawer, Tooltip, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
5
4
|
import { useThemeProps } from '@mui/system';
|
|
6
5
|
import { useSCContext, useSCUser } from '@selfcommunity/react-core';
|
|
7
6
|
import { SCContentType, SCCourseJoinStatusType, SCEventSubscriptionStatusType, SCGroupSubscriptionStatusType } from '@selfcommunity/types';
|
|
@@ -24,7 +23,7 @@ const classes = {
|
|
|
24
23
|
going: `${PREFIX}-going`,
|
|
25
24
|
notGoing: `${PREFIX}-not-going`
|
|
26
25
|
};
|
|
27
|
-
const RequestRoot = styled(
|
|
26
|
+
const RequestRoot = styled(Button, {
|
|
28
27
|
name: PREFIX,
|
|
29
28
|
slot: 'RequestRoot'
|
|
30
29
|
})(() => ({}));
|
|
@@ -146,7 +146,7 @@ export default function Categories(inProps) {
|
|
|
146
146
|
* Renders categories list
|
|
147
147
|
*/
|
|
148
148
|
const filteredCategories = sortByAttr(getFilteredCategories(), 'order');
|
|
149
|
-
const c = (_jsxs(_Fragment, { children: [showFilters && (_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, { fullWidth: true, value: filterName, label: _jsx(FormattedMessage, { id: "ui.categories.filterByName", defaultMessage: "ui.categories.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading }) }))) }))), loading ? (_jsx(CategoriesSkeletonComponent, Object.assign({}, CategoriesSkeletonProps))) : (_jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 3 }, className: classes.categories }, { children: !filteredCategories.length ? (_jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(Typography, Object.assign({ className: classes.noResults, variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.categories.noResults", defaultMessage: "ui.categories.noResults" }) })) }))) : (_jsx(_Fragment, { children: filteredCategories.map((category) => (_jsx(Grid, Object.assign({ size: { sm: 6, lg: 4 } }, { children: _jsx(CategoryComponent, Object.assign({ category: category }, CategoryComponentProps, { showTooltip: true, className: classes.category })) }), category.id))) })) })))] }));
|
|
149
|
+
const c = (_jsxs(_Fragment, { children: [showFilters && (_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, { fullWidth: true, value: filterName, label: _jsx(FormattedMessage, { id: "ui.categories.filterByName", defaultMessage: "ui.categories.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading }) }))) }))), loading ? (_jsx(CategoriesSkeletonComponent, Object.assign({}, CategoriesSkeletonProps))) : (_jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 3 }, className: classes.categories }, { children: !filteredCategories.length ? (_jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(Typography, Object.assign({ className: classes.noResults, variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.categories.noResults", defaultMessage: "ui.categories.noResults" }) })) }))) : (_jsx(_Fragment, { children: filteredCategories.map((category) => (_jsx(Grid, Object.assign({ size: { xs: 12, sm: 6, lg: 4 } }, { children: _jsx(CategoryComponent, Object.assign({ category: category }, CategoryComponentProps, { showTooltip: true, className: classes.category })) }), category.id))) })) })))] }));
|
|
150
150
|
/**
|
|
151
151
|
* Renders root object (if content availability community option is false and user is anonymous, component is hidden)
|
|
152
152
|
*/
|
|
@@ -35,5 +35,5 @@ const Root = styled(Box, {
|
|
|
35
35
|
*/
|
|
36
36
|
export default function CategoriesSkeleton(inProps) {
|
|
37
37
|
const { className, CategorySkeletonProps = {} } = inProps, rest = __rest(inProps, ["className", "CategorySkeletonProps"]);
|
|
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.categories }, { children: [...Array(15)].map((_category, index) => (_jsx(Grid, Object.assign({ size: { sm: 6, md: 4 } }, { children: _jsx(CategorySkeleton, Object.assign({ elevation: 0, variant: "outlined" }, CategorySkeletonProps)) }), 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.categories }, { children: [...Array(15)].map((_category, index) => (_jsx(Grid, Object.assign({ size: { xs: 12, sm: 6, md: 4 } }, { children: _jsx(CategorySkeleton, Object.assign({ elevation: 0, variant: "outlined" }, CategorySkeletonProps)) }), index))) })) })));
|
|
39
39
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
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 { SCPreferences, useSCContext, useSCFetchCategory, useSCPaymentsEnabled, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
|
|
7
7
|
import { SCCategoryAutoFollowType, SCContentType } from '@selfcommunity/types';
|
|
8
8
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
9
|
-
import { LoadingButton } from '@mui/lab';
|
|
10
9
|
import { FormattedMessage } from 'react-intl';
|
|
11
10
|
import classNames from 'classnames';
|
|
12
11
|
import { useThemeProps } from '@mui/system';
|
|
@@ -15,11 +14,11 @@ const PREFIX = 'SCCategoryFollowButton';
|
|
|
15
14
|
const classes = {
|
|
16
15
|
root: `${PREFIX}-root`
|
|
17
16
|
};
|
|
18
|
-
const Root = styled(
|
|
17
|
+
const Root = styled(Button, {
|
|
19
18
|
name: PREFIX,
|
|
20
19
|
slot: 'Root',
|
|
21
|
-
overridesResolver: (
|
|
22
|
-
})((
|
|
20
|
+
overridesResolver: (_props, styles) => styles.root
|
|
21
|
+
})(() => ({}));
|
|
23
22
|
/**
|
|
24
23
|
* > API documentation for the Community-JS Follow Category Button component. Learn about the available props and the CSS API.
|
|
25
24
|
|
|
@@ -1,20 +1,19 @@
|
|
|
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 { defineMessages, useIntl } from 'react-intl';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useThemeProps } from '@mui/system';
|
|
9
9
|
import { PREFIX } from './constants';
|
|
10
|
-
import { LoadingButton } from '@mui/lab';
|
|
11
10
|
import { GroupService } from '@selfcommunity/api-services';
|
|
12
11
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
13
12
|
import { Logger } from '@selfcommunity/utils';
|
|
14
13
|
const classes = {
|
|
15
14
|
root: `${PREFIX}-root`
|
|
16
15
|
};
|
|
17
|
-
const Root = styled(
|
|
16
|
+
const Root = styled(Button, {
|
|
18
17
|
name: PREFIX,
|
|
19
18
|
slot: 'Root'
|
|
20
19
|
})(() => ({}));
|
|
@@ -1,7 +1,7 @@
|
|
|
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';
|
|
@@ -10,7 +10,6 @@ import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
|
10
10
|
import { GroupService } from '@selfcommunity/api-services';
|
|
11
11
|
import { Logger } from '@selfcommunity/utils';
|
|
12
12
|
import { defineMessages, useIntl } from 'react-intl';
|
|
13
|
-
import { LoadingButton } from '@mui/lab';
|
|
14
13
|
const messages = defineMessages({
|
|
15
14
|
errorLoadImage: {
|
|
16
15
|
id: 'ui.changeGroupPicture.alert',
|
|
@@ -20,7 +19,7 @@ const messages = defineMessages({
|
|
|
20
19
|
const classes = {
|
|
21
20
|
root: `${PREFIX}-root`
|
|
22
21
|
};
|
|
23
|
-
const Root = styled(
|
|
22
|
+
const Root = styled(Button, {
|
|
24
23
|
name: PREFIX,
|
|
25
24
|
slot: 'Root'
|
|
26
25
|
})(() => ({}));
|
|
@@ -78,5 +78,5 @@ const Root = styled(Grid, {
|
|
|
78
78
|
*/
|
|
79
79
|
export default function CheckoutSkeleton(inProps) {
|
|
80
80
|
const { className = {} } = inProps, rest = __rest(inProps, ["className"]);
|
|
81
|
-
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className), container: true, width: "100%" }, rest, { children: [_jsx(Grid, Object.assign({ size: { md: 6 }, className: classNames(classes.left, classes.paper, classes.header) }, { children: _jsx(Skeleton, { variant: "rounded", height: 150, width:
|
|
81
|
+
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className), container: true, width: "100%" }, rest, { children: [_jsx(Grid, Object.assign({ size: { xs: 12, md: 6 }, className: classNames(classes.left, classes.paper, classes.header) }, { children: _jsx(Skeleton, { variant: "rounded", height: 150, width: "100%" }) })), _jsx(Grid, Object.assign({ size: { xs: 12, md: 6 }, className: classNames(classes.right, classes.header) }, { children: _jsxs(Stack, Object.assign({ sx: { display: { xs: 'none', md: 'flex' } }, direction: "column", spacing: 2, pt: 2 }, { children: [_jsx(Skeleton, { variant: "rounded", height: 20, width: 190 }), _jsx(Skeleton, { variant: "rounded", height: 90, width: "100%" })] })) })), _jsx(Grid, Object.assign({ size: { xs: 12, md: 6 }, className: classNames(classes.left, classes.paper) }, { children: _jsxs(Box, Object.assign({ className: classes.content }, { children: [_jsx(Skeleton, { variant: "rounded", height: 30, width: 140 }), _jsx("br", {}), _jsx(Skeleton, { variant: "rounded", height: 110 }), _jsx("br", {}), _jsx(Skeleton, { variant: "rounded", height: 150 }), _jsxs(Box, Object.assign({ sx: { display: { xs: 'none', md: 'block' } } }, { children: [_jsx("br", {}), _jsx(Skeleton, { variant: "rounded", height: 200 })] }))] })) })), _jsx(Grid, Object.assign({ size: { xs: 12, md: 6 }, className: classes.right }, { children: _jsxs(Box, Object.assign({ className: classes.content }, { children: [_jsx(Skeleton, { variant: "rounded", height: 110 }), _jsxs(Box, Object.assign({ sx: { display: { xs: 'none', md: 'block' } } }, { children: [_jsx("br", {}), _jsx(Skeleton, { variant: "rounded", height: 70 }), _jsx("br", {}), _jsx(Skeleton, { variant: "rounded", height: 340 })] }))] })) }))] })));
|
|
82
82
|
}
|
|
@@ -3,11 +3,10 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import Widget from '../Widget';
|
|
5
5
|
import { FormattedMessage } from 'react-intl';
|
|
6
|
-
import { Avatar, Icon, IconButton, Stack, useMediaQuery, useTheme, styled } from '@mui/material';
|
|
6
|
+
import { Avatar, Icon, IconButton, Stack, useMediaQuery, useTheme, styled, Button } from '@mui/material';
|
|
7
7
|
import { useSCUser } from '@selfcommunity/react-core';
|
|
8
8
|
import Editor from '../Editor';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
|
-
import { LoadingButton } from '@mui/lab';
|
|
11
10
|
import BaseItem from '../../shared/BaseItem';
|
|
12
11
|
import UserAvatar from '../../shared/UserAvatar';
|
|
13
12
|
import { useThemeProps } from '@mui/system';
|
|
@@ -131,5 +130,5 @@ export default function CommentObjectReply(inProps) {
|
|
|
131
130
|
// RENDER
|
|
132
131
|
return (_jsx(Root, Object.assign({ id: id }, rest, { disableTypography: true, onClick: handleEditorFocus, elevation: elevation, className: classNames(classes.root, className), image: showAvatar &&
|
|
133
132
|
(!scUserContext.user ? (_jsx(Avatar, { variant: "circular", className: classes.avatar })) : (_jsx(UserAvatar, Object.assign({ hide: !scUserContext.user.community_badge }, { children: _jsx(Avatar, { alt: scUserContext.user.username, variant: "circular", src: scUserContext.user.avatar, classes: { root: classes.avatar } }) })))), secondary: _jsxs(Widget, Object.assign({ className: classNames(classes.comment, { [classes.hasValue]: !isEditorEmpty }) }, WidgetProps, { children: [media && media.length > 0 && _jsx(PreviewComponent, { value: media, onChange: handleChangeMedias, className: classes.media }), _jsx(Editor, Object.assign({ ref: editor, onChange: handleChangeText, defaultValue: html, editable: editable, uploadImage: true, action: replyIcon &&
|
|
134
|
-
onReply && (_jsx(IconButton, Object.assign({ onClick: handleReply, className: classes.iconReply, disabled: uploadingMedia }, { children: _jsx(Icon, { children: "send" }) }))) }, EditorProps, { MediaPluginProps: { isUploading: setUploadingMedia, onMediaAdd: handleChangeMedia } })), !isEditorEmpty && (_jsxs(Stack, Object.assign({ direction: "row", spacing: 2, className: classes.actions }, { children: [onReply && !replyIcon && (_jsx(
|
|
133
|
+
onReply && (_jsx(IconButton, Object.assign({ onClick: handleReply, className: classes.iconReply, disabled: uploadingMedia }, { children: _jsx(Icon, { children: "send" }) }))) }, EditorProps, { MediaPluginProps: { isUploading: setUploadingMedia, onMediaAdd: handleChangeMedia } })), !isEditorEmpty && (_jsxs(Stack, Object.assign({ direction: "row", spacing: 2, className: classes.actions }, { children: [onReply && !replyIcon && (_jsx(Button, Object.assign({ variant: "outlined", size: "small", onClick: handleReply, loading: !editable, className: classes.buttonReply }, { children: _jsx(FormattedMessage, { id: "ui.commentObject.replyComment.reply", defaultMessage: "ui.commentObject.replyComment.reply" }) }))), onSave && (_jsxs(_Fragment, { children: [onCancel && (_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: handleCancel, disabled: !editable, color: "inherit", className: classes.buttonCancel }, { children: _jsx(FormattedMessage, { id: "ui.commentObject.replyComment.cancel", defaultMessage: "ui.commentObject.replyComment.cancel" }) }))), _jsx(Button, Object.assign({ variant: "outlined", size: "small", onClick: handleSave, loading: !editable, className: classes.buttonSave }, { children: _jsx(FormattedMessage, { id: "ui.commentObject.replyComment.save", defaultMessage: "ui.commentObject.replyComment.save" }) }))] }))] })))] })) })));
|
|
135
134
|
}
|
|
@@ -61,5 +61,5 @@ export default function CommunityPaywalls(inProps) {
|
|
|
61
61
|
if (loading) {
|
|
62
62
|
return _jsx(CommunityPaywallSkeleton, {});
|
|
63
63
|
}
|
|
64
|
-
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), container: true, width: "100%", spacing: 4 }, rest, { children: scCommunity.paywalls.map((p, i) => (_jsx(Grid, Object.assign({ size: { md: 4 } }, { children: _jsx(PaymentProduct, Object.assign({ paymentProduct: p, contentType: SCContentType.COMMUNITY, contentId: scCommunity.id }, (scCommunity.payment_order && { paymentOrder: scCommunity.payment_order, onUpdatePaymentOrder }), (scCommunity.payment_order && { paymentOrder: scCommunity.payment_order, onUpdatePaymentOrder }), (callbackUrl && { PaymentProductPriceComponentProps: { returnUrlParams: { callbackUrl } } }))) }), i))) })));
|
|
64
|
+
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), container: true, width: "100%", spacing: 4 }, rest, { children: scCommunity.paywalls.map((p, i) => (_jsx(Grid, Object.assign({ size: { xs: 12, md: 4 } }, { children: _jsx(PaymentProduct, Object.assign({ paymentProduct: p, contentType: SCContentType.COMMUNITY, contentId: scCommunity.id }, (scCommunity.payment_order && { paymentOrder: scCommunity.payment_order, onUpdatePaymentOrder }), (scCommunity.payment_order && { paymentOrder: scCommunity.payment_order, onUpdatePaymentOrder }), (callbackUrl && { PaymentProductPriceComponentProps: { returnUrlParams: { callbackUrl } } }))) }), i))) })));
|
|
65
65
|
}
|
|
@@ -5,10 +5,9 @@ import { SCContributionType, SCFeatureName, SCFeedTypologyType } from '@selfcomm
|
|
|
5
5
|
import { Endpoints, formatHttpErrorCode, http } from '@selfcommunity/api-services';
|
|
6
6
|
import { SCPreferences, UserUtils, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
|
|
7
7
|
import { FormattedMessage } from 'react-intl';
|
|
8
|
-
import { Alert, AlertTitle, Box, Dialog, DialogActions, DialogContent, DialogTitle, Fade, IconButton, Slide, useMediaQuery, Icon, styled, useTheme } from '@mui/material';
|
|
8
|
+
import { Alert, AlertTitle, Box, Dialog, DialogActions, DialogContent, DialogTitle, Fade, IconButton, Slide, useMediaQuery, Icon, styled, useTheme, Button } from '@mui/material';
|
|
9
9
|
import { COMPOSER_POLL_MIN_CHOICES, COMPOSER_TITLE_MAX_LENGTH, COMPOSER_TYPE_POLL } from '../../constants/Composer';
|
|
10
10
|
import { MEDIA_TYPE_SHARE } from '../../constants/Media';
|
|
11
|
-
import LoadingButton from '@mui/lab/LoadingButton';
|
|
12
11
|
import AudienceLayer from './Layer/AudienceLayer';
|
|
13
12
|
import { iOS, isClientSideRendering, random, stripHtml } from '@selfcommunity/utils';
|
|
14
13
|
import classNames from 'classnames';
|
|
@@ -693,7 +692,7 @@ export default function Composer(inProps) {
|
|
|
693
692
|
if (!scUserContext.user && !(scUserContext.loading && open)) {
|
|
694
693
|
return null;
|
|
695
694
|
}
|
|
696
|
-
return (_jsxs(Root, Object.assign({ ref: dialogRef, slots: { backdrop: BackdropScrollDisabled, transition: DialogTransition }, onClose: handleClose }, rest, { disableEscapeKeyDown: true, className: classNames(classes.root, { [classes.ios]: isIOS }), scroll: "body", fullScreen: fullScreen, tabIndex: -1 }, { children: [_jsxs("form", Object.assign({ onSubmit: handleSubmit, method: "post" }, { children: [_jsxs(DialogTitle, Object.assign({ className: classes.title }, { children: [_jsx(IconButton, Object.assign({ onClick: handleClosePrompt }, { children: _jsx(Icon, { children: "close" }) })), _jsx(
|
|
695
|
+
return (_jsxs(Root, Object.assign({ ref: dialogRef, slots: { backdrop: BackdropScrollDisabled, transition: DialogTransition }, onClose: handleClose }, rest, { disableEscapeKeyDown: true, className: classNames(classes.root, { [classes.ios]: isIOS }), scroll: "body", fullScreen: fullScreen, tabIndex: -1 }, { children: [_jsxs("form", Object.assign({ onSubmit: handleSubmit, method: "post" }, { children: [_jsxs(DialogTitle, Object.assign({ className: classes.title }, { children: [_jsx(IconButton, Object.assign({ onClick: handleClosePrompt }, { children: _jsx(Icon, { children: "close" }) })), _jsx(Button, Object.assign({ size: "small", type: "submit", color: "secondary", variant: "contained", disabled: !canSubmit, loading: isSubmitting }, { children: scheduledPostsEnabled && !scheduled_at ? (_jsx(FormattedMessage, { id: "ui.composer.submit.now", defaultMessage: "ui.composer.submit.now" })) : (_jsx(FormattedMessage, { id: "ui.composer.submit", defaultMessage: "ui.composer.submit" })) }))] })), _jsxs(DialogContent, Object.assign({ className: classes.content }, { children: [_jsx(Attributes, { value: { categories, event, group, addressing, recipients, location }, className: classes.attributes, onChange: handleChangeAttributes, onClick: handleClickAttributes }), content, medias && medias.length > 0 && (_jsx(Box, Object.assign({ className: classes.medias }, { children: mediaObjectTypes.map((mediaObjectType) => {
|
|
697
696
|
if (mediaObjectType.previewComponent) {
|
|
698
697
|
return _jsx(mediaObjectType.previewComponent, { value: medias, onChange: handleChangeMedias }, mediaObjectType.name);
|
|
699
698
|
}
|
|
@@ -7,15 +7,15 @@ import { ReactSortable } from 'react-sortablejs';
|
|
|
7
7
|
import { DatePicker, LocalizationProvider } from '@mui/x-date-pickers';
|
|
8
8
|
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
|
9
9
|
import { COMPOSER_POLL_MIN_CHOICES, COMPOSER_POLL_MIN_CLOSE_DATE_DELTA, COMPOSER_POLL_TITLE_MAX_LENGTH } from '../../../../constants/Composer';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import { it } from 'date-fns/locale/it';
|
|
11
|
+
import { enUS } from 'date-fns/locale/en-US';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
13
|
import { useThemeProps } from '@mui/system';
|
|
14
14
|
import { parseISO } from 'date-fns';
|
|
15
15
|
import { PREFIX } from '../../constants';
|
|
16
16
|
const localeMap = {
|
|
17
|
-
en:
|
|
18
|
-
it:
|
|
17
|
+
en: it,
|
|
18
|
+
it: enUS
|
|
19
19
|
};
|
|
20
20
|
const classes = {
|
|
21
21
|
root: `${PREFIX}-content-poll-root`,
|
|
@@ -3,10 +3,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import React, { useCallback, useState } from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl';
|
|
5
5
|
import { Box, Button, DialogTitle, IconButton, Typography, DialogContent, Icon, styled } from '@mui/material';
|
|
6
|
-
import { LocalizationProvider, StaticDateTimePicker, DateTimePickerTabs } from '@mui/x-date-pickers';
|
|
6
|
+
import { LocalizationProvider, StaticDateTimePicker, DateTimePickerTabs, usePickerContext } from '@mui/x-date-pickers';
|
|
7
7
|
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import { it } from 'date-fns/locale/it';
|
|
9
|
+
import { enUS } from 'date-fns/locale/en-US';
|
|
10
10
|
import { useSCContext } from '@selfcommunity/react-core';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import { format, parseISO } from 'date-fns';
|
|
@@ -29,7 +29,7 @@ const ScheduledLayer = React.forwardRef((props, ref) => {
|
|
|
29
29
|
const { className, onClose, onSave, defaultValue = null } = props, rest = __rest(props, ["className", "onClose", "onSave", "defaultValue"]);
|
|
30
30
|
//CONTEXT
|
|
31
31
|
const scContext = useSCContext();
|
|
32
|
-
const locale = scContext.settings.locale.default === 'it' ?
|
|
32
|
+
const locale = scContext.settings.locale.default === 'it' ? it : enUS;
|
|
33
33
|
// STATE
|
|
34
34
|
const [scheduledAt, setScheduledAt] = useState(defaultValue ? (typeof defaultValue === 'string' ? parseISO(defaultValue) : defaultValue) : null);
|
|
35
35
|
const handleUpdate = useCallback((value) => {
|
|
@@ -38,8 +38,8 @@ const ScheduledLayer = React.forwardRef((props, ref) => {
|
|
|
38
38
|
onSave(value);
|
|
39
39
|
}
|
|
40
40
|
}, [onSave]);
|
|
41
|
-
const CustomToolbar = (
|
|
42
|
-
const { value } =
|
|
41
|
+
const CustomToolbar = () => {
|
|
42
|
+
const { value } = usePickerContext();
|
|
43
43
|
if (!value)
|
|
44
44
|
return null;
|
|
45
45
|
const dayName = capitalize(format(value, 'EEEE', { locale }));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ButtonProps } from '@mui/material';
|
|
2
|
-
|
|
3
|
-
interface ActionButtonProps extends ButtonProps, Omit<LoadingButtonProps, 'classes'> {
|
|
2
|
+
interface ActionButtonProps extends ButtonProps, Omit<ButtonProps, 'classes'> {
|
|
4
3
|
labelId: string;
|
|
5
4
|
to?: string;
|
|
6
5
|
}
|
|
@@ -3,11 +3,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Button, Typography } from '@mui/material';
|
|
4
4
|
import { FormattedMessage } from 'react-intl';
|
|
5
5
|
import { Link } from '@selfcommunity/react-core';
|
|
6
|
-
import { LoadingButton } from '@mui/lab';
|
|
7
6
|
export default function ActionButton(props) {
|
|
8
7
|
const { labelId, to, size = 'small', color = 'primary', variant = 'contained' } = props, rest = __rest(props, ["labelId", "to", "size", "color", "variant"]);
|
|
9
8
|
if (to) {
|
|
10
9
|
return (_jsx(Button, Object.assign({ component: Link, to: to, size: size, color: color, variant: variant }, rest, { children: _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: labelId, defaultMessage: labelId }) })) })));
|
|
11
10
|
}
|
|
12
|
-
return (_jsx(
|
|
11
|
+
return (_jsx(Button, Object.assign({ size: size, color: color, variant: variant }, rest, { children: _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: labelId, defaultMessage: labelId }) })) })));
|
|
13
12
|
}
|
|
@@ -4,7 +4,6 @@ import { Fragment, memo, useCallback, useEffect, useMemo, useReducer, useState }
|
|
|
4
4
|
import { CacheStrategies, Logger } from '@selfcommunity/utils';
|
|
5
5
|
import { SCOPE_SC_UI } from '../../../constants/Errors';
|
|
6
6
|
import { FormattedDate, FormattedMessage } from 'react-intl';
|
|
7
|
-
import { LoadingButton } from '@mui/lab';
|
|
8
7
|
import { PREFIX } from '../constants';
|
|
9
8
|
import { DEFAULT_PAGINATION_OFFSET } from '../../../constants/Pagination';
|
|
10
9
|
import { actionWidgetTypes, dataWidgetReducer, stateWidgetInitializer } from '../../../utils/widget';
|
|
@@ -101,6 +100,6 @@ function Comments(props) {
|
|
|
101
100
|
if (!state.initialized) {
|
|
102
101
|
return _jsx(CommentsSkeleton, {});
|
|
103
102
|
}
|
|
104
|
-
return (_jsx(Box, Object.assign({ className: classes.container }, { children: state.count > 0 ? (_jsxs(Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.teacher.tab.comments.number", defaultMessage: "ui.course.dashboard.teacher.tab.comments.number", values: { commentsNumber: state.count } }) })), renderComments, isLoading && _jsx(CommentSkeleton, { id: 1 }), _jsx(
|
|
103
|
+
return (_jsx(Box, Object.assign({ className: classes.container }, { children: state.count > 0 ? (_jsxs(Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.teacher.tab.comments.number", defaultMessage: "ui.course.dashboard.teacher.tab.comments.number", values: { commentsNumber: state.count } }) })), renderComments, isLoading && _jsx(CommentSkeleton, { id: 1 }), _jsx(Button, Object.assign({ size: "small", variant: "outlined", color: "inherit", loading: isLoading, disabled: !state.next, onClick: handleNext }, { children: _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.teacher.tab.comments.btn.label", defaultMessage: "ui.course.dashboard.teacher.tab.comments.btn.label" }) })) }))] })) : (_jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.teacher.tab.comments.empty", defaultMessage: "ui.course.dashboard.teacher.tab.comments.empty" }) }))) })));
|
|
105
104
|
}
|
|
106
105
|
export default memo(Comments);
|
|
@@ -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 { Box, CardActionArea, Card, CardContent, FormGroup, Paper, TextField, Typography, Chip, styled } from '@mui/material';
|
|
3
|
+
import { Box, CardActionArea, Card, CardContent, FormGroup, Paper, TextField, Typography, Chip, styled, Button } from '@mui/material';
|
|
5
4
|
import { useThemeProps } from '@mui/system';
|
|
6
5
|
import { CourseService, formatHttpErrorCode } from '@selfcommunity/api-services';
|
|
7
6
|
import { SCPreferences, UserUtils, useSCPaymentsEnabled, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
|
|
@@ -289,7 +288,7 @@ export default function CourseForm(inProps) {
|
|
|
289
288
|
input: {
|
|
290
289
|
endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) ? COURSE_DESCRIPTION_MAX_LENGTH - field.description.length : COURSE_DESCRIPTION_MAX_LENGTH })))
|
|
291
290
|
}
|
|
292
|
-
}, error: Boolean((!!field.privacy && !field.description) || ((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > COURSE_DESCRIPTION_MAX_LENGTH), helperText: !!field.privacy && !field.description ? (_jsx(FormattedMessage, { id: "ui.courseForm.required", defaultMessage: "ui.courseForm.required" })) : (((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > COURSE_DESCRIPTION_MAX_LENGTH && (_jsx(FormattedMessage, { id: "ui.courseForm.description.error.maxLength", defaultMessage: "ui.courseForm.description.error.maxLength" }))) }), _jsx(CategoryAutocomplete, { defaultValue: field.categories, TextFieldProps: { label: intl.formatMessage(Object.keys(field.categories).length ? messages.category : messages.categoryEmpty) }, multiple: true, onChange: handleOnChangeCategory }), course && _jsx(CourseEdit, { course: course, onPrivacyChange: (privacy) => setField((prev) => (Object.assign(Object.assign({}, prev), { ['privacy']: privacy }))) }), isPaymentsEnabled && isStaff && !hidePaywalls && (_jsx(Box, Object.assign({ className: classes.paywallsConfiguratorWrap }, { children: _jsx(PaywallsConfigurator, Object.assign({}, (course && { contentId: course.id }), { contentType: SCContentType.COURSE, onChangeContentAccessType: handleChangeContentAccessType, onChangePaymentProducts: handleChangePaymentsProducts })) })))] }))] })), _jsx(Box, Object.assign({ className: classNames(classes.actions, _step === SCCourseFormStepType.CUSTOMIZATION && course ? classes.stepCustomization : undefined) }, { children: _jsx(
|
|
291
|
+
}, error: Boolean((!!field.privacy && !field.description) || ((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > COURSE_DESCRIPTION_MAX_LENGTH), helperText: !!field.privacy && !field.description ? (_jsx(FormattedMessage, { id: "ui.courseForm.required", defaultMessage: "ui.courseForm.required" })) : (((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > COURSE_DESCRIPTION_MAX_LENGTH && (_jsx(FormattedMessage, { id: "ui.courseForm.description.error.maxLength", defaultMessage: "ui.courseForm.description.error.maxLength" }))) }), _jsx(CategoryAutocomplete, { defaultValue: field.categories, TextFieldProps: { label: intl.formatMessage(Object.keys(field.categories).length ? messages.category : messages.categoryEmpty) }, multiple: true, onChange: handleOnChangeCategory }), course && _jsx(CourseEdit, { course: course, onPrivacyChange: (privacy) => setField((prev) => (Object.assign(Object.assign({}, prev), { ['privacy']: privacy }))) }), isPaymentsEnabled && isStaff && !hidePaywalls && (_jsx(Box, Object.assign({ className: classes.paywallsConfiguratorWrap }, { children: _jsx(PaywallsConfigurator, Object.assign({}, (course && { contentId: course.id }), { contentType: SCContentType.COURSE, onChangeContentAccessType: handleChangeContentAccessType, onChangePaymentProducts: handleChangePaymentsProducts })) })))] }))] })), _jsx(Box, Object.assign({ className: classNames(classes.actions, _step === SCCourseFormStepType.CUSTOMIZATION && course ? classes.stepCustomization : undefined) }, { children: _jsx(Button, Object.assign({ size: "small", loading: field.isSubmitting, disabled: _step === SCCourseFormStepType.GENERAL
|
|
293
292
|
? !field.type || Object.keys(error).length !== 0
|
|
294
293
|
: _step === SCCourseFormStepType.CUSTOMIZATION &&
|
|
295
294
|
(!field.name ||
|
|
@@ -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 { defineMessages } from 'react-intl';
|
|
11
10
|
const messages = defineMessages({
|
|
12
11
|
errorLoadImage: {
|
|
@@ -17,7 +16,7 @@ const messages = defineMessages({
|
|
|
17
16
|
const classes = {
|
|
18
17
|
root: `${PREFIX}-upload-course-cover-root`
|
|
19
18
|
};
|
|
20
|
-
const Root = styled(
|
|
19
|
+
const Root = styled(Button, {
|
|
21
20
|
name: PREFIX,
|
|
22
21
|
slot: 'UploadCourseCoverRoot'
|
|
23
22
|
})(() => ({}));
|
|
@@ -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, useSCFetchCourse, useSCUser } from '@selfcommunity/react-core';
|
|
7
7
|
import { SCCoursePrivacyType, SCCourseJoinStatusType } 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';
|
|
@@ -16,11 +15,11 @@ const PREFIX = 'SCCourseJoinButton';
|
|
|
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: (
|
|
23
|
-
})((
|
|
21
|
+
overridesResolver: (_props, styles) => styles.root
|
|
22
|
+
})(() => ({}));
|
|
24
23
|
/**
|
|
25
24
|
* > API documentation for the Community-JS Course Subscribe Button component. Learn about the available props and the CSS API.
|
|
26
25
|
|
|
@@ -204,7 +204,7 @@ export default function Courses(inProps) {
|
|
|
204
204
|
/**
|
|
205
205
|
* Renders courses list
|
|
206
206
|
*/
|
|
207
|
-
const c = (_jsxs(_Fragment, { children: [showFilters && (_jsx(Grid, Object.assign({ container: true, width: "100%", className: classes.filters, gap: 2 }, { children: filters ? (filters) : (_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.courses.filterByName", defaultMessage: "ui.courses.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
|
|
207
|
+
const c = (_jsxs(_Fragment, { children: [showFilters && (_jsx(Grid, Object.assign({ container: true, width: "100%", className: classes.filters, gap: 2 }, { children: filters ? (filters) : (_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.courses.filterByName", defaultMessage: "ui.courses.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
|
|
208
208
|
e.preventDefault();
|
|
209
209
|
if (e.key === 'Enter') {
|
|
210
210
|
fetchCourses();
|
|
@@ -215,11 +215,11 @@ export default function Courses(inProps) {
|
|
|
215
215
|
}
|
|
216
216
|
} }) })), authUserId && ((onlyStaffEnabled && canCreateCourse) || !onlyStaffEnabled) && (_jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(CoursesChipRoot, { color: showManagedCourses ? 'primary' : 'default', variant: showManagedCourses ? 'filled' : 'outlined', label: _jsx(FormattedMessage, { id: "ui.courses.filterByManagedByMe", defaultMessage: "ui.courses.filterByManagedByMe" }), onClick: () => setShowManagedCourses(!showManagedCourses),
|
|
217
217
|
// @ts-expect-error this is needed to use showMine into SCCourses
|
|
218
|
-
showManagedCourses: showManagedCourses, deleteIcon: showManagedCourses ? _jsx(Icon, { children: "close" }) : null, onDelete: showManagedCourses ? () => setShowManagedCourses(false) : null, disabled: loading || showMine }) }))), _jsx(Grid, Object.assign({ size: { md: 'auto' } }, { children: _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(CategoryAutocomplete, { onChange: handleOnChangeCategory, className: classes.category, size: "small", multiple: true }) })) })), authUserId && (_jsx(Grid, Object.assign({ size: { xs: 12 } }, { children: _jsx(CoursesChipRoot, { color: showMine ? 'primary' : 'default', variant: showMine ? 'filled' : 'outlined', label: _jsx(FormattedMessage, { id: "ui.courses.filterByMine", defaultMessage: "ui.courses.filterByMine" }), onClick: handleChipClick,
|
|
218
|
+
showManagedCourses: showManagedCourses, deleteIcon: showManagedCourses ? _jsx(Icon, { children: "close" }) : null, onDelete: showManagedCourses ? () => setShowManagedCourses(false) : null, disabled: loading || showMine }) }))), _jsx(Grid, Object.assign({ size: { xs: 12, md: 'auto' } }, { children: _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(CategoryAutocomplete, { onChange: handleOnChangeCategory, className: classes.category, size: "small", multiple: true }) })) })), authUserId && (_jsx(Grid, Object.assign({ size: { xs: 12 } }, { children: _jsx(CoursesChipRoot, { color: showMine ? 'primary' : 'default', variant: showMine ? 'filled' : 'outlined', label: _jsx(FormattedMessage, { id: "ui.courses.filterByMine", defaultMessage: "ui.courses.filterByMine" }), onClick: handleChipClick,
|
|
219
219
|
// @ts-expect-error this is needed to use showMine into SCCourses
|
|
220
220
|
showMine: showMine, deleteIcon: showMine ? _jsx(Icon, { children: "close" }) : null, onDelete: showMine ? handleDeleteClick : null, disabled: loading || showManagedCourses }) })))] })) }))), _jsx(_Fragment, { children: !courses.length ? (_jsx(Box, Object.assign({ className: classes.noResults }, { children: !canCreateCourse && onlyStaffEnabled ? (_jsxs(Stack, Object.assign({ className: classes.studentEmptyView }, { children: [_jsx(Stack, Object.assign({ className: classes.emptyBox }, { children: _jsx(Stack, Object.assign({ className: classes.emptyRotatedBox }, { children: _jsx(Icon, Object.assign({ className: classes.emptyIcon, color: "disabled", fontSize: "large" }, { children: "courses" })) })) })), _jsx(Typography, Object.assign({ variant: "h5", textAlign: "center" }, { children: _jsx(FormattedMessage, { id: "ui.courses.empty.title", defaultMessage: "ui.courses.empty.title" }) })), _jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: _jsx(FormattedMessage, { id: "ui.courses.empty.info", defaultMessage: "ui.courses.empty.info" }) }))] }))) : (_jsx(Box, Object.assign({ className: classes.teacherEmptyView }, { children: _jsx(Skeleton, Object.assign({ teacherView: (onlyStaffEnabled && canCreateCourse) || !onlyStaffEnabled, coursesNumber: 1 }, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps })) }))) }))) : (_jsx(InfiniteScroll, Object.assign({ dataLength: courses.length, next: handleNext, hasMoreNext: Boolean(next), loaderNext: isMobile ? (_jsx(CourseSkeleton, { template: SCCourseTemplateType.PREVIEW })) : (_jsx(Skeleton, Object.assign({ coursesNumber: 4 }, CoursesSkeletonComponentProps, { CourseSkeletonProps: CourseSkeletonComponentProps }))), endMessage: _jsx(Typography, Object.assign({ component: "div", className: classes.endMessage }, { children: _jsx(FormattedMessage, { id: "ui.courses.endMessage", defaultMessage: "ui.courses.endMessage", values: {
|
|
221
221
|
button: (chunk) => (_jsx(Button, Object.assign({ color: "secondary", variant: "text", onClick: handleScrollUp }, { children: chunk })))
|
|
222
|
-
} }) })) }, { children: _jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 3 }, className: classes.courses }, GridContainerComponentProps, { children: _jsxs(_Fragment, { children: [courses.map((course) => (_jsx(Grid, Object.assign({ size: { md: 6, lg: 3 }, className: classes.item }, GridItemComponentProps, { children: _jsx(Course, Object.assign({ courseId: course.id }, CourseComponentProps)) }), course.id))), authUserId && ((onlyStaffEnabled && canCreateCourse) || !onlyStaffEnabled) && courses.length % 2 !== 0 && (_jsx(Grid, Object.assign({ size: { md: 6, lg: 3 }, className: classes.itemPlaceholder }, GridItemComponentProps, { children: _jsx(CourseCreatePlaceholder, { CreateCourseButtonComponentProps: CreateCourseButtonComponentProps }) }), "placeholder-item"))] }) })) }))) })] }));
|
|
222
|
+
} }) })) }, { children: _jsx(Grid, Object.assign({ container: true, width: "100%", spacing: { xs: 3 }, className: classes.courses }, GridContainerComponentProps, { children: _jsxs(_Fragment, { children: [courses.map((course) => (_jsx(Grid, Object.assign({ size: { xs: 12, md: 6, lg: 3 }, className: classes.item }, GridItemComponentProps, { children: _jsx(Course, Object.assign({ courseId: course.id }, CourseComponentProps)) }), course.id))), authUserId && ((onlyStaffEnabled && canCreateCourse) || !onlyStaffEnabled) && courses.length % 2 !== 0 && (_jsx(Grid, Object.assign({ size: { xs: 12, md: 6, lg: 3 }, className: classes.itemPlaceholder }, GridItemComponentProps, { children: _jsx(CourseCreatePlaceholder, { CreateCourseButtonComponentProps: CreateCourseButtonComponentProps }) }), "placeholder-item"))] }) })) }))) })] }));
|
|
223
223
|
/**
|
|
224
224
|
* Renders root object (if content availability community option is false and user is anonymous, component is hidden)
|
|
225
225
|
*/
|
|
@@ -37,5 +37,5 @@ const Root = styled(Box, {
|
|
|
37
37
|
*/
|
|
38
38
|
export default function CoursesSkeleton(inProps) {
|
|
39
39
|
const { className, CourseSkeletonProps = {}, coursesNumber = 8, GridContainerComponentProps = {}, GridItemComponentProps = {}, teacherView = false } = inProps, rest = __rest(inProps, ["className", "CourseSkeletonProps", "coursesNumber", "GridContainerComponentProps", "GridItemComponentProps", "teacherView"]);
|
|
40
|
-
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.courses }, GridContainerComponentProps, { children: [...Array(coursesNumber)].map((_course, index) => (_jsx(Grid, Object.assign({ size: { md: 6, lg: 3 } }, GridItemComponentProps, { className: classes.item }, { children: teacherView ? _jsx(CourseCreatePlaceholder, {}) : _jsx(CourseSkeleton, Object.assign({}, CourseSkeletonProps)) }), index))) })) })));
|
|
40
|
+
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.courses }, GridContainerComponentProps, { children: [...Array(coursesNumber)].map((_course, index) => (_jsx(Grid, Object.assign({ size: { xs: 12, md: 6, lg: 3 } }, GridItemComponentProps, { className: classes.item }, { children: teacherView ? _jsx(CourseCreatePlaceholder, {}) : _jsx(CourseSkeleton, Object.assign({}, CourseSkeletonProps)) }), index))) })) })));
|
|
41
41
|
}
|
|
@@ -7,7 +7,6 @@ import { useThemeProps } from '@mui/system';
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useSCPaymentsEnabled } from '@selfcommunity/react-core';
|
|
9
9
|
import { PREFIX } from './constants';
|
|
10
|
-
import { LoadingButton } from '@mui/lab';
|
|
11
10
|
import { PaymentApiClient } from '@selfcommunity/api-services';
|
|
12
11
|
import { Logger } from '@selfcommunity/utils';
|
|
13
12
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
@@ -139,5 +138,5 @@ export default function CreatePaymentProductForm(inProps) {
|
|
|
139
138
|
startAdornment: _jsx(InputAdornment, Object.assign({ position: "start" }, { children: "\u20AC" })),
|
|
140
139
|
inputComponent: NumericFormatCustom
|
|
141
140
|
}
|
|
142
|
-
}, fullWidth: true, error: Boolean(fieldsError && fieldsError.unitAmount) }), error && (_jsx(Typography, Object.assign({ component: "div", className: classes.error, variant: "body2" }, { children: error }))), _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "flex-end", alignItems: "flex-end", spacing: 1 }, { children: [onCancel && (_jsx(Button, Object.assign({ variant: "text", size: "small", color: "inherit", onClick: onCancel }, { children: _jsx(FormattedMessage, { id: "ui.createPaymentProductForm.btn.cancel", defaultMessage: "ui.createPaymentProductForm.btn.cancel" }) }))), _jsx(
|
|
141
|
+
}, fullWidth: true, error: Boolean(fieldsError && fieldsError.unitAmount) }), error && (_jsx(Typography, Object.assign({ component: "div", className: classes.error, variant: "body2" }, { children: error }))), _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "flex-end", alignItems: "flex-end", spacing: 1 }, { children: [onCancel && (_jsx(Button, Object.assign({ variant: "text", size: "small", color: "inherit", onClick: onCancel }, { children: _jsx(FormattedMessage, { id: "ui.createPaymentProductForm.btn.cancel", defaultMessage: "ui.createPaymentProductForm.btn.cancel" }) }))), _jsx(Button, Object.assign({ loading: loading, variant: "contained", size: "small", color: "error", onClick: handleCreateProduct }, { children: _jsx(FormattedMessage, { id: "ui.createPaymentProductForm.btn.create", defaultMessage: "ui.createPaymentProductForm.btn.create" }) }))] }))] })));
|
|
143
142
|
}
|