@selfcommunity/react-ui 0.11.0-mui7.29 → 0.11.0-react-17.0.1.2
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 +2 -1
- package/lib/cjs/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +2 -1
- package/lib/cjs/components/AccountDataPortability/AccountDataPortability.js +11 -6
- package/lib/cjs/components/AccountDelete/AccountDelete.js +12 -5
- package/lib/cjs/components/AccountRecover/AccountRecover.js +4 -2
- package/lib/cjs/components/BroadcastMessages/Message.js +1 -1
- package/lib/cjs/components/BuyButton/BuyButton.js +5 -8
- package/lib/cjs/components/Categories/Categories.js +1 -1
- package/lib/cjs/components/Categories/Skeleton.js +1 -1
- package/lib/cjs/components/Categories/prefetchedCategories.js +115 -115
- package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.js +1 -3
- package/lib/cjs/components/CategoryFollowButton/CategoryFollowButton.js +4 -3
- package/lib/cjs/components/ChangeCover/ChangeCover.js +6 -2
- package/lib/cjs/components/ChangeGroupCover/ChangeGroupCover.js +2 -1
- package/lib/cjs/components/ChangeGroupPicture/ChangeGroupPicture.js +2 -1
- package/lib/cjs/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.js +8 -4
- package/lib/cjs/components/Checkout/Skeleton.js +3 -1
- package/lib/cjs/components/CheckoutReturnDialog/CheckoutReturnDialog.js +10 -10
- package/lib/cjs/components/CommentObjectReply/CommentObjectReply.js +3 -2
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js +2 -2
- package/lib/cjs/components/CommunityPaywalls/CommunityPaywalls.js +4 -3
- package/lib/cjs/components/CommunityPaywalls/Skeleton.d.ts +3 -3
- package/lib/cjs/components/CommunityPaywalls/Skeleton.js +3 -2
- package/lib/cjs/components/Composer/Composer.js +4 -3
- package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +3 -5
- package/lib/cjs/components/Composer/Content/ContentLesson/ContentLesson.js +2 -2
- package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.js +9 -13
- package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.js +2 -2
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +2 -4
- package/lib/cjs/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +6 -6
- package/lib/cjs/components/ConsentSolution/ConsentSolution.js +5 -12
- package/lib/cjs/components/ConsentSolution/Skeleton.js +1 -1
- package/lib/cjs/components/CourseCompletedDialog/CourseCompletedDialog.js +1 -1
- package/lib/cjs/components/CourseDashboard/Student/ActionButton.d.ts +2 -1
- package/lib/cjs/components/CourseDashboard/Student/ActionButton.js +2 -1
- package/lib/cjs/components/CourseDashboard/Teacher/Comments.js +2 -1
- package/lib/cjs/components/CourseForm/CourseForm.js +6 -9
- package/lib/cjs/components/CourseForm/Edit.js +2 -6
- package/lib/cjs/components/CourseForm/UploadCourseCover.js +2 -1
- package/lib/cjs/components/CourseJoinButton/CourseJoinButton.js +4 -3
- package/lib/cjs/components/Courses/Courses.d.ts +4 -0
- package/lib/cjs/components/Courses/Courses.js +10 -9
- package/lib/cjs/components/Courses/Skeleton.js +1 -1
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +1 -7
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +8 -5
- package/lib/cjs/components/CreatePaymentProductForm/CreatePaymentProductForm.js +5 -6
- package/lib/cjs/components/CustomAdv/Skeleton.js +1 -1
- package/lib/cjs/components/EditCourse/Lessons/ChangeLessonStatus.js +3 -2
- package/lib/cjs/components/EditCourse/Lessons/FieldName.js +2 -1
- package/lib/cjs/components/EditCourse/Options.js +2 -1
- package/lib/cjs/components/EditCourse/Status.js +1 -1
- package/lib/cjs/components/Editor/Editor.js +3 -3
- package/lib/cjs/components/Editor/plugins/EmojiPlugin.js +2 -4
- package/lib/cjs/components/Editor/plugins/FloatingLinkPlugin.js +4 -6
- package/lib/cjs/components/EventAutocomplete/EventAutocomplete.js +3 -5
- package/lib/cjs/components/EventForm/EventAddress.js +5 -9
- package/lib/cjs/components/EventForm/EventForm.js +51 -89
- package/lib/cjs/components/EventForm/UploadEventCover.js +2 -1
- package/lib/cjs/components/EventInfoWidget/index.d.ts +1 -1
- package/lib/cjs/components/EventInviteButton/EventInviteButton.js +2 -3
- package/lib/cjs/components/EventLocationWidget/EventLocationWidget.js +16 -5
- package/lib/cjs/components/EventLocationWidget/Skeleton.js +1 -1
- package/lib/cjs/components/EventMediaWidget/EventMediaWidget.js +2 -1
- package/lib/cjs/components/EventMediaWidget/TriggerButton.d.ts +2 -2
- package/lib/cjs/components/EventMediaWidget/TriggerButton.js +2 -1
- package/lib/cjs/components/EventMediaWidget/index.d.ts +1 -2
- package/lib/cjs/components/EventMembersWidget/index.d.ts +1 -1
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +4 -11
- package/lib/cjs/components/Events/Events.d.ts +4 -0
- package/lib/cjs/components/Events/Events.js +9 -14
- package/lib/cjs/components/Events/LocationEventsFilter.js +1 -5
- package/lib/cjs/components/Events/OngoingEventsFilter.js +2 -6
- package/lib/cjs/components/Events/PastEventsFilter.js +2 -6
- package/lib/cjs/components/Events/Skeleton.js +1 -1
- package/lib/cjs/components/Feed/Feed.js +10 -9
- package/lib/cjs/components/Feed/Skeleton.js +1 -1
- package/lib/cjs/components/FeedObject/Actions/Actions.js +3 -2
- package/lib/cjs/components/FeedObject/Actions/Comment/Comment.js +2 -2
- package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js +3 -2
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +2 -1
- package/lib/cjs/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +18 -20
- package/lib/cjs/components/FeedObject/Activities/RelevantActivities/CommentActivity/CommentActivity.js +1 -1
- package/lib/cjs/components/FeedObject/Activities/RelevantActivities/RelevantActivities.js +1 -1
- package/lib/cjs/components/FeedObject/Contributors/Contributors.js +1 -1
- package/lib/cjs/components/FeedObject/Contributors/Skeleton.js +1 -1
- package/lib/cjs/components/FeedObject/Poll/Choice/Choice.js +2 -1
- package/lib/cjs/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +1 -1
- package/lib/cjs/components/FollowUserButton/FollowUserButton.js +2 -1
- package/lib/cjs/components/FriendshipUserButton/FriendshipUserButton.js +3 -2
- package/lib/cjs/components/GroupActionsMenu/index.js +1 -9
- package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.js +3 -5
- package/lib/cjs/components/GroupForm/GroupForm.js +27 -16
- package/lib/cjs/components/GroupInfoWidget/GroupInfoWidget.js +15 -5
- package/lib/cjs/components/GroupInviteButton/GroupInviteButton.js +7 -8
- package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.js +4 -10
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +4 -3
- package/lib/cjs/components/Groups/Groups.js +9 -9
- package/lib/cjs/components/Groups/Skeleton.js +2 -1
- package/lib/cjs/components/Incubator/Incubator.js +4 -4
- package/lib/cjs/components/Incubator/Skeleton.js +1 -1
- package/lib/cjs/components/IncubatorDetail/IncubatorDetail.js +2 -2
- package/lib/cjs/components/IncubatorListWidget/CreateIncubatorDialog/CreateIncubatorDialog.js +4 -3
- package/lib/cjs/components/IncubatorListWidget/IncubatorListWidget.js +5 -5
- package/lib/cjs/components/IncubatorSubscribeButton/IncubatorSubscribeButton.js +4 -3
- package/lib/cjs/components/IncubatorSuggestionWidget/IncubatorSuggestionWidget.js +1 -1
- package/lib/cjs/components/InviteUserEventButton/InviteUserEventButton.js +2 -1
- package/lib/cjs/components/LessonAppbar/LessonAppbar.js +4 -3
- package/lib/cjs/components/LessonCommentObjects/LessonCommentObjects.js +1 -1
- package/lib/cjs/components/LessonEditForm/LessonEditForm.js +2 -1
- package/lib/cjs/components/LessonReleaseMenu/LessonReleaseMenu.js +16 -24
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +12 -15
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +8 -10
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.js +1 -5
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +3 -7
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +3 -3
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +3 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +1 -1
- package/lib/cjs/components/LocationAutocomplete/LocationAutocomplete.js +16 -17
- package/lib/cjs/components/LoyaltyProgramWidget/LoyaltyProgramWidget.js +1 -1
- package/lib/cjs/components/LoyaltyProgramWidget/Skeleton.js +1 -1
- package/lib/cjs/components/MyEventsWidget/index.d.ts +1 -1
- package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +1 -9
- package/lib/cjs/components/NavigationToolbar/NotificationMenu.js +5 -2
- package/lib/cjs/components/Notification/CollapsedFor/CollapsedFor.js +1 -3
- package/lib/cjs/components/Notification/Comment/Comment.js +3 -3
- package/lib/cjs/components/Notification/Contribution/Contribution.js +1 -1
- package/lib/cjs/components/Notification/ContributionFollow/ContributionFollow.js +2 -2
- package/lib/cjs/components/Notification/Course/Course.js +10 -5
- package/lib/cjs/components/Notification/DeletedFor/DeletedFor.js +2 -4
- package/lib/cjs/components/Notification/Event/Event.js +12 -7
- package/lib/cjs/components/Notification/Group/Group.js +4 -3
- package/lib/cjs/components/Notification/IncubatorApproved/IncubatorApproved.js +3 -3
- package/lib/cjs/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.js +1 -3
- package/lib/cjs/components/Notification/KindlyNoticeFor/KindlyNoticeFor.js +3 -5
- package/lib/cjs/components/Notification/LiveStream/LiveStream.js +9 -4
- package/lib/cjs/components/Notification/Mention/Mention.js +2 -2
- package/lib/cjs/components/Notification/Notification.js +9 -17
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js +5 -4
- package/lib/cjs/components/Notification/UndeletedFor/UndeletedFor.js +1 -1
- package/lib/cjs/components/Notification/UserBlocked/UserBlocked.js +2 -6
- package/lib/cjs/components/Notification/UserConnection/UserConnection.js +2 -6
- package/lib/cjs/components/Notification/UserFollow/UserFollow.js +2 -2
- package/lib/cjs/components/Notification/VoteUp/VoteUp.js +2 -2
- package/lib/cjs/components/OnBoardingWidget/ActionsButton.js +4 -12
- package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +27 -19
- package/lib/cjs/components/OnBoardingWidget/Skeleton.js +1 -1
- package/lib/cjs/components/OnBoardingWidget/Steps/App/App.js +25 -9
- package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/Appearance.js +14 -17
- package/lib/cjs/components/OnBoardingWidget/Steps/Category/Category.js +9 -3
- package/lib/cjs/components/PaymentDetailDialog/PaymentDetailDialog.js +5 -7
- package/lib/cjs/components/PaymentOrder/PaymentOrder.js +1 -1
- package/lib/cjs/components/PaymentOrders/PaymentOrders.js +26 -39
- package/lib/cjs/components/PaymentProduct/Skeleton.js +1 -1
- package/lib/cjs/components/PaymentProducts/Skeleton.js +1 -1
- package/lib/cjs/components/Paywalls/Skeleton.js +1 -1
- package/lib/cjs/components/PaywallsConfigurator/PaywallsConfigurator.js +5 -5
- package/lib/cjs/components/PaywallsConfigurator/Skeleton.js +1 -1
- package/lib/cjs/components/PaywallsDialog/PaywallsDialog.js +6 -8
- package/lib/cjs/components/PdfPreviewDialog/PdfPreviewDialog.js +1 -3
- package/lib/cjs/components/PlatformWidget/PlatformWidget.js +6 -6
- package/lib/cjs/components/PlatformWidget/Skeleton.js +1 -1
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +3 -3
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.js +1 -1
- package/lib/cjs/components/PrivateMessageEditor/MessageMediaUploader/index.js +2 -2
- package/lib/cjs/components/PrivateMessageEditor/PrivateMessageEditor.js +4 -6
- package/lib/cjs/components/PrivateMessageSettingsIconButton/PrivateMessageSettingsIconButton.js +1 -9
- package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.js +8 -10
- package/lib/cjs/components/PrivateMessageSnippets/Skeleton.js +1 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts +1 -1
- package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +7 -7
- package/lib/cjs/components/PrivateMessageThread/Skeleton.js +1 -1
- package/lib/cjs/components/RelatedEventsWidget/index.d.ts +1 -1
- package/lib/cjs/components/SearchAutocomplete/SearchAutocomplete.js +7 -9
- package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +5 -5
- package/lib/cjs/components/SuggestedEventsWidget/index.d.ts +1 -1
- package/lib/cjs/components/TagAutocomplete/TagAutocomplete.js +1 -3
- package/lib/cjs/components/UserActionIconButton/UserActionIconButton.js +8 -9
- package/lib/cjs/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +6 -4
- package/lib/cjs/components/UserAutocomplete/UserAutocomplete.js +4 -4
- package/lib/cjs/components/UserBillingInfo/Skeleton.js +1 -1
- package/lib/cjs/components/UserBillingInfo/UserBillingInfo.js +22 -30
- package/lib/cjs/components/UserChangeAddressDialog/UserChangeAddressDialog.js +2 -1
- package/lib/cjs/components/UserCounters/UserCounters.js +13 -5
- package/lib/cjs/components/UserInfo/UserInfo.js +1 -1
- package/lib/cjs/components/UserLiveStreamWidget/index.d.ts +1 -1
- package/lib/cjs/components/UserPaymentMethods/Skeleton.d.ts +3 -24
- package/lib/cjs/components/UserPaymentMethods/Skeleton.js +4 -2
- package/lib/cjs/components/UserPaymentMethods/UserPaymentMethods.d.ts +3 -25
- package/lib/cjs/components/UserPaymentMethods/UserPaymentMethods.js +9 -8
- package/lib/cjs/components/UserProfileBlocked/UserProfileBlocked.js +2 -1
- package/lib/cjs/components/UserProfileEdit/Section/AccountCredentials.js +7 -10
- package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.js +20 -9
- package/lib/cjs/components/UserProfileEdit/Skeleton.js +1 -1
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.d.ts +2 -2
- package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js +5 -4
- package/lib/cjs/components/VoteButton/VoteButton.d.ts +2 -2
- package/lib/cjs/components/VoteButton/VoteButton.js +3 -2
- package/lib/cjs/shared/AddUsersButton/AddUsersButton.js +2 -3
- package/lib/cjs/shared/ConfirmDialog/ConfirmDialog.js +2 -1
- package/lib/cjs/shared/ContributionActionsMenu/index.js +9 -3
- package/lib/cjs/shared/CopyTextArea/index.js +6 -13
- package/lib/cjs/shared/CourseUsersTable/ChangeUsersStatus.js +2 -1
- package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.js +5 -6
- package/lib/cjs/shared/CourseUsersTable/RemoveButton.js +2 -1
- package/lib/cjs/shared/CourseUsersTable/RequestButton.js +2 -1
- package/lib/cjs/shared/CustomSnackMessage/index.js +2 -2
- package/lib/cjs/shared/DateTimeAgo/index.js +2 -2
- package/lib/cjs/shared/EmojiPicker/EmojiPicker.d.ts +2 -1
- package/lib/cjs/shared/EventActionsMenu/index.js +1 -9
- package/lib/cjs/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +4 -3
- package/lib/cjs/shared/InfiniteScroll/stories/ScrolleableTop.js +1 -1
- package/lib/cjs/shared/LessonCommentActionsMenu/index.js +8 -2
- package/lib/cjs/shared/Lightbox/BaseLightbox.js +1 -1
- package/lib/cjs/shared/Media/File/DisplayComponent.js +6 -4
- package/lib/cjs/shared/Media/File/DocComponent.d.ts +0 -2
- package/lib/cjs/shared/Media/File/DocComponent.js +2 -3
- package/lib/cjs/shared/Media/File/PreviewComponent.js +3 -4
- package/lib/cjs/shared/Media/File/TriggerButton.js +1 -9
- package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/cjs/shared/Media/File/asUploadButton.js +1 -1
- package/lib/cjs/shared/Media/Link/DisplayComponent.js +12 -4
- package/lib/cjs/shared/Media/Link/UrlTextField/index.js +1 -3
- package/lib/cjs/shared/MessageChunkUploader/index.js +1 -1
- package/lib/cjs/shared/PasswordTextField/index.js +5 -7
- package/lib/cjs/shared/ScrollContainer/index.js +2 -2
- package/lib/cjs/shared/TagChip/index.d.ts +48 -2
- package/lib/cjs/shared/TagChip/index.js +2 -2
- package/lib/cjs/shared/Tags/index.js +1 -1
- package/lib/cjs/shared/UpScalingTierBadge/UpScalingTierBadge.d.ts +5 -0
- package/lib/cjs/shared/UpScalingTierBadge/UpScalingTierBadge.js +14 -0
- package/lib/cjs/shared/VirtualizedScroller/VirtualizedScroller.d.ts +1 -1
- package/lib/esm/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +3 -2
- package/lib/esm/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +3 -2
- package/lib/esm/components/AccountDataPortability/AccountDataPortability.js +12 -7
- package/lib/esm/components/AccountDelete/AccountDelete.js +13 -6
- package/lib/esm/components/AccountRecover/AccountRecover.js +4 -2
- package/lib/esm/components/BroadcastMessages/Message.js +1 -1
- package/lib/esm/components/BuyButton/BuyButton.js +6 -9
- package/lib/esm/components/Categories/Categories.js +1 -1
- package/lib/esm/components/Categories/Skeleton.js +1 -1
- package/lib/esm/components/Categories/prefetchedCategories.js +115 -115
- package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +2 -4
- package/lib/esm/components/CategoryFollowButton/CategoryFollowButton.js +5 -4
- package/lib/esm/components/ChangeCover/ChangeCover.js +6 -2
- package/lib/esm/components/ChangeGroupCover/ChangeGroupCover.js +3 -2
- package/lib/esm/components/ChangeGroupPicture/ChangeGroupPicture.js +3 -2
- package/lib/esm/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.js +8 -4
- package/lib/esm/components/Checkout/Skeleton.js +4 -2
- package/lib/esm/components/CheckoutReturnDialog/CheckoutReturnDialog.js +11 -11
- package/lib/esm/components/CommentObjectReply/CommentObjectReply.js +4 -3
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js +2 -2
- package/lib/esm/components/CommunityPaywalls/CommunityPaywalls.js +4 -3
- package/lib/esm/components/CommunityPaywalls/Skeleton.d.ts +3 -3
- package/lib/esm/components/CommunityPaywalls/Skeleton.js +3 -2
- package/lib/esm/components/Composer/Composer.js +5 -4
- package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +3 -5
- package/lib/esm/components/Composer/Content/ContentLesson/ContentLesson.js +2 -2
- package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.js +9 -13
- package/lib/esm/components/Composer/Content/ContentPost/ContentPost.js +2 -2
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +3 -5
- package/lib/esm/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +7 -7
- package/lib/esm/components/ConsentSolution/ConsentSolution.js +5 -12
- package/lib/esm/components/ConsentSolution/Skeleton.js +1 -1
- package/lib/esm/components/CourseCompletedDialog/CourseCompletedDialog.js +1 -1
- package/lib/esm/components/CourseDashboard/Student/ActionButton.d.ts +2 -1
- package/lib/esm/components/CourseDashboard/Student/ActionButton.js +2 -1
- package/lib/esm/components/CourseDashboard/Teacher/Comments.js +2 -1
- package/lib/esm/components/CourseForm/CourseForm.js +7 -10
- package/lib/esm/components/CourseForm/Edit.js +2 -6
- package/lib/esm/components/CourseForm/UploadCourseCover.js +3 -2
- package/lib/esm/components/CourseJoinButton/CourseJoinButton.js +5 -4
- package/lib/esm/components/Courses/Courses.d.ts +4 -0
- package/lib/esm/components/Courses/Courses.js +9 -9
- package/lib/esm/components/Courses/Skeleton.js +1 -1
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +1 -7
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +9 -6
- package/lib/esm/components/CreatePaymentProductForm/CreatePaymentProductForm.js +5 -6
- package/lib/esm/components/CustomAdv/Skeleton.js +1 -1
- package/lib/esm/components/EditCourse/Lessons/ChangeLessonStatus.js +4 -3
- package/lib/esm/components/EditCourse/Lessons/FieldName.js +3 -2
- package/lib/esm/components/EditCourse/Options.js +3 -2
- package/lib/esm/components/EditCourse/Status.js +1 -1
- package/lib/esm/components/Editor/Editor.js +3 -3
- package/lib/esm/components/Editor/plugins/EmojiPlugin.js +2 -4
- package/lib/esm/components/Editor/plugins/FloatingLinkPlugin.js +4 -6
- package/lib/esm/components/EventAutocomplete/EventAutocomplete.js +4 -6
- package/lib/esm/components/EventForm/EventAddress.js +5 -9
- package/lib/esm/components/EventForm/EventForm.js +53 -91
- package/lib/esm/components/EventForm/UploadEventCover.js +3 -2
- package/lib/esm/components/EventInfoWidget/index.d.ts +1 -1
- package/lib/esm/components/EventInviteButton/EventInviteButton.js +2 -3
- package/lib/esm/components/EventLocationWidget/EventLocationWidget.js +16 -5
- package/lib/esm/components/EventLocationWidget/Skeleton.js +1 -1
- package/lib/esm/components/EventMediaWidget/EventMediaWidget.js +2 -1
- package/lib/esm/components/EventMediaWidget/TriggerButton.d.ts +2 -2
- package/lib/esm/components/EventMediaWidget/TriggerButton.js +3 -2
- package/lib/esm/components/EventMediaWidget/index.d.ts +1 -2
- package/lib/esm/components/EventMembersWidget/index.d.ts +1 -1
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +4 -11
- package/lib/esm/components/Events/Events.d.ts +4 -0
- package/lib/esm/components/Events/Events.js +8 -14
- package/lib/esm/components/Events/LocationEventsFilter.js +1 -5
- package/lib/esm/components/Events/OngoingEventsFilter.js +2 -6
- package/lib/esm/components/Events/PastEventsFilter.js +2 -6
- package/lib/esm/components/Events/Skeleton.js +1 -1
- package/lib/esm/components/Feed/Feed.js +11 -10
- package/lib/esm/components/Feed/Skeleton.js +2 -2
- package/lib/esm/components/FeedObject/Actions/Actions.js +3 -2
- package/lib/esm/components/FeedObject/Actions/Comment/Comment.js +2 -2
- package/lib/esm/components/FeedObject/Actions/Follow/Follow.js +4 -3
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +2 -1
- package/lib/esm/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +18 -20
- package/lib/esm/components/FeedObject/Activities/RelevantActivities/CommentActivity/CommentActivity.js +1 -1
- package/lib/esm/components/FeedObject/Activities/RelevantActivities/RelevantActivities.js +1 -1
- package/lib/esm/components/FeedObject/Contributors/Contributors.js +1 -1
- package/lib/esm/components/FeedObject/Contributors/Skeleton.js +1 -1
- package/lib/esm/components/FeedObject/Poll/Choice/Choice.js +3 -2
- package/lib/esm/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +1 -1
- package/lib/esm/components/FollowUserButton/FollowUserButton.js +3 -2
- package/lib/esm/components/FriendshipUserButton/FriendshipUserButton.js +4 -3
- package/lib/esm/components/GroupActionsMenu/index.js +1 -9
- package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.js +4 -6
- package/lib/esm/components/GroupForm/GroupForm.js +28 -17
- package/lib/esm/components/GroupInfoWidget/GroupInfoWidget.js +15 -5
- package/lib/esm/components/GroupInviteButton/GroupInviteButton.js +7 -8
- package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.js +4 -10
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +5 -4
- package/lib/esm/components/Groups/Groups.js +9 -9
- package/lib/esm/components/Groups/Skeleton.js +2 -1
- package/lib/esm/components/Incubator/Incubator.js +4 -4
- package/lib/esm/components/Incubator/Skeleton.js +1 -1
- package/lib/esm/components/IncubatorDetail/IncubatorDetail.js +2 -2
- package/lib/esm/components/IncubatorListWidget/CreateIncubatorDialog/CreateIncubatorDialog.js +5 -4
- package/lib/esm/components/IncubatorListWidget/IncubatorListWidget.js +5 -5
- package/lib/esm/components/IncubatorSubscribeButton/IncubatorSubscribeButton.js +5 -4
- package/lib/esm/components/IncubatorSuggestionWidget/IncubatorSuggestionWidget.js +1 -1
- package/lib/esm/components/InviteUserEventButton/InviteUserEventButton.js +3 -2
- package/lib/esm/components/LessonAppbar/LessonAppbar.js +5 -4
- package/lib/esm/components/LessonCommentObjects/LessonCommentObjects.js +1 -1
- package/lib/esm/components/LessonEditForm/LessonEditForm.js +3 -2
- package/lib/esm/components/LessonReleaseMenu/LessonReleaseMenu.js +16 -24
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +13 -16
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +8 -10
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.js +1 -5
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +3 -7
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +3 -3
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +3 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +1 -1
- package/lib/esm/components/LocationAutocomplete/LocationAutocomplete.js +10 -11
- package/lib/esm/components/LoyaltyProgramWidget/LoyaltyProgramWidget.js +1 -1
- package/lib/esm/components/LoyaltyProgramWidget/Skeleton.js +1 -1
- package/lib/esm/components/MyEventsWidget/index.d.ts +1 -1
- package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +1 -9
- package/lib/esm/components/NavigationToolbar/NotificationMenu.js +5 -2
- package/lib/esm/components/Notification/CollapsedFor/CollapsedFor.js +1 -3
- package/lib/esm/components/Notification/Comment/Comment.js +3 -3
- package/lib/esm/components/Notification/Contribution/Contribution.js +1 -1
- package/lib/esm/components/Notification/ContributionFollow/ContributionFollow.js +2 -2
- package/lib/esm/components/Notification/Course/Course.js +11 -6
- package/lib/esm/components/Notification/DeletedFor/DeletedFor.js +2 -4
- package/lib/esm/components/Notification/Event/Event.js +13 -8
- package/lib/esm/components/Notification/Group/Group.js +5 -4
- package/lib/esm/components/Notification/IncubatorApproved/IncubatorApproved.js +3 -3
- package/lib/esm/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.js +1 -3
- package/lib/esm/components/Notification/KindlyNoticeFor/KindlyNoticeFor.js +3 -5
- package/lib/esm/components/Notification/LiveStream/LiveStream.js +10 -5
- package/lib/esm/components/Notification/Mention/Mention.js +2 -2
- package/lib/esm/components/Notification/Notification.js +10 -18
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js +6 -5
- package/lib/esm/components/Notification/UndeletedFor/UndeletedFor.js +1 -1
- package/lib/esm/components/Notification/UserBlocked/UserBlocked.js +2 -6
- package/lib/esm/components/Notification/UserConnection/UserConnection.js +2 -6
- package/lib/esm/components/Notification/UserFollow/UserFollow.js +2 -2
- package/lib/esm/components/Notification/VoteUp/VoteUp.js +2 -2
- package/lib/esm/components/OnBoardingWidget/ActionsButton.js +4 -12
- package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +28 -20
- package/lib/esm/components/OnBoardingWidget/Skeleton.js +1 -1
- package/lib/esm/components/OnBoardingWidget/Steps/App/App.js +25 -9
- package/lib/esm/components/OnBoardingWidget/Steps/Appearance/Appearance.js +14 -17
- package/lib/esm/components/OnBoardingWidget/Steps/Category/Category.js +9 -3
- package/lib/esm/components/PaymentDetailDialog/PaymentDetailDialog.js +6 -8
- package/lib/esm/components/PaymentOrder/PaymentOrder.js +1 -1
- package/lib/esm/components/PaymentOrders/PaymentOrders.js +26 -39
- package/lib/esm/components/PaymentProduct/Skeleton.js +1 -1
- package/lib/esm/components/PaymentProducts/Skeleton.js +1 -1
- package/lib/esm/components/Paywalls/Skeleton.js +1 -1
- package/lib/esm/components/PaywallsConfigurator/PaywallsConfigurator.js +4 -4
- package/lib/esm/components/PaywallsConfigurator/Skeleton.js +1 -1
- package/lib/esm/components/PaywallsDialog/PaywallsDialog.js +7 -9
- package/lib/esm/components/PdfPreviewDialog/PdfPreviewDialog.js +1 -3
- package/lib/esm/components/PlatformWidget/PlatformWidget.js +6 -6
- package/lib/esm/components/PlatformWidget/Skeleton.js +1 -1
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +3 -3
- package/lib/esm/components/PrivateMessageComponent/Skeleton.js +1 -1
- package/lib/esm/components/PrivateMessageEditor/MessageMediaUploader/index.js +2 -2
- package/lib/esm/components/PrivateMessageEditor/PrivateMessageEditor.js +4 -6
- package/lib/esm/components/PrivateMessageSettingsIconButton/PrivateMessageSettingsIconButton.js +1 -9
- package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.js +8 -10
- package/lib/esm/components/PrivateMessageSnippets/Skeleton.js +1 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts +1 -1
- package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +7 -7
- package/lib/esm/components/PrivateMessageThread/Skeleton.js +1 -1
- package/lib/esm/components/RelatedEventsWidget/index.d.ts +1 -1
- package/lib/esm/components/SearchAutocomplete/SearchAutocomplete.js +7 -9
- package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +5 -5
- package/lib/esm/components/SuggestedEventsWidget/index.d.ts +1 -1
- package/lib/esm/components/TagAutocomplete/TagAutocomplete.js +3 -5
- package/lib/esm/components/UserActionIconButton/UserActionIconButton.js +9 -10
- package/lib/esm/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +7 -5
- package/lib/esm/components/UserAutocomplete/UserAutocomplete.js +6 -6
- package/lib/esm/components/UserBillingInfo/Skeleton.js +1 -1
- package/lib/esm/components/UserBillingInfo/UserBillingInfo.js +22 -30
- package/lib/esm/components/UserChangeAddressDialog/UserChangeAddressDialog.js +2 -1
- package/lib/esm/components/UserCounters/UserCounters.js +13 -5
- package/lib/esm/components/UserInfo/UserInfo.js +1 -1
- package/lib/esm/components/UserLiveStreamWidget/index.d.ts +1 -1
- package/lib/esm/components/UserPaymentMethods/Skeleton.d.ts +3 -24
- package/lib/esm/components/UserPaymentMethods/Skeleton.js +4 -2
- package/lib/esm/components/UserPaymentMethods/UserPaymentMethods.d.ts +3 -25
- package/lib/esm/components/UserPaymentMethods/UserPaymentMethods.js +12 -11
- package/lib/esm/components/UserProfileBlocked/UserProfileBlocked.js +3 -2
- package/lib/esm/components/UserProfileEdit/Section/AccountCredentials.js +7 -10
- package/lib/esm/components/UserProfileEdit/Section/PublicInfo.js +23 -12
- package/lib/esm/components/UserProfileEdit/Skeleton.js +1 -1
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.d.ts +2 -2
- package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js +6 -5
- package/lib/esm/components/VoteButton/VoteButton.d.ts +2 -2
- package/lib/esm/components/VoteButton/VoteButton.js +4 -3
- package/lib/esm/shared/AddUsersButton/AddUsersButton.js +2 -3
- package/lib/esm/shared/ConfirmDialog/ConfirmDialog.js +2 -1
- package/lib/esm/shared/ContributionActionsMenu/index.js +9 -3
- package/lib/esm/shared/CopyTextArea/index.js +6 -13
- package/lib/esm/shared/CourseUsersTable/ChangeUsersStatus.js +3 -2
- package/lib/esm/shared/CourseUsersTable/CourseUsersTable.js +6 -7
- package/lib/esm/shared/CourseUsersTable/RemoveButton.js +3 -2
- package/lib/esm/shared/CourseUsersTable/RequestButton.js +3 -2
- package/lib/esm/shared/CustomSnackMessage/index.js +2 -2
- package/lib/esm/shared/DateTimeAgo/index.js +2 -2
- package/lib/esm/shared/EmojiPicker/EmojiPicker.d.ts +2 -1
- package/lib/esm/shared/EventActionsMenu/index.js +1 -9
- package/lib/esm/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +4 -3
- package/lib/esm/shared/InfiniteScroll/stories/ScrolleableTop.js +1 -1
- package/lib/esm/shared/LessonCommentActionsMenu/index.js +8 -2
- package/lib/esm/shared/Lightbox/BaseLightbox.js +1 -1
- package/lib/esm/shared/Media/File/DisplayComponent.js +6 -4
- package/lib/esm/shared/Media/File/DocComponent.d.ts +0 -2
- package/lib/esm/shared/Media/File/DocComponent.js +2 -3
- package/lib/esm/shared/Media/File/PreviewComponent.js +3 -4
- package/lib/esm/shared/Media/File/TriggerButton.js +1 -9
- package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/esm/shared/Media/File/asUploadButton.js +3 -3
- package/lib/esm/shared/Media/Link/DisplayComponent.js +13 -5
- package/lib/esm/shared/Media/Link/UrlTextField/index.js +1 -3
- package/lib/esm/shared/MessageChunkUploader/index.js +1 -1
- package/lib/esm/shared/PasswordTextField/index.js +5 -7
- package/lib/esm/shared/ScrollContainer/index.js +1 -1
- package/lib/esm/shared/TagChip/index.d.ts +48 -2
- package/lib/esm/shared/TagChip/index.js +2 -2
- package/lib/esm/shared/Tags/index.js +1 -1
- package/lib/esm/shared/UpScalingTierBadge/UpScalingTierBadge.d.ts +5 -0
- package/lib/esm/shared/UpScalingTierBadge/UpScalingTierBadge.js +10 -0
- package/lib/esm/shared/VirtualizedScroller/VirtualizedScroller.d.ts +1 -1
- package/lib/umd/155.js +2 -0
- package/lib/umd/155.js.LICENSE.txt +24 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +206 -207
- package/lib/cjs/components/EventLocationWidget/EventMap.d.ts +0 -8
- package/lib/cjs/components/EventLocationWidget/EventMap.js +0 -28
- package/lib/esm/components/EventLocationWidget/EventMap.d.ts +0 -8
- package/lib/esm/components/EventLocationWidget/EventMap.js +0 -25
- package/lib/umd/484.js +0 -2
- package/lib/umd/484.js.LICENSE.txt +0 -9
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
1
|
+
import { __awaiter, __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
4
5
|
import { useSCPaymentsEnabled, useSCUser } from '@selfcommunity/react-core';
|
|
5
6
|
import { useThemeProps } from '@mui/system';
|
|
6
7
|
import { PREFIX } from './constants';
|
|
7
8
|
import BaseDialog from '../../shared/BaseDialog';
|
|
8
9
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
9
10
|
import { loadStripe } from '@stripe/stripe-js';
|
|
10
|
-
import { Button, Paper, Stack,
|
|
11
|
+
import { Button, Paper, Stack, Typography } from '@mui/material';
|
|
11
12
|
import { AddressElement, PaymentElement, useElements } from '@stripe/react-stripe-js';
|
|
12
13
|
import { getDefaultLocale } from '../../utils/payment';
|
|
14
|
+
import { LoadingButton } from '@mui/lab';
|
|
13
15
|
import { useSnackbar } from 'notistack';
|
|
14
16
|
const classes = {
|
|
15
17
|
root: `${PREFIX}-root`,
|
|
@@ -53,7 +55,7 @@ export default function UserAddPaymentMethodForm(inProps) {
|
|
|
53
55
|
props: inProps,
|
|
54
56
|
name: PREFIX
|
|
55
57
|
});
|
|
56
|
-
const { className = null, customer, collectBillingAddress = false, handleSuccess, handleClose } = props;
|
|
58
|
+
const { className = null, customer, collectBillingAddress = false, handleSuccess, handleClose } = props, rest = __rest(props, ["className", "customer", "collectBillingAddress", "handleSuccess", "handleClose"]);
|
|
57
59
|
// CONTEXT
|
|
58
60
|
const scUserContext = useSCUser();
|
|
59
61
|
// STATE
|
|
@@ -129,10 +131,10 @@ export default function UserAddPaymentMethodForm(inProps) {
|
|
|
129
131
|
if (!isPaymentsEnabled || !scUserContext.user) {
|
|
130
132
|
return null;
|
|
131
133
|
}
|
|
132
|
-
return (_jsx(Root, Object.assign({ className: classes.root }, { children: _jsxs("form", Object.assign({ onSubmit: handleSubmit }, { children: [_jsx(PaymentElement, { id: "payment-element", options: paymentElementOptions, onReady: () => setReady(true) }), collectBillingAddress && (_jsx(Paper, Object.assign({ variant: "outlined", className: classes.address }, { children: Object.keys(addressState).length && !isEditingBillingAddress ? (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant:
|
|
134
|
+
return (_jsx(Root, Object.assign({ className: classes.root }, { children: _jsxs("form", Object.assign({ onSubmit: handleSubmit }, { children: [_jsx(PaymentElement, { id: "payment-element", options: paymentElementOptions, onReady: () => setReady(true) }), collectBillingAddress && (_jsx(Paper, Object.assign({ variant: "outlined", className: classes.address }, { children: Object.keys(addressState).length && !isEditingBillingAddress ? (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: 'body1' }, { children: addressState.name })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [addressState.address.line1, _jsx("br", {}), addressState.address.line2] })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [addressState.address.postal_code, " - ", addressState.address.city, " - ", addressState.address.country] })), _jsx(Button, Object.assign({ sx: { mt: 1 }, variant: 'contained', disabled: !elements, onClick: () => setIsEditingBillingAddress(!isEditingBillingAddress) }, { children: "Change" }))] })) : (_jsxs(_Fragment, { children: [_jsx(AddressElement, { onChange: (event) => {
|
|
133
135
|
setAddressState(event.value);
|
|
134
136
|
}, options: {
|
|
135
137
|
mode: 'billing',
|
|
136
138
|
defaultValues: addressState
|
|
137
|
-
} }), _jsx(Button, Object.assign({ sx: { mt: 1 }, variant:
|
|
139
|
+
} }), _jsx(Button, Object.assign({ sx: { mt: 1 }, variant: 'contained', disabled: !elements || loading || !ready, onClick: () => setIsEditingBillingAddress(!isEditingBillingAddress) }, { children: _jsx(FormattedMessage, { id: 'ui.userAddPaymentMethodForm.useDefaultMethod', defaultMessage: 'ui.userAddPaymentMethodForm.useDefaultMethod' }) }))] })) }))), _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "flex-end", alignItems: "center", spacing: 2, mt: 3 }, { children: [_jsx(Button, Object.assign({ onClick: onHandleClose, variant: "outlined" }, { children: _jsx(FormattedMessage, { id: "ui.userAddPaymentMethodForm.cancelButton", defaultMessage: "ui.userAddPaymentMethodForm.cancelButton" }) })), _jsx(LoadingButton, Object.assign({ disabled: !ready, loading: loading, type: "submit", variant: "contained" }, { children: _jsx(FormattedMessage, { id: "ui.userAddPaymentMethodForm.addButton", defaultMessage: "ui.userAddPaymentMethodForm.addButton" }) }))] })), errorMessage && _jsx("div", { children: errorMessage })] })) })));
|
|
138
140
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter, __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
3
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl';
|
|
5
5
|
import parse from 'autosuggest-highlight/parse';
|
|
6
6
|
import match from 'autosuggest-highlight/match';
|
|
@@ -106,10 +106,10 @@ const UserAutocomplete = (inProps) => {
|
|
|
106
106
|
const matches = match(option.username, inputValue);
|
|
107
107
|
const parts = parse(option.username, matches);
|
|
108
108
|
return (_jsxs(Box, Object.assign({ component: "li" }, props, { children: [_jsx(Avatar, { alt: option.username, src: option.avatar, sx: { marginRight: 1 } }), _jsx(React.Fragment, { children: parts.map((part, index) => (_jsx(Typography, { children: part.text }, index))) })] })));
|
|
109
|
-
}, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense",
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
icon: (chunks) => _jsx(Icon, { children: chunks }
|
|
109
|
+
}, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'off', endAdornment: filteredUsers.length > 0 ? (_jsxs(Fragment, { children: [isLoading && _jsx(CircularProgress, { color: "inherit", size: 20 }), params.InputProps.endAdornment] })) : null }) }))) }, rest)), _jsx(Typography, Object.assign({ variant: "body2", color: "primary", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userAutocomplete.textarea.info", defaultMessage: "ui.userAutocomplete.textarea.info", values: {
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
icon: (...chunks) => _jsx(Icon, { children: chunks })
|
|
113
113
|
} }) })), _jsx(TextField, { label: _jsx(FormattedMessage, { id: "ui.userAutocomplete.textarea.label", defaultMessage: "ui.userAutocomplete.textarea.label" }), multiline: true, minRows: 4, fullWidth: true, margin: "normal", value: textAreaValue, onChange: handleTextAreaChange })] })));
|
|
114
114
|
};
|
|
115
115
|
export default UserAutocomplete;
|
|
@@ -5,5 +5,5 @@ export default function UserBillingInfoSkeleton(props) {
|
|
|
5
5
|
if (props.mode === UserBillingInfoMode.READ) {
|
|
6
6
|
return (_jsxs(Box, { children: [_jsx(Skeleton, { variant: "rectangular", height: 15, width: 200, sx: { mb: 2 } }), _jsx(Skeleton, { variant: "rectangular", height: 15, width: 250, sx: { mb: 2 } }), _jsx(Skeleton, { variant: "rectangular", height: 15, width: 220, sx: { mb: 2 } }), _jsx(Skeleton, { variant: "rectangular", height: 15, width: 190, sx: { mb: 2 } })] }));
|
|
7
7
|
}
|
|
8
|
-
return (_jsxs(Grid, Object.assign({ container: true,
|
|
8
|
+
return (_jsxs(Grid, Object.assign({ container: true, spacing: 3 }, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6 }, { children: _jsx(Skeleton, { variant: "rectangular", height: 50 }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: 6, justifyContent: 'center' }, { children: _jsx(Skeleton, { variant: "rounded", height: 30, width: 100 }) }))] })));
|
|
9
9
|
}
|
|
@@ -12,6 +12,7 @@ import { reducer, getInitialState, actionTypes } from './reducer';
|
|
|
12
12
|
import { countries, COUNTRY_CODES } from '../../constants/Country';
|
|
13
13
|
import UserBillingInfoSkeleton from './Skeleton';
|
|
14
14
|
import Grow from '@mui/material/Grow';
|
|
15
|
+
import { LoadingButton } from '@mui/lab';
|
|
15
16
|
import { useSnackbar } from 'notistack';
|
|
16
17
|
// import {getCountryOption} from '../../utils/address';
|
|
17
18
|
import { useSCPaymentsEnabled, useSCUser } from '@selfcommunity/react-core';
|
|
@@ -68,7 +69,7 @@ const UserBillingInfo = (inProps, ref) => {
|
|
|
68
69
|
const scUserContext = useSCUser();
|
|
69
70
|
// STATE
|
|
70
71
|
const [state, dispatch] = useReducer(reducer, getInitialState({ mode }));
|
|
71
|
-
const [customer] = useState();
|
|
72
|
+
const [customer, setCustomer] = useState();
|
|
72
73
|
// HOOKS
|
|
73
74
|
const { isPaymentsEnabled } = useSCPaymentsEnabled();
|
|
74
75
|
const { enqueueSnackbar } = useSnackbar();
|
|
@@ -443,56 +444,47 @@ const UserBillingInfo = (inProps, ref) => {
|
|
|
443
444
|
if (!isPaymentsEnabled || !scUserContext.user) {
|
|
444
445
|
return null;
|
|
445
446
|
}
|
|
446
|
-
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), id: id }, rest, { ref: componentRef }, { children: _jsx(Fragment, { children: state.isLoading ? (_jsx(UserBillingInfoSkeleton, { mode: mode })) : (_jsx(Fragment, { children: state.mode === UserBillingInfoMode.READ ? (_jsxs(_Fragment, { children: [state.name ? (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant:
|
|
447
|
+
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), id: id }, rest, { ref: componentRef }, { children: _jsx(Fragment, { children: state.isLoading ? (_jsx(UserBillingInfoSkeleton, { mode: mode })) : (_jsx(Fragment, { children: state.mode === UserBillingInfoMode.READ ? (_jsxs(_Fragment, { children: [state.name ? (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: 'body1' }, { children: state.name })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [state.address_line1, _jsx("br", {}), state.address_line2] })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [state.address_postal_code, " - ", state.address_city, " - ", state.address_country && state.address_country.label] })), Boolean(state.tax_code && !state.isBusiness) && _jsx(Typography, Object.assign({ variant: 'body1' }, { children: state.tax_code })), state.isBusiness && (_jsxs(_Fragment, { children: [state.tax_id_data && _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: ["VAT: ", state.tax_id_data.value] })), state.sdi && _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: ["SDI: ", state.sdi] })), state.pec && _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: ["PEC: ", state.pec] }))] }))] })) : (_jsx(Typography, Object.assign({ variant: 'body1' }, { children: _jsx(FormattedMessage, { id: "ui.userBillingInfo.noInfo", defaultMessage: "ui.userBillingInfo.noInfo" }) }))), state.initialDataCompleted && (_jsx(Button, Object.assign({ sx: { mt: 1 }, variant: 'contained', size: 'small', disabled: Boolean(disableButtons), onClick: handleChangeViewMode }, { children: _jsx(FormattedMessage, { id: "component.CheckoutForm.billingInfoChangeButton", defaultMessage: "component.CheckoutForm.billingInfoChangeButton" }) })))] })) : (_jsx(Box, { children: _jsxs(Grid, Object.assign({ container: true, spacing: 3 }, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "name", name: "name", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.name", defaultMessage: "ui.userBillingInfo.name" }), onChange: handleChange('name'), value: state.name, error: Boolean(state.nameError), helperText: state.nameError, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "address_line1", name: "address_line1", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.address1", defaultMessage: "ui.userBillingInfo.address1" }), onChange: handleChange('address_line1'), value: state.address_line1, error: Boolean(state.addressLine1Error), helperText: state.addressLine1Error, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "address_line2", name: "address_line2", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.address2", defaultMessage: "ui.userBillingInfo.address2" }), onChange: handleChange('address_line2'), value: state.address_line2, error: Boolean(state.addressLine2Error), helperText: state.addressLine2Error, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(Autocomplete, { id: "country-select-demo", options: countries, value: state.address_country, fullWidth: true, onChange: handleChange('address_country'), getOptionLabel: (option) => option.label, renderOption: (props, option) => {
|
|
448
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
449
|
+
// @ts-ignore
|
|
447
450
|
const { key } = props, rest = __rest(props, ["key"]);
|
|
448
451
|
return (_jsxs(Box, Object.assign({ component: "li", sx: { '& > img': { mr: 2, flexShrink: 0 } } }, rest, { children: [_jsx("img", { loading: "lazy", width: "20", srcSet: `https://flagcdn.com/w40/${option.code.toLowerCase()}.png 2x`, src: `https://flagcdn.com/w20/${option.code.toLowerCase()}.png`, alt: "" }), option.label, " (", option.code, ")"] }), key));
|
|
449
|
-
}, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.country", defaultMessage: "ui.userBillingInfo.country" }), fullWidth: true, id: "address_country", name: "address_country", error: Boolean(state.addressCountryError),
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "public" }) })))
|
|
458
|
-
}
|
|
459
|
-
}, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "phone", name: "phone", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.phone", defaultMessage: "ui.userBillingInfo.phone" }), onChange: handleChange('phone'), value: state.phone, error: Boolean(state.phoneError), helperText: state.phoneError, slotProps: {
|
|
460
|
-
input: {
|
|
461
|
-
startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "person" }) })))
|
|
462
|
-
}
|
|
463
|
-
}, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "tax_code", name: "tax_code", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxCode", defaultMessage: "ui.userBillingInfo.taxCode" }), onChange: handleChange('tax_code'), value: state.tax_code, error: Boolean(state.taxCodeError), helperText: state.taxCodeError, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(FormGroup, { children: _jsx(FormControlLabel, { disabled: Boolean(disableButtons), control: _jsx(Checkbox, Object.assign({ checked: state.isBusiness }, ((state.taxIdDataError || state.sdiError || state.pecError) && { color: 'secondary' }), { className: classNames({
|
|
452
|
+
}, renderInput: (params) => (_jsx(TextField, Object.assign({}, params, { label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.country", defaultMessage: "ui.userBillingInfo.country" }), fullWidth: true, id: "address_country", name: "address_country", error: Boolean(state.addressCountryError), InputProps: Object.assign(Object.assign({}, params.InputProps), (state.address_country && {
|
|
453
|
+
startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx("img", { loading: "lazy", width: "20", srcSet: `https://flagcdn.com/w40/${state.address_country.code.toLowerCase()}.png 2x`, src: `https://flagcdn.com/w20/${state.address_country.code.toLowerCase()}.png`, alt: "" }) })))
|
|
454
|
+
})), inputProps: Object.assign(Object.assign({}, params.inputProps), { autoComplete: 'new-password' // disable autocomplete and autofill
|
|
455
|
+
}) }))) }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "address_state", name: "address_state", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.state", defaultMessage: "ui.userBillingInfo.state" }), onChange: handleChange('address_state'), value: state.address_state, error: Boolean(state.addressStateError), helperText: state.addressStateError, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "address_postal_code", name: "address_postal_code", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.postalCode", defaultMessage: "ui.userBillingInfo.postalCode" }), onChange: handleChange('address_postal_code'), value: state.address_postal_code, error: Boolean(state.addressPostalCodeError), helperText: state.addressPostalCodeError, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "address_city", name: "address_city", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.city", defaultMessage: "ui.userBillingInfo.city" }), onChange: handleChange('address_city'), value: state.address_city, error: Boolean(state.addressCityError), helperText: state.addressCityError, InputProps: {
|
|
456
|
+
startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "public" }) })))
|
|
457
|
+
}, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "phone", name: "phone", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.phone", defaultMessage: "ui.userBillingInfo.phone" }), onChange: handleChange('phone'), value: state.phone, error: Boolean(state.phoneError), helperText: state.phoneError, InputProps: {
|
|
458
|
+
startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "person" }) })))
|
|
459
|
+
}, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "tax_code", name: "tax_code", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxCode", defaultMessage: "ui.userBillingInfo.taxCode" }), onChange: handleChange('tax_code'), value: state.tax_code, error: Boolean(state.taxCodeError), helperText: state.taxCodeError, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12 }, { children: _jsx(FormGroup, { children: _jsx(FormControlLabel, { disabled: Boolean(disableButtons), control: _jsx(Checkbox, Object.assign({ checked: state.isBusiness }, ((state.taxIdDataError || state.sdiError || state.pecError) && { color: 'secondary' }), { className: classNames({
|
|
464
460
|
[classes.error]: state.taxIdDataError || state.sdiError || state.pecError
|
|
465
461
|
}), onChange: handleSetBusiness })), label: _jsx("span", Object.assign({ className: classNames({
|
|
466
462
|
[classes.error]: state.taxIdDataError || state.sdiError || state.pecError
|
|
467
463
|
}) }, { children: intl.formatMessage({
|
|
468
464
|
id: 'component.billingInfo.accountBusiness',
|
|
469
465
|
defaultMessage: 'component.billingInfo.accountBusiness'
|
|
470
|
-
}) })) }) }) })), state.isBusiness && (_jsx(Grow, Object.assign({ in: state.isBusiness }, { children: _jsx(Grid, Object.assign({
|
|
466
|
+
}) })) }) }) })), state.isBusiness && (_jsx(Grow, Object.assign({ in: state.isBusiness }, { children: _jsx(Grid, Object.assign({ item: true, xs: 12 }, { children: _jsxs(Grid, Object.assign({ container: true, spacing: 3 }, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "tax_id_data", name: "tax_id_data", label: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxId", defaultMessage: "ui.userBillingInfo.taxId" }), onChange: handleChange('tax_id_data'), value: state.tax_id_data ? state.tax_id_data.value : null, error: Boolean(state.taxIdDataError), helperText: `${state.taxIdDataError ? state.taxIdDataError : ''} ${state.address_country && state.address_country.code && VAT_EXAMPLE[state.address_country.code]
|
|
471
467
|
? intl.formatMessage({
|
|
472
468
|
id: 'component.billingInfo.requiredFormat',
|
|
473
469
|
defaultMessage: 'component.billingInfo.requiredFormat'
|
|
474
470
|
}) + VAT_EXAMPLE[state.address_country.code]
|
|
475
471
|
: ''}`, placeholder: state.address_country && state.address_country.code && VAT_EXAMPLE[state.address_country.code]
|
|
476
472
|
? VAT_EXAMPLE[state.address_country.code]
|
|
477
|
-
: '',
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
}, fullWidth: true }) })), _jsx(Grid, Object.assign({ size: { xs: 12, sm: inlineDisplay ? 12 : 6 } }, { children: _jsx(TextField, { variant: "outlined", id: "sdi", name: "sdi", label: `${intl.formatMessage({ id: 'component.billingInfo.sdi', defaultMessage: 'component.billingInfo.sdi' })} ${((_a = state.address_country) === null || _a === void 0 ? void 0 : _a.code) === COUNTRY_CODES.IT
|
|
473
|
+
: '', InputProps: {
|
|
474
|
+
endAdornment: state.taxIdVerificationStatus !== null && (_jsx(InputAdornment, Object.assign({ position: "end" }, { children: state.taxIdVerificationStatus === 'verified' ? (_jsx(Icon, Object.assign({ color: "primary" }, { children: "done" }))) : state.taxIdVerificationStatus === 'pending' ? (_jsx(Tooltip, Object.assign({ id: "tooltip-warning", title: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxCheckPending", defaultMessage: "ui.userBillingInfo.taxCheckPending" }), enterDelay: 300, leaveDelay: 300, placement: "top" }, { children: _jsx(Icon, Object.assign({ color: "warning" }, { children: "help" })) }))) : (_jsx(Tooltip, Object.assign({ id: "tooltip-warning", title: _jsx(FormattedMessage, { id: "ui.userBillingInfo.taxCheckWarning", defaultMessage: "ui.userBillingInfo.taxCheckWarning" }), enterDelay: 300, leaveDelay: 300, placement: "top" }, { children: _jsx(Icon, Object.assign({ color: "warning" }, { children: "help" })) }))) })))
|
|
475
|
+
}, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "sdi", name: "sdi", label: `${intl.formatMessage({ id: 'component.billingInfo.sdi', defaultMessage: 'component.billingInfo.sdi' })} ${((_a = state.address_country) === null || _a === void 0 ? void 0 : _a.code) === COUNTRY_CODES.IT
|
|
482
476
|
? intl.formatMessage({
|
|
483
477
|
id: 'component.billingInfo.field.optional',
|
|
484
478
|
defaultMessage: 'component.billingInfo.field.optional'
|
|
485
479
|
})
|
|
486
|
-
: ''}`, onChange: handleChange('sdi'), value: state.sdi, error: Boolean(state.sdiError), helperText: state.sdiError, fullWidth: true }) })), _jsx(Grid, Object.assign({
|
|
480
|
+
: ''}`, onChange: handleChange('sdi'), value: state.sdi, error: Boolean(state.sdiError), helperText: state.sdiError, fullWidth: true }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, sm: inlineDisplay ? 12 : 6 }, { children: _jsx(TextField, { variant: "outlined", id: "pec", name: "pec", label: `${intl.formatMessage({ id: 'component.billingInfo.pec', defaultMessage: 'component.billingInfo.pec' })} ${((_b = state.address_country) === null || _b === void 0 ? void 0 : _b.code) === COUNTRY_CODES.IT
|
|
487
481
|
? intl.formatMessage({
|
|
488
482
|
id: 'component.billingInfo.field.optional',
|
|
489
483
|
defaultMessage: 'component.billingInfo.field.optional'
|
|
490
484
|
})
|
|
491
|
-
: ''}`, onChange: handleChange('pec'), value: state.pec, error: Boolean(state.pecError), helperText: state.pecError,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
}
|
|
496
|
-
}, fullWidth: true }) }))] })) })) }))), state.error && (_jsx(Grid, Object.assign({ size: "grow" }, { children: _jsx(Typography, Object.assign({ align: "left", color: "secondary" }, { children: state.error })) }))), _jsx(Grid, Object.assign({ size: "grow" }, { children: _jsxs(Typography, Object.assign({ align: "left" }, { children: [_jsx(Button, Object.assign({ variant: "contained", size: "small", color: "primary", disabled: state.isProcessing || Boolean(disableButtons), loading: state.isProcessing, onClick: handleSubmit }, { children: buttonLabel })), onBack && state.initialDataCompleted && (_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: handleBack, disabled: Boolean(disableButtons) }, { children: _jsx(FormattedMessage, { id: "ui.userBillingInfo.back", defaultMessage: "ui.userBillingInfo.back" }) })))] })) }))] })) })) })) }) })));
|
|
485
|
+
: ''}`, onChange: handleChange('pec'), value: state.pec, error: Boolean(state.pecError), helperText: state.pecError, InputProps: {
|
|
486
|
+
type: 'email',
|
|
487
|
+
startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(Icon, { children: "email" }) })))
|
|
488
|
+
}, fullWidth: true }) }))] })) })) }))), state.error && (_jsx(Grid, Object.assign({ item: true, xs: 12 }, { children: _jsx(Typography, Object.assign({ align: "left", color: "secondary" }, { children: state.error })) }))), _jsx(Grid, Object.assign({ item: true, xs: 12 }, { children: _jsxs(Typography, Object.assign({ align: "left" }, { children: [_jsx(LoadingButton, Object.assign({ variant: "contained", size: "small", color: "primary", disabled: state.isProcessing || Boolean(disableButtons), loading: state.isProcessing, onClick: handleSubmit }, { children: buttonLabel })), onBack && state.initialDataCompleted && (_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: handleBack, disabled: Boolean(disableButtons) }, { children: _jsx(FormattedMessage, { id: "ui.userBillingInfo.back", defaultMessage: "ui.userBillingInfo.back" }) })))] })) }))] })) })) })) }) })));
|
|
497
489
|
};
|
|
498
490
|
export default forwardRef(UserBillingInfo);
|
|
@@ -9,6 +9,7 @@ import { useThemeProps } from '@mui/system';
|
|
|
9
9
|
import { PREFIX } from './constants';
|
|
10
10
|
import BaseDialog from '../../shared/BaseDialog';
|
|
11
11
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
12
|
+
import { LoadingButton } from '@mui/lab';
|
|
12
13
|
import { AddressElement, Elements } from '@stripe/react-stripe-js';
|
|
13
14
|
import { loadStripe } from '@stripe/stripe-js';
|
|
14
15
|
import { getDefaultAppearanceStyle, getDefaultLocale } from '../../utils/payment';
|
|
@@ -74,7 +75,7 @@ export default function UserChangeAddressDialog(inProps) {
|
|
|
74
75
|
if (!isPaymentsEnabled || !scUserContext.user) {
|
|
75
76
|
return null;
|
|
76
77
|
}
|
|
77
|
-
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), title: _jsx(FormattedMessage, { defaultMessage: "ui.userChangeAddressDialog.title", id: "component.userChangeAddressDialog.title" }), open: open, actions: _jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ variant:
|
|
78
|
+
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), title: _jsx(FormattedMessage, { defaultMessage: "ui.userChangeAddressDialog.title", id: "component.userChangeAddressDialog.title" }), open: open, actions: _jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ variant: 'outlined', onClick: handleClose }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.userChangeAddressDialog.btnClose", id: "component.userChangeAddressDialog.btnClose" }) })), _jsx(LoadingButton, Object.assign({ loading: loading, disabled: loading, variant: 'contained', onClick: handleSave }, { children: _jsx(FormattedMessage, { defaultMessage: "ui.userChangeAddressDialog.btnSave", id: "component.userChangeAddressDialog.btnSave" }) }))] }) }, rest, { children: _jsx(Elements, Object.assign({ stripe: stripePromise, options: elementsOptions }, { children: _jsx(AddressElement, { onChange: handleChangeAddress, options: {
|
|
78
79
|
mode: 'billing',
|
|
79
80
|
defaultValues: addressState
|
|
80
81
|
} }) })) })));
|
|
@@ -16,7 +16,7 @@ const classes = {
|
|
|
16
16
|
const Root = styled(Box, {
|
|
17
17
|
name: PREFIX,
|
|
18
18
|
slot: 'Root',
|
|
19
|
-
overridesResolver: (
|
|
19
|
+
overridesResolver: (props, styles) => styles.root
|
|
20
20
|
})(() => ({}));
|
|
21
21
|
/**
|
|
22
22
|
* > API documentation for the Community-JS User Counters component. Learn about the available props and the CSS API.
|
|
@@ -91,15 +91,23 @@ export default function UserCounters(inProps) {
|
|
|
91
91
|
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(_Fragment, { children: (followEnabled || connectionEnabled) &&
|
|
92
92
|
(followEnabled ? (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ className: classes.button, variant: "text", component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_FOLLOWINGS_ROUTE_NAME, scUser) }, { children: _jsx(FormattedMessage, { id: "ui.userCounters.followings", defaultMessage: "ui.userCounters.followings", values: {
|
|
93
93
|
count: scUser === null || scUser === void 0 ? void 0 : scUser.followings_counter,
|
|
94
|
-
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
95
|
+
// @ts-ignore
|
|
96
|
+
b: (chunks) => _jsx("strong", { children: chunks })
|
|
95
97
|
} }) })), _jsx(Bullet, {}), _jsx(Button, Object.assign({ className: classes.button, variant: "text", component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_FOLLOWERS_ROUTE_NAME, scUser) }, { children: _jsx(FormattedMessage, { id: "ui.userCounters.followers", defaultMessage: "ui.userCounters.followers", values: {
|
|
96
98
|
count: scUser === null || scUser === void 0 ? void 0 : scUser.followers_counter,
|
|
97
|
-
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
100
|
+
// @ts-ignore
|
|
101
|
+
b: (chunks) => _jsx("strong", { children: chunks })
|
|
98
102
|
} }) }))] })) : (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ className: classes.button, variant: "text", component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_CONNECTIONS_ROUTE_NAME, scUser) }, { children: _jsx(FormattedMessage, { id: "ui.userCounters.connections", defaultMessage: "ui.userCounters.connections", values: {
|
|
99
103
|
count: scUser === null || scUser === void 0 ? void 0 : scUser.connections_counter,
|
|
100
|
-
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
105
|
+
// @ts-ignore
|
|
106
|
+
b: (chunks) => _jsx("strong", { children: chunks })
|
|
101
107
|
} }) })), _jsx(Bullet, {})] }))) }), categoryFollowEnabled && (_jsx(Button, Object.assign({ className: classes.button, variant: "text", component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_CATEGORIES_ROUTE_NAME, scUser) }, { children: _jsx(FormattedMessage, { id: "ui.userCounters.categories", defaultMessage: "ui.userCounters.categories", values: {
|
|
102
108
|
count: scUser === null || scUser === void 0 ? void 0 : scUser.categories_counter,
|
|
103
|
-
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
b: (chunks) => _jsx("strong", { children: chunks })
|
|
104
112
|
} }) })))] })));
|
|
105
113
|
}
|
|
@@ -120,7 +120,7 @@ export default function UserInfo(inProps) {
|
|
|
120
120
|
case SCUserProfileFields.DATE_OF_BIRTH:
|
|
121
121
|
return `${intl.formatDate(user[field], { year: 'numeric', month: 'numeric', day: 'numeric' })}`;
|
|
122
122
|
case SCUserProfileFields.TAGS:
|
|
123
|
-
return (_jsx(Tags, { tags: user.tags.filter((t) => t.visible), type: TagsComponentType.LIST, direction:
|
|
123
|
+
return (_jsx(Tags, { tags: user.tags.filter((t) => t.visible), type: TagsComponentType.LIST, direction: 'row', TagChipProps: { clickable: false, disposable: false } }));
|
|
124
124
|
case SCUserProfileFields.WEBSITE:
|
|
125
125
|
return (_jsx("a", Object.assign({ href: user[field], target: '_blank' }, { children: user[field] })));
|
|
126
126
|
default:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import UserLiveStreamWidget, { UserLiveStreamWidgetProps } from './UserLiveStreamWidget';
|
|
2
2
|
import UserLiveStreamWidgetSkeleton from './Skeleton';
|
|
3
3
|
export default UserLiveStreamWidget;
|
|
4
|
-
export { UserLiveStreamWidgetSkeleton, UserLiveStreamWidgetProps };
|
|
4
|
+
export { UserLiveStreamWidgetSkeleton, type UserLiveStreamWidgetProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface UserPaymentMethodsSkeletonProps {
|
|
3
3
|
/**
|
|
4
4
|
* Overrides or extends the styles applied to the component.
|
|
@@ -11,26 +11,5 @@ export interface UserPaymentMethodsSkeletonProps {
|
|
|
11
11
|
showBillingAddress?: boolean;
|
|
12
12
|
}
|
|
13
13
|
export type UserPaymentMethodsSkeletonRef = {};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
#### Import
|
|
18
|
-
|
|
19
|
-
```jsx
|
|
20
|
-
import {UserPaymentMethodsSkeleton} from '@selfcommunity/react-ui';
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
#### Component Name
|
|
24
|
-
|
|
25
|
-
The name `SCUserPaymentMethodsSkeleton-skeleton-root` can be used when providing style overrides in the theme.
|
|
26
|
-
|
|
27
|
-
#### CSS
|
|
28
|
-
|
|
29
|
-
|Rule Name|Global class|Description|
|
|
30
|
-
|---|---|---|
|
|
31
|
-
|root|.SCUserPaymentMethodsSkeleton-skeleton-root|Styles applied to the root element.|
|
|
32
|
-
*
|
|
33
|
-
* @param inProps
|
|
34
|
-
*/
|
|
35
|
-
declare const UserPaymentMethodsSkeleton: ForwardRefRenderFunction<UserPaymentMethodsSkeletonRef, UserPaymentMethodsSkeletonProps>;
|
|
36
|
-
export default UserPaymentMethodsSkeleton;
|
|
14
|
+
declare const _default: React.ForwardRefExoticComponent<UserPaymentMethodsSkeletonProps & React.RefAttributes<UserPaymentMethodsSkeletonRef>>;
|
|
15
|
+
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
import { Box, TableCell, TableRow, Skeleton, styled } from '@mui/material';
|
|
4
5
|
import { PREFIX } from './constants';
|
|
5
6
|
import { useThemeProps } from '@mui/system';
|
|
@@ -32,8 +33,9 @@ const Root = styled(Box, {
|
|
|
32
33
|
|root|.SCUserPaymentMethodsSkeleton-skeleton-root|Styles applied to the root element.|
|
|
33
34
|
*
|
|
34
35
|
* @param inProps
|
|
36
|
+
* @param ref
|
|
35
37
|
*/
|
|
36
|
-
const UserPaymentMethodsSkeleton = (inProps) => {
|
|
38
|
+
const UserPaymentMethodsSkeleton = (inProps, ref) => {
|
|
37
39
|
// PROPS
|
|
38
40
|
const props = useThemeProps({
|
|
39
41
|
props: inProps,
|
|
@@ -42,4 +44,4 @@ const UserPaymentMethodsSkeleton = (inProps) => {
|
|
|
42
44
|
const { className = null, showBillingAddress = false } = props, rest = __rest(props, ["className", "showBillingAddress"]);
|
|
43
45
|
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsxs(TableRow, { children: [_jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 200 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 50 }) })), showBillingAddress && (_jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "text", height: 40, width: 150 }) }))), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "rectangular", width: 25, height: 25 }) })), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, { children: _jsx(Skeleton, { variant: "rounded", width: 105, height: 35 }) }))] }) })));
|
|
44
46
|
};
|
|
45
|
-
export default UserPaymentMethodsSkeleton;
|
|
47
|
+
export default forwardRef(UserPaymentMethodsSkeleton);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface UserPaymentMethodsProps {
|
|
3
3
|
/**
|
|
4
4
|
* Overrides or extends the styles applied to the component.
|
|
@@ -15,27 +15,5 @@ export interface UserPaymentMethodsProps {
|
|
|
15
15
|
[p: string]: any;
|
|
16
16
|
}
|
|
17
17
|
export type UserPaymentMethodsRef = {};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
#### Import
|
|
22
|
-
|
|
23
|
-
```jsx
|
|
24
|
-
import {UserPaymentMethods} from '@selfcommunity/react-ui';
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
#### Component Name
|
|
28
|
-
|
|
29
|
-
The name `SCUserPaymentMethods` can be used when providing style overrides in the theme.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
#### CSS
|
|
33
|
-
|
|
34
|
-
|Rule Name|Global class|Description|
|
|
35
|
-
|---|---|---|
|
|
36
|
-
|root|.SCUserPaymentMethods-root|Styles applied to the root element.|
|
|
37
|
-
|
|
38
|
-
* @param inProps
|
|
39
|
-
*/
|
|
40
|
-
declare const UserPaymentMethods: ForwardRefRenderFunction<UserPaymentMethodsRef, UserPaymentMethodsProps>;
|
|
41
|
-
export default UserPaymentMethods;
|
|
18
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<UserPaymentMethodsProps, "ref"> & React.RefAttributes<UserPaymentMethodsRef>>;
|
|
19
|
+
export default _default;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
1
|
+
import { __awaiter, __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { Box, Button, Checkbox, CircularProgress, Icon, IconButton, Paper, Stack, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography, styled } from '@mui/material';
|
|
5
5
|
import { PaymentIcon } from 'react-svg-credit-card-payment-icons';
|
|
6
6
|
import { useSCPaymentsEnabled, useSCUser } from '@selfcommunity/react-core';
|
|
7
7
|
import { useThemeProps } from '@mui/system';
|
|
8
8
|
import { PREFIX } from './constants';
|
|
9
9
|
import UserPaymentMethodsSkeleton from './Skeleton';
|
|
10
|
-
import { FormattedMessage } from 'react-intl';
|
|
10
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
11
11
|
import { useInView } from 'react-intersection-observer';
|
|
12
12
|
import { useSnackbar } from 'notistack';
|
|
13
13
|
import ConfirmDialog from '../../shared/ConfirmDialog/ConfirmDialog';
|
|
@@ -45,13 +45,13 @@ const Root = styled(Box, {
|
|
|
45
45
|
|
|
46
46
|
* @param inProps
|
|
47
47
|
*/
|
|
48
|
-
const UserPaymentMethods = (inProps) => {
|
|
48
|
+
const UserPaymentMethods = (inProps, ref) => {
|
|
49
49
|
// PROPS
|
|
50
50
|
const props = useThemeProps({
|
|
51
51
|
props: inProps,
|
|
52
52
|
name: PREFIX
|
|
53
53
|
});
|
|
54
|
-
const { className = null, showBillingAddress = false } = props;
|
|
54
|
+
const { className = null, showBillingAddress = false } = props, rest = __rest(props, ["className", "showBillingAddress"]);
|
|
55
55
|
// CONTEXT
|
|
56
56
|
const scUserContext = useSCUser();
|
|
57
57
|
// STATE
|
|
@@ -70,6 +70,7 @@ const UserPaymentMethods = (inProps) => {
|
|
|
70
70
|
const [addPaymentMethodDialogOpen, setAddPaymentMethodDialogOpen] = useState(false);
|
|
71
71
|
// HOOKS
|
|
72
72
|
const { isPaymentsEnabled } = useSCPaymentsEnabled();
|
|
73
|
+
const intl = useIntl();
|
|
73
74
|
const { inView } = useInView({ triggerOnce: false });
|
|
74
75
|
const { enqueueSnackbar } = useSnackbar();
|
|
75
76
|
/**
|
|
@@ -78,8 +79,8 @@ const UserPaymentMethods = (inProps) => {
|
|
|
78
79
|
const loadMore = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
79
80
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
80
81
|
const loadItems = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
-
|
|
82
|
-
getAccountCustomerPaymentMethod(startingAfterId).then((res) => {
|
|
82
|
+
const startingAfterId = paymentMethods.length ? paymentMethods[paymentMethods.length - 1].id : null;
|
|
83
|
+
/* getAccountCustomerPaymentMethod(startingAfterId).then((res) => {
|
|
83
84
|
setHasMore(res.paymentMethods.has_more);
|
|
84
85
|
setPaymentMethods(paymentMethods.concat(res.paymentMethods.data));
|
|
85
86
|
setIsLoadingPage(false);
|
|
@@ -327,9 +328,9 @@ const UserPaymentMethods = (inProps) => {
|
|
|
327
328
|
if (!isPaymentsEnabled || !scUserContext.user) {
|
|
328
329
|
return null;
|
|
329
330
|
}
|
|
330
|
-
return (_jsx(Root, Object.assign({ className: classes.root }, { children: isLoading ? (_jsx(UserPaymentMethodsSkeleton, {})) : (_jsxs(_Fragment, { children: [_jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "baseline" }, { children: [_jsx(Typography, Object.assign({ variant: "h3", className: classes.headline }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.myPaymentMethods", defaultMessage: "ui.userPaymentMethods.myPaymentMethods" }) })), paymentMethods.length > 0 && (_jsx(Button, Object.assign({ size: "small", variant:
|
|
331
|
+
return (_jsx(Root, Object.assign({ className: classes.root }, { children: isLoading ? (_jsx(UserPaymentMethodsSkeleton, {})) : (_jsxs(_Fragment, { children: [_jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "baseline" }, { children: [_jsx(Typography, Object.assign({ variant: "h3", className: classes.headline }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.myPaymentMethods", defaultMessage: "ui.userPaymentMethods.myPaymentMethods" }) })), paymentMethods.length > 0 && (_jsx(Button, Object.assign({ size: "small", variant: 'outlined', onClick: handleOpenAddPaymentMethodDialog }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.btnAdd", defaultMessage: "ui.userPaymentMethods.btnAdd" }) })))] })), paymentMethods.length > 0 ? (_jsx(TableContainer, Object.assign({ style: { margin: 'auto', borderRadius: 0 }, component: Paper }, { children: _jsxs(Table, Object.assign({ sx: { minWidth: 650 }, "aria-label": "simple table", stickyHeader: true }, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.typeMethod", defaultMessage: "ui.userPaymentMethods.typeMethod" }) }), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.brand", defaultMessage: "ui.userPaymentMethods.brand" }) }), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.expiration", defaultMessage: "ui.userPaymentMethods.expiration" }) }), showBillingAddress && (_jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.billingDetails", defaultMessage: "ui.userPaymentMethods.billingDetails" }) })), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.default", defaultMessage: "ui.userPaymentMethods.default" }) }), _jsx(TableCell, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.actions", defaultMessage: "ui.userPaymentMethods.actions" }) })] }) }), _jsxs(TableBody, { children: [paymentMethods.map((method, index) => {
|
|
331
332
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
332
|
-
return (_jsxs(TableRow, { children: [_jsx(TableCell, Object.assign({ scope: "row" }, { children: method.type.toUpperCase() })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: method.type === 'card' && (_jsxs(_Fragment, { children: [_jsx(PaymentIcon, { type: ((_a = method.card) === null || _a === void 0 ? void 0 : _a.brand) || 'Generic', format: "flatRounded", width: 50 }), _jsxs(Typography, Object.assign({ className: classes.paymentNumber }, { children: ["**** **** **** ", (_b = method.card) === null || _b === void 0 ? void 0 : _b.last4] }))] })) })), _jsxs(TableCell, Object.assign({ scope: "row" }, { children: [(_c = method.card) === null || _c === void 0 ? void 0 : _c.exp_month, "/", (_d = method.card) === null || _d === void 0 ? void 0 : _d.exp_year] })), showBillingAddress && (_jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "left", alignItems: "center", spacing: 2 }, { children: [_jsxs(Box, { children: [_jsx(Typography, Object.assign({ variant:
|
|
333
|
-
}), hasMore && _jsx(UserPaymentMethodsSkeleton, {})] })] })) }))) : (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body2", mb: 2 }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.noPaymentMethods", defaultMessage: "ui.userPaymentMethods.noPaymentMethods" }) })), _jsx(Button, Object.assign({ size: "small", variant:
|
|
333
|
+
return (_jsxs(TableRow, { children: [_jsx(TableCell, Object.assign({ scope: "row" }, { children: method.type.toUpperCase() })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: method.type === 'card' && (_jsxs(_Fragment, { children: [_jsx(PaymentIcon, { type: ((_a = method.card) === null || _a === void 0 ? void 0 : _a.brand) || 'Generic', format: "flatRounded", width: 50 }), _jsxs(Typography, Object.assign({ className: classes.paymentNumber }, { children: ["**** **** **** ", (_b = method.card) === null || _b === void 0 ? void 0 : _b.last4] }))] })) })), _jsxs(TableCell, Object.assign({ scope: "row" }, { children: [(_c = method.card) === null || _c === void 0 ? void 0 : _c.exp_month, "/", (_d = method.card) === null || _d === void 0 ? void 0 : _d.exp_year] })), showBillingAddress && (_jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "left", alignItems: "center", spacing: 2 }, { children: [_jsxs(Box, { children: [_jsx(Typography, Object.assign({ variant: 'body1' }, { children: method.billing_details.name })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [(_f = (_e = method.billing_details) === null || _e === void 0 ? void 0 : _e.address) === null || _f === void 0 ? void 0 : _f.line1, _jsx("br", {}), (_h = (_g = method.billing_details) === null || _g === void 0 ? void 0 : _g.address) === null || _h === void 0 ? void 0 : _h.line2] })), _jsxs(Typography, Object.assign({ variant: 'body1' }, { children: [(_k = (_j = method.billing_details) === null || _j === void 0 ? void 0 : _j.address) === null || _k === void 0 ? void 0 : _k.postal_code, " - ", (_m = (_l = method.billing_details) === null || _l === void 0 ? void 0 : _l.address) === null || _m === void 0 ? void 0 : _m.city, " -", ' ', (_p = (_o = method.billing_details) === null || _o === void 0 ? void 0 : _o.address) === null || _p === void 0 ? void 0 : _p.country] }))] }), _jsx(IconButton, Object.assign({ "aria-label": "edit", color: "primary", onClick: () => handleOpenEditAddressDialog(method) }, { children: _jsx(Icon, { children: "edit" }) }))] })) }))), _jsx(TableCell, Object.assign({ scope: "row" }, { children: defaultPaymentMethodLoading === method.id ? (_jsx(CircularProgress, { size: 20 })) : (_jsxs(_Fragment, { children: [method.id === defaultPaymentMethodId, _jsx(Checkbox, { checked: method.id === defaultPaymentMethodId, onClick: () => handleSetDefaultPaymentMethodId(method.id) })] })) })), _jsx(TableCell, Object.assign({ scope: "row" }, { children: _jsx(Button, Object.assign({ variant: 'contained', onClick: () => handleDelete(method.id) }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.btnRemove", defaultMessage: "ui.userPaymentMethods.btnRemove" }) })) }))] }, index));
|
|
334
|
+
}), hasMore && _jsx(UserPaymentMethodsSkeleton, {})] })] })) }))) : (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body2", mb: 2 }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.noPaymentMethods", defaultMessage: "ui.userPaymentMethods.noPaymentMethods" }) })), _jsx(Button, Object.assign({ size: "small", variant: 'contained', onClick: handleOpenAddPaymentMethodDialog }, { children: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.btnAdd", defaultMessage: "ui.userPaymentMethods.btnAdd" }) }))] })), openDeleteDialog && (_jsx(ConfirmDialog, { open: openDeleteDialog, title: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.dialog.confirmDeleteTitle", defaultMessage: "ui.userPaymentMethods.dialog.confirmDeleteTitle" }), btnConfirm: _jsx(FormattedMessage, { id: "ui.userPaymentMethods.dialog.confirmDeleteDescription", defaultMessage: "ui.userPaymentMethods.dialog.confirmDeleteDescription" }), onConfirm: handleConfirmDelete, onClose: handleConfirmClose, isUpdating: isDeletingPaymentMethod })), editPaymentMethodDialogOpen && editPaymentMethod !== null && (_jsx(UserChangeAddressDialog, { open: true, defaultAddress: editPaymentMethod, handleAddress: handleAddress })), addPaymentMethodDialogOpen && _jsx(UserAddPaymentMethodDialog, { open: true, handlePaymentMethod: handlePaymentMethodSuccess })] })) })));
|
|
334
335
|
};
|
|
335
|
-
export default UserPaymentMethods;
|
|
336
|
+
export default forwardRef(UserPaymentMethods);
|
|
@@ -1,11 +1,12 @@
|
|
|
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 { useMemo } from 'react';
|
|
4
|
-
import { Box,
|
|
4
|
+
import { Box, Divider, Typography, styled } from '@mui/material';
|
|
5
5
|
import { FormattedMessage } from 'react-intl';
|
|
6
6
|
import { useSCFetchUser, useSCFetchUserBlockedBy, useSCUser } from '@selfcommunity/react-core';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useThemeProps } from '@mui/system';
|
|
9
|
+
import { LoadingButton } from '@mui/lab';
|
|
9
10
|
import { useSnackbar } from 'notistack';
|
|
10
11
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
11
12
|
import { Logger } from '@selfcommunity/utils';
|
|
@@ -76,5 +77,5 @@ export default function UserProfileBlocked(inProps) {
|
|
|
76
77
|
if (!scUser || !scUserContext.user || loadingBlockedBy) {
|
|
77
78
|
return null;
|
|
78
79
|
}
|
|
79
|
-
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Divider, {}), !isMe && blockedBy && (_jsx(Typography, Object.assign({ variant: "body1", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.blockedUserBy", defaultMessage: "ui.userProfileBlocked.blockedUserBy" }) }))), !isMe && scUserContext.managers.blockedUsers.isBlocked(scUser) && (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.blockedUser", defaultMessage: "ui.userProfileBlocked.blockedUser" }) })), _jsx(
|
|
80
|
+
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Divider, {}), !isMe && blockedBy && (_jsx(Typography, Object.assign({ variant: "body1", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.blockedUserBy", defaultMessage: "ui.userProfileBlocked.blockedUserBy" }) }))), !isMe && scUserContext.managers.blockedUsers.isBlocked(scUser) && (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ variant: "body1", className: classes.info }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.blockedUser", defaultMessage: "ui.userProfileBlocked.blockedUser" }) })), _jsx(LoadingButton, Object.assign({ variant: "contained", className: classes.button, loading: scUserContext.managers.blockedUsers.loading, disabled: scUserContext.managers.blockedUsers.loading, onClick: handleBlock }, { children: _jsx(FormattedMessage, { id: "ui.userProfileBlocked.unBlockUser", defaultMessage: "ui.userProfileBlocked.unBlockUser" }) }))] }))] })));
|
|
80
81
|
}
|