@blocklet/ui-react 2.13.70 → 3.0.1
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/@types/index.js +5 -18
- package/lib/BlockletStudio/index.js +75 -89
- package/lib/ComponentInstaller/index.js +153 -190
- package/lib/ComponentInstaller/installer-item.js +56 -55
- package/lib/ComponentInstaller/locales.js +19 -18
- package/lib/ComponentInstaller/use-component-installed.js +49 -80
- package/lib/ComponentManager/components/add-component.js +68 -89
- package/lib/ComponentManager/components/check-component.js +4 -2
- package/lib/ComponentManager/components/publish-component.js +48 -57
- package/lib/ComponentManager/components/resource-dialog.js +41 -55
- package/lib/ComponentManager/index.js +8 -3
- package/lib/ComponentManager/libs/locales.js +8 -5
- package/lib/Dashboard/index.js +88 -124
- package/lib/Footer/brand.js +25 -28
- package/lib/Footer/copyright.js +15 -16
- package/lib/Footer/index.js +55 -65
- package/lib/Footer/internal-footer.js +93 -95
- package/lib/Footer/layout/plain.js +26 -24
- package/lib/Footer/layout/row.js +16 -20
- package/lib/Footer/layout/standard.js +73 -59
- package/lib/Footer/links.js +100 -120
- package/lib/Footer/social-media.js +28 -33
- package/lib/Header/index.js +108 -130
- package/lib/Icon/index.js +43 -59
- package/lib/Notifications/Snackbar.js +114 -151
- package/lib/Notifications/hooks/use-title.js +85 -126
- package/lib/Notifications/hooks/use-width.js +10 -9
- package/lib/Notifications/utils.js +74 -114
- package/lib/UserCenter/components/config-inviter.js +21 -31
- package/lib/UserCenter/components/config-profile.js +41 -47
- package/lib/UserCenter/components/danger-zone.js +88 -93
- package/lib/UserCenter/components/editable-field.js +149 -167
- package/lib/UserCenter/components/nft.js +91 -81
- package/lib/UserCenter/components/notification.js +206 -195
- package/lib/UserCenter/components/passport.js +37 -53
- package/lib/UserCenter/components/privacy.js +53 -64
- package/lib/UserCenter/components/settings.js +117 -128
- package/lib/UserCenter/components/status-dialog/date-picker.js +35 -36
- package/lib/UserCenter/components/status-dialog/index.js +132 -144
- package/lib/UserCenter/components/status-selector/duration-menu.js +53 -48
- package/lib/UserCenter/components/status-selector/index.js +37 -36
- package/lib/UserCenter/components/status-selector/menu-item.js +13 -9
- package/lib/UserCenter/components/storage/action.js +27 -25
- package/lib/UserCenter/components/storage/connected.js +59 -30
- package/lib/UserCenter/components/storage/delete.js +32 -39
- package/lib/UserCenter/components/storage/disconnect.js +43 -25
- package/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg.js +7 -0
- package/lib/UserCenter/components/storage/index.js +24 -18
- package/lib/UserCenter/components/storage/preview-nft.js +35 -36
- package/lib/UserCenter/components/third-party-login/index.js +73 -143
- package/lib/UserCenter/components/third-party-login/third-party-item.js +132 -153
- package/lib/UserCenter/components/user-center.js +345 -461
- package/lib/UserCenter/components/user-info/address.js +120 -100
- package/lib/UserCenter/components/user-info/index.js +10 -4
- package/lib/UserCenter/components/user-info/link-preview-input.js +148 -159
- package/lib/UserCenter/components/user-info/metadata.js +290 -385
- package/lib/UserCenter/components/user-info/switch-role.js +24 -18
- package/lib/UserCenter/components/user-info/timezone-select.js +37 -45
- package/lib/UserCenter/components/user-info/user-basic-info.js +213 -207
- package/lib/UserCenter/components/user-info/user-info-item.js +39 -26
- package/lib/UserCenter/components/user-info/user-info.js +52 -67
- package/lib/UserCenter/components/user-info/user-status.js +111 -154
- package/lib/UserCenter/components/user-info/utils.js +96 -93
- package/lib/UserCenter/components/webhook-item.js +95 -143
- package/lib/UserCenter/index.js +4 -1
- package/lib/UserCenter/libs/locales.js +132 -129
- package/lib/UserCenter/libs/utils.js +17 -22
- package/lib/UserSessions/components/user-session-info.js +30 -26
- package/lib/UserSessions/components/user-sessions.js +222 -268
- package/lib/UserSessions/index.js +4 -1
- package/lib/UserSessions/libs/locales.js +31 -28
- package/lib/UserSessions/libs/utils.js +30 -56
- package/lib/blocklets.js +75 -156
- package/lib/common/domain-warning.js +64 -104
- package/lib/common/header-addons.js +59 -80
- package/lib/common/link-blocker.js +10 -16
- package/lib/common/notification-addon.js +56 -89
- package/lib/common/overridable-theme-provider.js +12 -12
- package/lib/common/wallet-hidden-topbar.js +11 -13
- package/lib/common/ws.js +23 -34
- package/lib/contexts/config-user-space.js +34 -43
- package/lib/hooks/use-mobile.js +7 -4
- package/lib/index.js +25 -10
- package/lib/libs/client.js +5 -2
- package/lib/libs/constant.js +4 -1
- package/lib/libs/spaces.js +11 -11
- package/lib/libs/with-hide-when-embed.js +13 -15
- package/lib/packages/blocklet-ui-react/build.config.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/jest.config.d.ts +8 -0
- package/lib/packages/blocklet-ui-react/lib/@types/index.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/BlockletStudio/index.d.ts +26 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/index.d.ts +18 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/installer-item.d.ts +18 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/locales.d.ts +28 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentInstaller/use-component-installed.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/add-component.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/check-component.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/publish-component.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/components/resource-dialog.d.ts +11 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/index.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/ComponentManager/libs/locales.d.ts +19 -0
- package/lib/packages/blocklet-ui-react/lib/Dashboard/index.d.ts +27 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/brand.d.ts +15 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/copyright.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/index.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/internal-footer.d.ts +29 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/layout/plain.d.ts +19 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/layout/row.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/layout/standard.d.ts +21 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/links.d.ts +20 -0
- package/lib/packages/blocklet-ui-react/lib/Footer/social-media.d.ts +14 -0
- package/lib/packages/blocklet-ui-react/lib/Header/index.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/Icon/index.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/Notifications/Snackbar.d.ts +8 -0
- package/lib/packages/blocklet-ui-react/lib/Notifications/hooks/use-title.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/lib/Notifications/hooks/use-width.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/Notifications/utils.d.ts +10 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/config-inviter.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/config-profile.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/danger-zone.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/editable-field.d.ts +50 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/nft.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/notification.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/passport.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/privacy.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/settings.d.ts +8 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-dialog/date-picker.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-dialog/index.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-selector/duration-menu.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-selector/index.d.ts +8 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/status-selector/menu-item.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/action.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/connected.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/delete.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/disconnect.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/index.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/storage/preview-nft.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/third-party-login/index.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/third-party-login/third-party-item.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-center.d.ts +15 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/address.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/index.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/link-preview-input.d.ts +6 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/metadata.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/switch-role.d.ts +6 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/timezone-select.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-basic-info.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-info-item.d.ts +6 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-info.d.ts +6 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/user-status.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/user-info/utils.d.ts +33 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/components/webhook-item.d.ts +10 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/index.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/libs/locales.d.ts +513 -0
- package/lib/packages/blocklet-ui-react/lib/UserCenter/libs/utils.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/UserSessions/components/user-session-info.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/UserSessions/components/user-sessions.d.ts +8 -0
- package/lib/packages/blocklet-ui-react/lib/UserSessions/index.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/UserSessions/libs/locales.d.ts +88 -0
- package/lib/packages/blocklet-ui-react/lib/UserSessions/libs/utils.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/blocklets.d.ts +18 -0
- package/lib/packages/blocklet-ui-react/lib/common/domain-warning.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/lib/common/header-addons.d.ts +19 -0
- package/lib/packages/blocklet-ui-react/lib/common/link-blocker.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/common/notification-addon.d.ts +10 -0
- package/lib/packages/blocklet-ui-react/lib/common/overridable-theme-provider.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/lib/common/wallet-hidden-topbar.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/common/ws.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/contexts/config-user-space.d.ts +7 -0
- package/lib/packages/blocklet-ui-react/lib/hooks/use-mobile.d.ts +4 -0
- package/lib/packages/blocklet-ui-react/lib/index.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/lib/libs/client.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/libs/constant.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/lib/libs/spaces.d.ts +3 -0
- package/lib/packages/blocklet-ui-react/lib/libs/with-hide-when-embed.d.ts +5 -0
- package/lib/packages/blocklet-ui-react/lib/types.d.ts +37 -0
- package/lib/packages/blocklet-ui-react/lib/utils.d.ts +11 -0
- package/lib/{@types → packages/blocklet-ui-react/src/@types}/index.d.ts +3 -3
- package/lib/{BlockletStudio → packages/blocklet-ui-react/src/BlockletStudio}/index.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/ComponentInstaller/ComponentInstaller.stories.d.ts +9 -0
- package/lib/packages/blocklet-ui-react/src/ComponentInstaller/demo/basic.d.ts +29 -0
- package/lib/packages/blocklet-ui-react/src/ComponentInstaller/demo/mock-optional-components.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/src/ComponentInstaller/index.d.ts +18 -0
- package/lib/packages/blocklet-ui-react/src/ComponentInstaller/installer-item.d.ts +18 -0
- package/lib/{ComponentInstaller → packages/blocklet-ui-react/src/ComponentInstaller}/use-component-installed.d.ts +1 -1
- package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/components/add-component.d.ts +2 -2
- package/lib/packages/blocklet-ui-react/src/ComponentManager/components/check-component.d.ts +2 -0
- package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/components/publish-component.d.ts +2 -2
- package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/components/resource-dialog.d.ts +2 -2
- package/lib/packages/blocklet-ui-react/src/Dashboard/Dashboard.stories.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/src/Dashboard/demo/basic.d.ts +29 -0
- package/lib/packages/blocklet-ui-react/src/Dashboard/index.d.ts +30 -0
- package/lib/packages/blocklet-ui-react/src/Footer/Footer.stories.d.ts +19 -0
- package/lib/packages/blocklet-ui-react/src/Footer/brand.d.ts +15 -0
- package/lib/packages/blocklet-ui-react/src/Footer/copyright.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/arcblock-site.d.ts +31 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/brand.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/copyright.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/footer.d.ts +10 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/links.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/src/Footer/demo/social-media-icons.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/src/Footer/index.d.ts +6 -0
- package/lib/packages/blocklet-ui-react/src/Footer/internal-footer.d.ts +32 -0
- package/lib/packages/blocklet-ui-react/src/Footer/layout/plain.d.ts +22 -0
- package/lib/packages/blocklet-ui-react/src/Footer/layout/row.d.ts +13 -0
- package/lib/packages/blocklet-ui-react/src/Footer/layout/standard.d.ts +24 -0
- package/lib/packages/blocklet-ui-react/src/Footer/links.d.ts +23 -0
- package/lib/packages/blocklet-ui-react/src/Footer/social-media.d.ts +14 -0
- package/lib/packages/blocklet-ui-react/src/Header/Header.stories.d.ts +26 -0
- package/lib/packages/blocklet-ui-react/src/Header/demo/addons-customization.d.ts +11 -0
- package/lib/packages/blocklet-ui-react/src/Header/demo/basic.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/src/Header/demo/fixtures/index.d.ts +49 -0
- package/lib/packages/blocklet-ui-react/src/Header/demo/with-enable-connect-enable-locale.d.ts +1 -0
- package/lib/{Header → packages/blocklet-ui-react/src/Header}/index.d.ts +3 -2
- package/lib/packages/blocklet-ui-react/src/Icon/Icon.stories.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/src/Icon/demo/basic.d.ts +1 -0
- package/lib/{Icon → packages/blocklet-ui-react/src/Icon}/index.d.ts +2 -3
- package/lib/packages/blocklet-ui-react/src/Notifications/Snackbar.d.ts +16 -0
- package/lib/{Notifications → packages/blocklet-ui-react/src/Notifications}/hooks/use-title.d.ts +1 -1
- package/lib/{Notifications → packages/blocklet-ui-react/src/Notifications}/utils.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/config-inviter.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/config-profile.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/danger-zone.d.ts +1 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/editable-field.d.ts +3 -3
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/nft.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/notification.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/passport.d.ts +5 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/privacy.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/settings.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-dialog/date-picker.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-dialog/index.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/status-selector/duration-menu.d.ts +7 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-selector/index.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/status-selector/menu-item.d.ts +4 -4
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/action.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/connected.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/delete.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/storage/disconnect.d.ts +2 -0
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/storage/index.d.ts +2 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/storage/preview-nft.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/third-party-login/index.d.ts +4 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/third-party-login/third-party-item.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-center.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/address.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/link-preview-input.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/metadata.d.ts +2 -2
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/user-info/switch-role.d.ts +7 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/timezone-select.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/user-basic-info.d.ts +3 -3
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/user-info-item.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/UserCenter/components/user-info/user-info.d.ts +6 -0
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/user-status.d.ts +2 -2
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/utils.d.ts +8 -5
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/webhook-item.d.ts +1 -1
- package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/libs/utils.d.ts +1 -1
- package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/components/user-session-info.d.ts +1 -1
- package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/components/user-sessions.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/common/domain-warning.d.ts +12 -0
- package/lib/packages/blocklet-ui-react/src/common/header-addons.d.ts +19 -0
- package/lib/{common → packages/blocklet-ui-react/src/common}/link-blocker.d.ts +1 -1
- package/lib/{common → packages/blocklet-ui-react/src/common}/notification-addon.d.ts +3 -6
- package/lib/{common → packages/blocklet-ui-react/src/common}/overridable-theme-provider.d.ts +5 -8
- package/lib/{contexts → packages/blocklet-ui-react/src/contexts}/config-user-space.d.ts +3 -3
- package/lib/{libs → packages/blocklet-ui-react/src/libs}/with-hide-when-embed.d.ts +1 -1
- package/lib/packages/blocklet-ui-react/src/types.d.ts +36 -0
- package/lib/packages/blocklet-ui-react/tools/auto-exports.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/tools/jest.d.ts +1 -0
- package/lib/packages/blocklet-ui-react/vite.config.d.mts +2 -0
- package/lib/types.js +39 -39
- package/lib/utils.js +61 -175
- package/package.json +28 -34
- package/src/ComponentInstaller/ComponentInstaller.stories.jsx +16 -0
- package/src/ComponentInstaller/index.jsx +11 -27
- package/src/ComponentInstaller/installer-item.jsx +1 -5
- package/src/ComponentManager/components/add-component.tsx +3 -3
- package/src/ComponentManager/components/publish-component.tsx +3 -3
- package/src/Dashboard/Dashboard.stories.jsx +20 -0
- package/src/Dashboard/index.jsx +16 -27
- package/src/Footer/Footer.stories.jsx +32 -0
- package/src/Footer/brand.jsx +1 -7
- package/src/Footer/copyright.jsx +1 -6
- package/src/Footer/index.jsx +1 -6
- package/src/Footer/internal-footer.jsx +26 -16
- package/src/Footer/layout/row.jsx +2 -7
- package/src/Footer/layout/standard.jsx +12 -2
- package/src/Footer/links.jsx +2 -7
- package/src/Footer/social-media.jsx +1 -5
- package/src/Header/Header.stories.jsx +30 -0
- package/src/Header/index.tsx +1 -1
- package/src/Icon/Icon.stories.jsx +12 -0
- package/src/Notifications/Snackbar.tsx +119 -126
- package/src/Notifications/hooks/use-title.tsx +5 -2
- package/src/Notifications/hooks/use-width.tsx +1 -1
- package/src/UserCenter/components/config-profile.tsx +0 -1
- package/src/UserCenter/components/danger-zone.tsx +7 -3
- package/src/UserCenter/components/editable-field.tsx +45 -44
- package/src/UserCenter/components/nft.tsx +21 -9
- package/src/UserCenter/components/notification.tsx +22 -6
- package/src/UserCenter/components/privacy.tsx +1 -1
- package/src/UserCenter/components/settings.tsx +6 -1
- package/src/UserCenter/components/status-dialog/date-picker.tsx +10 -7
- package/src/UserCenter/components/status-dialog/index.tsx +11 -4
- package/src/UserCenter/components/status-selector/duration-menu.tsx +7 -2
- package/src/UserCenter/components/status-selector/index.tsx +7 -1
- package/src/UserCenter/components/status-selector/menu-item.tsx +1 -2
- package/src/UserCenter/components/storage/action.tsx +1 -2
- package/src/UserCenter/components/storage/connected.tsx +18 -5
- package/src/UserCenter/components/storage/delete.tsx +1 -1
- package/src/UserCenter/components/storage/disconnect.tsx +10 -2
- package/src/UserCenter/components/storage/index.tsx +6 -1
- package/src/UserCenter/components/storage/preview-nft.tsx +1 -1
- package/src/UserCenter/components/third-party-login/index.tsx +2 -2
- package/src/UserCenter/components/third-party-login/third-party-item.tsx +11 -7
- package/src/UserCenter/components/user-center.tsx +10 -5
- package/src/UserCenter/components/user-info/address.tsx +12 -6
- package/src/UserCenter/components/user-info/link-preview-input.tsx +36 -51
- package/src/UserCenter/components/user-info/metadata.tsx +45 -39
- package/src/UserCenter/components/user-info/timezone-select.tsx +2 -5
- package/src/UserCenter/components/user-info/user-basic-info.tsx +24 -8
- package/src/UserCenter/components/user-info/user-info-item.tsx +7 -2
- package/src/UserCenter/components/user-info/user-status.tsx +7 -9
- package/src/UserCenter/components/user-info/utils.ts +77 -11
- package/src/UserCenter/components/webhook-item.tsx +4 -2
- package/src/UserSessions/components/user-sessions.tsx +1 -1
- package/src/common/domain-warning.jsx +2 -14
- package/src/common/header-addons.jsx +8 -11
- package/src/common/notification-addon.jsx +1 -7
- package/src/common/overridable-theme-provider.jsx +1 -5
- package/src/common/ws.js +2 -2
- package/src/contexts/config-user-space.tsx +3 -3
- package/vite.config.mjs +31 -0
- package/lib/@types/shims.d.ts +0 -18
- package/lib/ComponentInstaller/index.d.ts +0 -37
- package/lib/ComponentInstaller/installer-item.d.ts +0 -21
- package/lib/ComponentManager/components/check-component.d.ts +0 -2
- package/lib/Dashboard/index.d.ts +0 -44
- package/lib/Footer/brand.d.ts +0 -22
- package/lib/Footer/copyright.d.ts +0 -18
- package/lib/Footer/index.d.ts +0 -6
- package/lib/Footer/internal-footer.d.ts +0 -29
- package/lib/Footer/layout/plain.d.ts +0 -15
- package/lib/Footer/layout/row.d.ts +0 -18
- package/lib/Footer/layout/standard.d.ts +0 -17
- package/lib/Footer/links.d.ts +0 -23
- package/lib/Footer/social-media.d.ts +0 -14
- package/lib/Notifications/Snackbar.d.ts +0 -14
- package/lib/UserCenter/components/danger-zone.d.ts +0 -1
- package/lib/UserCenter/components/passport.d.ts +0 -5
- package/lib/UserCenter/components/status-selector/duration-menu.d.ts +0 -7
- package/lib/UserCenter/components/storage/disconnect.d.ts +0 -2
- package/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg +0 -58
- package/lib/UserCenter/components/storage/icons/long-arrow.svg +0 -5
- package/lib/UserCenter/components/storage/icons/space-connected.svg +0 -3
- package/lib/UserCenter/components/storage/icons/space-disconnect.svg +0 -3
- package/lib/UserCenter/components/storage/index.d.ts +0 -2
- package/lib/UserCenter/components/third-party-login/index.d.ts +0 -4
- package/lib/UserCenter/components/user-info/switch-role.d.ts +0 -7
- package/lib/UserCenter/components/user-info/user-info.d.ts +0 -6
- package/lib/common/domain-warning.d.ts +0 -17
- package/lib/common/header-addons.d.ts +0 -27
- package/lib/types.d.ts +0 -2
- /package/lib/{ComponentInstaller → packages/blocklet-ui-react/src/ComponentInstaller}/locales.d.ts +0 -0
- /package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/index.d.ts +0 -0
- /package/lib/{ComponentManager → packages/blocklet-ui-react/src/ComponentManager}/libs/locales.d.ts +0 -0
- /package/lib/{Notifications → packages/blocklet-ui-react/src/Notifications}/hooks/use-width.d.ts +0 -0
- /package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/components/user-info/index.d.ts +0 -0
- /package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/index.d.ts +0 -0
- /package/lib/{UserCenter → packages/blocklet-ui-react/src/UserCenter}/libs/locales.d.ts +0 -0
- /package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/index.d.ts +0 -0
- /package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/libs/locales.d.ts +0 -0
- /package/lib/{UserSessions → packages/blocklet-ui-react/src/UserSessions}/libs/utils.d.ts +0 -0
- /package/lib/{blocklets.d.ts → packages/blocklet-ui-react/src/blocklets.d.ts} +0 -0
- /package/lib/{common → packages/blocklet-ui-react/src/common}/wallet-hidden-topbar.d.ts +0 -0
- /package/lib/{common → packages/blocklet-ui-react/src/common}/ws.d.ts +0 -0
- /package/lib/{hooks → packages/blocklet-ui-react/src/hooks}/use-mobile.d.ts +0 -0
- /package/lib/{index.d.ts → packages/blocklet-ui-react/src/index.d.ts} +0 -0
- /package/lib/{libs → packages/blocklet-ui-react/src/libs}/client.d.ts +0 -0
- /package/lib/{libs → packages/blocklet-ui-react/src/libs}/constant.d.ts +0 -0
- /package/lib/{libs → packages/blocklet-ui-react/src/libs}/spaces.d.ts +0 -0
- /package/lib/{utils.d.ts → packages/blocklet-ui-react/src/utils.d.ts} +0 -0
|
@@ -1,37 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Box, CircularProgress, Divider
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { SessionContext } from "@arcblock/did-connect/lib/Session";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useConfirm } from "@arcblock/ux/lib/Dialog";
|
|
12
|
-
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
13
|
-
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
14
|
-
import { ErrorFallback } from "@arcblock/ux/lib/ErrorBoundary";
|
|
15
|
-
import { styled } from "@arcblock/ux/lib/Theme";
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import { PROFILE_URL } from "@arcblock/ux/lib/Util/constant";
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { translations } from "../libs/locales.js";
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { jsx as i, jsxs as m, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { use as vr } from "react";
|
|
3
|
+
import { Box as s, Typography as br, CircularProgress as yr, Divider as Pr } from "@mui/material";
|
|
4
|
+
import { useMemoizedFn as C, useCreation as f, useRequest as or } from "ahooks";
|
|
5
|
+
import kr from "p-wait-for";
|
|
6
|
+
import { SessionContext as Cr } from "@arcblock/did-connect/lib/Session";
|
|
7
|
+
import Dr from "@arcblock/ux/lib/Tabs";
|
|
8
|
+
import F from "@arcblock/ux/lib/Empty";
|
|
9
|
+
import Mr from "@arcblock/ux/lib/Button";
|
|
10
|
+
import Sr from "@arcblock/ux/lib/Result";
|
|
11
|
+
import { useConfirm as Wr } from "@arcblock/ux/lib/Dialog";
|
|
12
|
+
import { translate as zr } from "@arcblock/ux/lib/Locale/util";
|
|
13
|
+
import { useLocaleContext as Ur } from "@arcblock/ux/lib/Locale/context";
|
|
14
|
+
import { ErrorFallback as Lr } from "@arcblock/ux/lib/ErrorBoundary";
|
|
15
|
+
import { styled as fr } from "@arcblock/ux/lib/Theme";
|
|
16
|
+
import Fr from "lodash/cloneDeep";
|
|
17
|
+
import { joinURL as D, getQuery as Rr, withoutTrailingSlash as nr, withQuery as lr } from "ufo";
|
|
18
|
+
import { PROFILE_URL as M } from "@arcblock/ux/lib/Util/constant";
|
|
19
|
+
import Br from "../../Footer/index.js";
|
|
20
|
+
import ar from "../../Header/index.js";
|
|
21
|
+
import { translations as Ir } from "../libs/locales.js";
|
|
22
|
+
import sr from "./user-info/user-basic-info.js";
|
|
23
|
+
import "@mui/icons-material";
|
|
24
|
+
import "@iconify/react";
|
|
25
|
+
import "@arcblock/ux/lib/DID";
|
|
26
|
+
import "@iconify-icons/material-symbols/schedule-outline-rounded";
|
|
27
|
+
import "@iconify-icons/material-symbols/more-time-rounded";
|
|
28
|
+
import "@iconify-icons/material-symbols/captive-portal-rounded";
|
|
29
|
+
import "@iconify-icons/material-symbols/settings-input-antenna-rounded";
|
|
30
|
+
import "@arcblock/ux/lib/RelativeTime";
|
|
31
|
+
import "@arcblock/ux/lib/UserCard/Content/shorten-label";
|
|
32
|
+
import "./user-info/switch-role.js";
|
|
33
|
+
import { formatBlockletInfo as jr, getLink as R, getLocalizedNavigation as Hr } from "../../blocklets.js";
|
|
34
|
+
import Nr from "./passport.js";
|
|
35
|
+
import _r from "./settings.js";
|
|
36
|
+
import { client as dr } from "../../libs/client.js";
|
|
37
|
+
import Er from "../../hooks/use-mobile.js";
|
|
38
|
+
import { ConfigUserSpaceProvider as Or } from "../../contexts/config-user-space.js";
|
|
39
|
+
import Qr from "./storage/index.js";
|
|
40
|
+
import qr from "./nft.js";
|
|
41
|
+
const B = D(M, "/nfts"), I = D(M, "/settings"), j = D(M, "/did-spaces"), ur = fr(s)(({ theme: v }) => ({
|
|
35
42
|
flex: 1,
|
|
36
43
|
boxSizing: "border-box",
|
|
37
44
|
padding: "0 16px",
|
|
@@ -42,14 +49,13 @@ const Main = styled(Box)(({ theme }) => ({
|
|
|
42
49
|
alignItems: "stretch",
|
|
43
50
|
gap: 2.5,
|
|
44
51
|
flexDirection: "column",
|
|
45
|
-
[
|
|
52
|
+
[v.breakpoints.up("md")]: {
|
|
46
53
|
flexDirection: "row"
|
|
47
54
|
}
|
|
48
|
-
}))
|
|
49
|
-
const ContentWrapper = styled(Box)(({ theme }) => ({
|
|
55
|
+
})), H = fr(s)(({ theme: v }) => ({
|
|
50
56
|
overflow: "hidden",
|
|
51
57
|
flex: "revert",
|
|
52
|
-
[
|
|
58
|
+
[v.breakpoints.up("md")]: {
|
|
53
59
|
flex: 1
|
|
54
60
|
},
|
|
55
61
|
"@media (min-width: 850px) and (max-width: 1050px)": {
|
|
@@ -58,84 +64,50 @@ const ContentWrapper = styled(Box)(({ theme }) => ({
|
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
}));
|
|
61
|
-
|
|
62
|
-
children,
|
|
63
|
-
notLoginContent = null,
|
|
64
|
-
currentTab,
|
|
65
|
-
contentProps = {},
|
|
66
|
-
disableAutoRedirect =
|
|
67
|
-
hideFooter =
|
|
68
|
-
headerProps = {},
|
|
69
|
-
footerProps = {},
|
|
70
|
-
userDid = void 0,
|
|
71
|
-
stickySidebar =
|
|
72
|
-
embed =
|
|
73
|
-
onlyProfile =
|
|
67
|
+
function Le({
|
|
68
|
+
children: v,
|
|
69
|
+
notLoginContent: N = null,
|
|
70
|
+
currentTab: x,
|
|
71
|
+
contentProps: _ = {},
|
|
72
|
+
disableAutoRedirect: E = !1,
|
|
73
|
+
hideFooter: cr = !1,
|
|
74
|
+
headerProps: pr = {},
|
|
75
|
+
footerProps: mr = {},
|
|
76
|
+
userDid: S = void 0,
|
|
77
|
+
stickySidebar: O = !1,
|
|
78
|
+
embed: Q = !1,
|
|
79
|
+
onlyProfile: b = !1
|
|
74
80
|
// 只显示 profile 页面,用于 ArcSphere 只需要显示 Profile 的内容
|
|
75
81
|
}) {
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const currentUrl = window.location.href;
|
|
88
|
-
const query = getQuery(currentUrl);
|
|
89
|
-
if (query?.did) {
|
|
90
|
-
if (Array.isArray(query.did)) {
|
|
91
|
-
return query.did[0];
|
|
92
|
-
}
|
|
93
|
-
return query.did;
|
|
94
|
-
}
|
|
95
|
-
return session?.user?.did;
|
|
96
|
-
}, [session?.user?.did, userDid]);
|
|
97
|
-
const isMyself = useCreation(() => {
|
|
98
|
-
if (session?.user) {
|
|
99
|
-
return currentDid === session?.user?.did;
|
|
100
|
-
}
|
|
101
|
-
return false;
|
|
102
|
-
}, [currentDid, session?.user?.did]);
|
|
103
|
-
const userState = useRequest(
|
|
82
|
+
var rr, er, tr;
|
|
83
|
+
const { locale: g } = Ur(), d = Er({ key: "md" }), w = C((e, o = {}) => zr(Ir, e, g, "en", o)), W = vr(Cr), r = W == null ? void 0 : W.session, h = f(() => {
|
|
84
|
+
var p;
|
|
85
|
+
if (S)
|
|
86
|
+
return S;
|
|
87
|
+
const e = window.location.href, o = Rr(e);
|
|
88
|
+
return o != null && o.did ? Array.isArray(o.did) ? o.did[0] : o.did : (p = r == null ? void 0 : r.user) == null ? void 0 : p.did;
|
|
89
|
+
}, [(rr = r == null ? void 0 : r.user) == null ? void 0 : rr.did, S]), n = f(() => {
|
|
90
|
+
var e;
|
|
91
|
+
return r != null && r.user ? h === ((e = r == null ? void 0 : r.user) == null ? void 0 : e.did) : !1;
|
|
92
|
+
}, [h, (er = r == null ? void 0 : r.user) == null ? void 0 : er.did]), l = or(
|
|
104
93
|
// eslint-disable-next-line consistent-return
|
|
105
94
|
async () => {
|
|
106
|
-
await
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (currentDid) {
|
|
111
|
-
return client.user.getUserPublicInfo({ did: currentDid });
|
|
112
|
-
}
|
|
95
|
+
if (await kr(() => r == null ? void 0 : r.initialized), n)
|
|
96
|
+
return r.user;
|
|
97
|
+
if (h)
|
|
98
|
+
return dr.user.getUserPublicInfo({ did: h });
|
|
113
99
|
},
|
|
114
100
|
{
|
|
115
|
-
refreshDeps: [
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
const onRefreshUser = useMemoizedFn(() => {
|
|
119
|
-
if (isMyself) {
|
|
120
|
-
return session.refresh();
|
|
101
|
+
refreshDeps: [h, n, r == null ? void 0 : r.initialized, r == null ? void 0 : r.user]
|
|
121
102
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const privacyState = useRequest(
|
|
125
|
-
async () => {
|
|
126
|
-
if (userState.data && currentTab) {
|
|
127
|
-
const config = await client.user.getUserPrivacyConfig({ did: currentDid });
|
|
128
|
-
return config;
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
131
|
-
},
|
|
103
|
+
), q = C(() => n ? r.refresh() : l.refresh()), c = or(
|
|
104
|
+
async () => l.data && x ? await dr.user.getUserPrivacyConfig({ did: h }) : null,
|
|
132
105
|
{
|
|
133
|
-
refreshDeps: [
|
|
106
|
+
refreshDeps: [h, l.data, x],
|
|
134
107
|
loadingDelay: 300
|
|
135
108
|
}
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
fullScreen: isMobile,
|
|
109
|
+
), { confirmHolder: G } = Wr({
|
|
110
|
+
fullScreen: d,
|
|
139
111
|
sx: {
|
|
140
112
|
".MuiDialog-paper": {
|
|
141
113
|
borderRadius: 1,
|
|
@@ -154,391 +126,300 @@ export default function UserCenter({
|
|
|
154
126
|
}
|
|
155
127
|
}
|
|
156
128
|
}
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
const blocklet = cloneDeep(window.blocklet);
|
|
129
|
+
}), P = f(() => {
|
|
130
|
+
const e = Fr(window.blocklet);
|
|
160
131
|
try {
|
|
161
|
-
return
|
|
162
|
-
} catch (
|
|
163
|
-
console.error("Failed to format blocklet info", e,
|
|
164
|
-
return blocklet;
|
|
132
|
+
return jr(e);
|
|
133
|
+
} catch (o) {
|
|
134
|
+
return console.error("Failed to format blocklet info", o, e), e;
|
|
165
135
|
}
|
|
166
|
-
}, [])
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
isPrivate: false,
|
|
136
|
+
}, []), J = f(() => {
|
|
137
|
+
const e = {
|
|
138
|
+
label: w("common.nft"),
|
|
139
|
+
protected: !1,
|
|
140
|
+
isPrivate: !1,
|
|
172
141
|
// true: 隐私数据,仅自己可见
|
|
173
|
-
value:
|
|
174
|
-
url:
|
|
142
|
+
value: B,
|
|
143
|
+
url: R(B, g)
|
|
175
144
|
};
|
|
176
|
-
let
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const localizedMenus = getLocalizedNavigation(menus, locale) || [];
|
|
201
|
-
const allMenus = localizedMenus.concat(defaultTabs);
|
|
202
|
-
return allMenus.map((x) => {
|
|
203
|
-
const value = x.value ?? x._rawLink ?? x.link ?? x.url;
|
|
145
|
+
let o = [e];
|
|
146
|
+
return n && (o = [
|
|
147
|
+
e,
|
|
148
|
+
{
|
|
149
|
+
label: w("common.setting"),
|
|
150
|
+
protected: !0,
|
|
151
|
+
isPrivate: !0,
|
|
152
|
+
value: I,
|
|
153
|
+
url: R(I, g)
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: w("storageManagement"),
|
|
157
|
+
protected: !0,
|
|
158
|
+
isPrivate: !0,
|
|
159
|
+
value: j,
|
|
160
|
+
url: R(j, g)
|
|
161
|
+
}
|
|
162
|
+
]), o;
|
|
163
|
+
}, [n, g]), a = f(() => {
|
|
164
|
+
var y;
|
|
165
|
+
const e = ((y = P == null ? void 0 : P.navigation) == null ? void 0 : y.userCenter) || [];
|
|
166
|
+
return (Hr(e, g) || []).concat(J).map((u) => {
|
|
167
|
+
var k, ir;
|
|
168
|
+
const U = u.value ?? u._rawLink ?? u.link ?? u.url;
|
|
204
169
|
return {
|
|
205
|
-
value,
|
|
206
|
-
label:
|
|
207
|
-
url:
|
|
208
|
-
protected:
|
|
209
|
-
isPrivate:
|
|
170
|
+
value: U,
|
|
171
|
+
label: u.title || u.label,
|
|
172
|
+
url: u.link || u.url,
|
|
173
|
+
protected: ((k = c == null ? void 0 : c.data) == null ? void 0 : k[U]) ?? !1,
|
|
174
|
+
isPrivate: u.isPrivate || u.private || (((ir = u == null ? void 0 : u._rawLink) == null ? void 0 : ir.includes("/customer")) ?? !1)
|
|
210
175
|
// FIXME: HACK: 隐藏 /customer 菜单, 需要一个通用的解决方案,在嵌入的时候就决定是否是私有的
|
|
211
176
|
// icon: x.icon,
|
|
212
177
|
};
|
|
213
|
-
}).filter((
|
|
214
|
-
}, [
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
178
|
+
}).filter((u) => n || !u.isPrivate);
|
|
179
|
+
}, [P, l.data, c == null ? void 0 : c.data, g, J, n]), t = f(() => a.find((e) => nr(e.value) === nr(x)), [a]), hr = C((e) => {
|
|
180
|
+
const o = a.find((p) => p.value === e);
|
|
181
|
+
o && (window.location.href = lr(o.url, {
|
|
182
|
+
did: n ? void 0 : h
|
|
183
|
+
}));
|
|
184
|
+
}), K = f(() => /* @__PURE__ */ i(
|
|
185
|
+
_r,
|
|
186
|
+
{
|
|
187
|
+
user: l.data,
|
|
188
|
+
settings: { userCenterTabs: a },
|
|
189
|
+
onSave: async (e) => e === "privacy" ? (await c.runAsync(), c.data) : (e === "profile" && await r.refresh(), null),
|
|
190
|
+
isMobile: d
|
|
224
191
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
return currentActiveTab && currentActiveTab?.value === didSpacesLink;
|
|
254
|
-
}, [currentActiveTab]);
|
|
255
|
-
const oauth = session.useOAuth();
|
|
256
|
-
const passkey = session.usePasskey();
|
|
257
|
-
const handleSwitchPassport = useMemoizedFn(() => {
|
|
258
|
-
if (session?.user?.sourceProvider === "passkey") {
|
|
259
|
-
passkey.switchPassport(session.user);
|
|
260
|
-
} else if (["google", "apple", "email", "github"].includes(session?.user?.sourceProvider ?? "")) {
|
|
261
|
-
oauth.switchOAuthPassport(session.user);
|
|
262
|
-
} else if (session) {
|
|
263
|
-
session.switchPassport();
|
|
192
|
+
), [l.data, a, c.data, c.runAsync]), V = f(() => t && (t == null ? void 0 : t.value) === I, [t]), X = f(() => t && (t == null ? void 0 : t.value) === D(M, "/profile") || (t == null ? void 0 : t.value) === B, [t]), xr = f(() => t && (t == null ? void 0 : t.value) === j, [t]), gr = r.useOAuth(), wr = r.usePasskey(), Y = C(() => {
|
|
193
|
+
var e, o;
|
|
194
|
+
((e = r == null ? void 0 : r.user) == null ? void 0 : e.sourceProvider) === "passkey" ? wr.switchPassport(r.user) : ["google", "apple", "email", "github"].includes(((o = r == null ? void 0 : r.user) == null ? void 0 : o.sourceProvider) ?? "") ? gr.switchOAuthPassport(r.user) : r && r.switchPassport();
|
|
195
|
+
}), z = f(() => X ? /* @__PURE__ */ m(
|
|
196
|
+
s,
|
|
197
|
+
{
|
|
198
|
+
sx: {
|
|
199
|
+
display: "flex",
|
|
200
|
+
flexDirection: "column",
|
|
201
|
+
gap: 2.5
|
|
202
|
+
},
|
|
203
|
+
children: [
|
|
204
|
+
n ? /* @__PURE__ */ m(s, { sx: { border: "1px solid", borderColor: "divider", borderRadius: 1.5, p: 2 }, children: [
|
|
205
|
+
/* @__PURE__ */ i(
|
|
206
|
+
br,
|
|
207
|
+
{
|
|
208
|
+
sx: {
|
|
209
|
+
color: "text.primary",
|
|
210
|
+
fontWeight: 600,
|
|
211
|
+
mb: 2.5
|
|
212
|
+
},
|
|
213
|
+
children: w("passport")
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
/* @__PURE__ */ i(Nr, { user: l.data })
|
|
217
|
+
] }) : null,
|
|
218
|
+
/* @__PURE__ */ i(qr, { user: l.data })
|
|
219
|
+
]
|
|
264
220
|
}
|
|
265
|
-
})
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
children: [
|
|
277
|
-
isMyself ? /* @__PURE__ */ jsxs(Box, { sx: { border: "1px solid", borderColor: "divider", borderRadius: 1.5, p: 2 }, children: [
|
|
278
|
-
/* @__PURE__ */ jsx(
|
|
279
|
-
Typography,
|
|
280
|
-
{
|
|
281
|
-
sx: {
|
|
282
|
-
color: "text.primary",
|
|
283
|
-
fontWeight: 600,
|
|
284
|
-
mb: 2.5
|
|
285
|
-
},
|
|
286
|
-
children: t("passport")
|
|
287
|
-
}
|
|
288
|
-
),
|
|
289
|
-
/* @__PURE__ */ jsx(Passport, { user: userState.data })
|
|
290
|
-
] }) : null,
|
|
291
|
-
/* @__PURE__ */ jsx(Nft, { user: userState.data })
|
|
292
|
-
]
|
|
293
|
-
}
|
|
294
|
-
);
|
|
221
|
+
) : V && n ? K : xr && n ? /* @__PURE__ */ i(Or, { children: /* @__PURE__ */ i(Qr, {}) }) : null, [V, X, l, n, O, K]), Z = f(() => /* @__PURE__ */ i(
|
|
222
|
+
s,
|
|
223
|
+
{
|
|
224
|
+
sx: {
|
|
225
|
+
display: {
|
|
226
|
+
xs: n ? "none" : "block",
|
|
227
|
+
md: "block"
|
|
228
|
+
},
|
|
229
|
+
py: 3
|
|
230
|
+
},
|
|
231
|
+
children: /* @__PURE__ */ i(F, { children: w("emptyContent") })
|
|
295
232
|
}
|
|
296
|
-
|
|
297
|
-
|
|
233
|
+
), [n, g]), $ = f(() => !c.data || c.loading ? /* @__PURE__ */ i(
|
|
234
|
+
s,
|
|
235
|
+
{
|
|
236
|
+
sx: {
|
|
237
|
+
height: "100%",
|
|
238
|
+
minWidth: "160px",
|
|
239
|
+
minHeight: "160px",
|
|
240
|
+
display: "flex",
|
|
241
|
+
justifyContent: "center",
|
|
242
|
+
alignItems: "center",
|
|
243
|
+
flex: 1
|
|
244
|
+
},
|
|
245
|
+
children: /* @__PURE__ */ i(yr, {})
|
|
298
246
|
}
|
|
299
|
-
|
|
300
|
-
|
|
247
|
+
) : (
|
|
248
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
249
|
+
/* @__PURE__ */ i(s, { sx: { flex: 1 }, children: t != null && t.protected && !n ? /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(F, { children: w("underProtected") }) }) : (
|
|
250
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
251
|
+
/* @__PURE__ */ i(L, { children: v ? /* @__PURE__ */ i(s, { ..._, children: v }) : /* @__PURE__ */ i(L, { children: z }) })
|
|
252
|
+
) })
|
|
253
|
+
), [c, t, n, v, _, z, g]), T = f(() => {
|
|
254
|
+
var e, o, p, y;
|
|
255
|
+
if (l.loading || r.loading)
|
|
256
|
+
return null;
|
|
257
|
+
if (l.error) {
|
|
258
|
+
if (((o = (e = l.error) == null ? void 0 : e.response) == null ? void 0 : o.status) === 404)
|
|
259
|
+
return /* @__PURE__ */ i(s, { sx: { width: "100%" }, children: /* @__PURE__ */ i(Sr, { status: 404, description: w("noUserFound") }) });
|
|
260
|
+
const k = {
|
|
261
|
+
message: ((y = (p = l.error.response) == null ? void 0 : p.data) == null ? void 0 : y.error) || l.error.message || "error occurred"
|
|
262
|
+
};
|
|
263
|
+
return /* @__PURE__ */ i(s, { sx: { width: "100%" }, children: /* @__PURE__ */ i(Lr, { error: k }) });
|
|
301
264
|
}
|
|
302
|
-
return
|
|
303
|
-
|
|
304
|
-
const emptyContent = useCreation(() => {
|
|
305
|
-
return /* @__PURE__ */ jsx(
|
|
306
|
-
Box,
|
|
265
|
+
return !h && !l.data ? N || /* @__PURE__ */ i(s, { sx: { width: "100%" }, children: /* @__PURE__ */ m(
|
|
266
|
+
s,
|
|
307
267
|
{
|
|
308
268
|
sx: {
|
|
309
|
-
display:
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
269
|
+
display: "flex",
|
|
270
|
+
flexDirection: "column",
|
|
271
|
+
justifyContent: "center",
|
|
272
|
+
alignItems: "center",
|
|
273
|
+
gap: 1
|
|
314
274
|
},
|
|
315
|
-
children:
|
|
275
|
+
children: [
|
|
276
|
+
/* @__PURE__ */ i(F, { children: w("viewAfterLogin") }),
|
|
277
|
+
/* @__PURE__ */ i(Mr, { size: "small", variant: "contained", onClick: () => r.login(), children: w("loginNow") })
|
|
278
|
+
]
|
|
316
279
|
}
|
|
317
|
-
)
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
if (!privacyState.data || privacyState.loading) {
|
|
321
|
-
return /* @__PURE__ */ jsx(
|
|
322
|
-
Box,
|
|
280
|
+
) }) : Q ? /* @__PURE__ */ m(H, { children: [
|
|
281
|
+
a.length > 0 && x ? /* @__PURE__ */ i(
|
|
282
|
+
s,
|
|
323
283
|
{
|
|
324
284
|
sx: {
|
|
285
|
+
display: d ? "block" : "flex",
|
|
325
286
|
height: "100%",
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
display: "flex",
|
|
329
|
-
justifyContent: "center",
|
|
330
|
-
alignItems: "center",
|
|
331
|
-
flex: 1
|
|
287
|
+
overflow: "auto",
|
|
288
|
+
padding: "1px"
|
|
332
289
|
},
|
|
333
|
-
children:
|
|
290
|
+
children: $
|
|
291
|
+
}
|
|
292
|
+
) : null,
|
|
293
|
+
a.length === 0 && Z
|
|
294
|
+
] }) : b ? /* @__PURE__ */ i(H, { display: "flex", flexDirection: d ? "column" : "row", children: /* @__PURE__ */ i(
|
|
295
|
+
sr,
|
|
296
|
+
{
|
|
297
|
+
isMobile: d,
|
|
298
|
+
order: d ? 1 : "unset",
|
|
299
|
+
isMyself: n,
|
|
300
|
+
switchPassport: Y,
|
|
301
|
+
switchProfile: r.switchProfile,
|
|
302
|
+
user: l.data,
|
|
303
|
+
showFullDid: !1,
|
|
304
|
+
onlyProfile: b,
|
|
305
|
+
refreshProfile: q,
|
|
306
|
+
sx: {
|
|
307
|
+
padding: d ? "16px 0 0 0" : "40px 24px 24px 40px",
|
|
308
|
+
...d ? {} : { width: 320, maxWidth: 320, flexShrink: 0 },
|
|
309
|
+
boxSizing: "content-box"
|
|
334
310
|
}
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
return (
|
|
338
|
-
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
339
|
-
/* @__PURE__ */ jsx(Box, { sx: { flex: 1 }, children: currentActiveTab?.protected && !isMyself ? /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Empty, { children: t("underProtected") }) }) : (
|
|
340
|
-
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
341
|
-
/* @__PURE__ */ jsx(Fragment, { children: children ? /* @__PURE__ */ jsx(Box, { ...contentProps, children }) : /* @__PURE__ */ jsx(Fragment, { children: renderDefaultTab }) })
|
|
342
|
-
) })
|
|
343
|
-
);
|
|
344
|
-
}, [privacyState, currentActiveTab, isMyself, children, contentProps, renderDefaultTab, locale]);
|
|
345
|
-
const content = useCreation(() => {
|
|
346
|
-
if (userState.loading || session.loading) {
|
|
347
|
-
return null;
|
|
348
|
-
}
|
|
349
|
-
if (userState.error) {
|
|
350
|
-
const errorStatus = userState.error?.response?.status;
|
|
351
|
-
if (errorStatus === 404) {
|
|
352
|
-
return /* @__PURE__ */ jsx(Box, { sx: { width: "100%" }, children: /* @__PURE__ */ jsx(Result, { status: 404, description: t("noUserFound") }) });
|
|
353
|
-
}
|
|
354
|
-
const errorMessage = userState.error.response?.data?.error || userState.error.message || "error occurred";
|
|
355
|
-
const formatError = {
|
|
356
|
-
message: errorMessage
|
|
357
|
-
};
|
|
358
|
-
return /* @__PURE__ */ jsx(Box, { sx: { width: "100%" }, children: /* @__PURE__ */ jsx(ErrorFallback, { error: formatError }) });
|
|
359
|
-
}
|
|
360
|
-
if (!currentDid && !userState.data) {
|
|
361
|
-
if (notLoginContent) {
|
|
362
|
-
return notLoginContent;
|
|
363
311
|
}
|
|
364
|
-
|
|
365
|
-
|
|
312
|
+
) }) : /* @__PURE__ */ m(H, { display: "flex", flexDirection: d ? "column" : "row", children: [
|
|
313
|
+
/* @__PURE__ */ m(
|
|
314
|
+
s,
|
|
366
315
|
{
|
|
316
|
+
className: "user-center-tabs",
|
|
367
317
|
sx: {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
justifyContent: "center",
|
|
371
|
-
alignItems: "center",
|
|
372
|
-
gap: 1
|
|
318
|
+
flex: "1",
|
|
319
|
+
order: d ? 2 : "unset"
|
|
373
320
|
},
|
|
374
321
|
children: [
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
return /* @__PURE__ */ jsxs(ContentWrapper, { display: "flex", flexDirection: isMobile ? "column" : "row", children: [
|
|
420
|
-
/* @__PURE__ */ jsxs(Box, { flex: "1", className: "user-center-tabs", order: isMobile ? 2 : "unset", children: [
|
|
421
|
-
userCenterTabs.length > 0 && currentTab ? /* @__PURE__ */ jsxs(
|
|
422
|
-
Box,
|
|
423
|
-
{
|
|
424
|
-
display: "flex",
|
|
425
|
-
flexDirection: "column",
|
|
426
|
-
sx: {
|
|
427
|
-
height: "100%",
|
|
428
|
-
overflow: "auto",
|
|
429
|
-
padding: "1px"
|
|
430
|
-
},
|
|
431
|
-
children: [
|
|
432
|
-
/* @__PURE__ */ jsx(
|
|
433
|
-
Tabs,
|
|
434
|
-
{
|
|
435
|
-
orientation: "horizontal",
|
|
436
|
-
variant: "line",
|
|
437
|
-
tabs: userCenterTabs,
|
|
438
|
-
current: currentActiveTab?.value ?? currentTab,
|
|
439
|
-
onChange: handleChangeTab,
|
|
440
|
-
sx: {
|
|
441
|
-
mb: 2,
|
|
442
|
-
".MuiTabs-flexContainer": {
|
|
443
|
-
gap: 3,
|
|
444
|
-
".MuiButtonBase-root": {
|
|
445
|
-
padding: isMobile ? "16px 4px" : "40px 4px 32px 4px",
|
|
446
|
-
fontSize: 16
|
|
447
|
-
},
|
|
448
|
-
".MuiTab-root": {
|
|
449
|
-
display: "block",
|
|
450
|
-
textAlign: "left",
|
|
451
|
-
alignItems: "flex-start",
|
|
452
|
-
justifyContent: "flex-start",
|
|
453
|
-
fontWeight: 400
|
|
454
|
-
}
|
|
455
|
-
},
|
|
456
|
-
".MuiTabs-root": {
|
|
457
|
-
"&:after": {
|
|
458
|
-
content: '""',
|
|
459
|
-
display: "block",
|
|
460
|
-
width: "100%",
|
|
461
|
-
height: "1px",
|
|
462
|
-
backgroundColor: "divider"
|
|
322
|
+
a.length > 0 && x ? /* @__PURE__ */ m(
|
|
323
|
+
s,
|
|
324
|
+
{
|
|
325
|
+
sx: {
|
|
326
|
+
display: "flex",
|
|
327
|
+
flexDirection: "column",
|
|
328
|
+
height: "100%",
|
|
329
|
+
overflow: "auto",
|
|
330
|
+
padding: "1px"
|
|
331
|
+
},
|
|
332
|
+
children: [
|
|
333
|
+
/* @__PURE__ */ i(
|
|
334
|
+
Dr,
|
|
335
|
+
{
|
|
336
|
+
orientation: "horizontal",
|
|
337
|
+
variant: "line",
|
|
338
|
+
tabs: a,
|
|
339
|
+
current: (t == null ? void 0 : t.value) ?? x,
|
|
340
|
+
onChange: hr,
|
|
341
|
+
sx: {
|
|
342
|
+
mb: 2,
|
|
343
|
+
".MuiTabs-flexContainer": {
|
|
344
|
+
gap: 3,
|
|
345
|
+
".MuiButtonBase-root": {
|
|
346
|
+
padding: d ? "16px 4px" : "40px 4px 32px 4px",
|
|
347
|
+
fontSize: 16
|
|
348
|
+
},
|
|
349
|
+
".MuiTab-root": {
|
|
350
|
+
display: "block",
|
|
351
|
+
textAlign: "left",
|
|
352
|
+
alignItems: "flex-start",
|
|
353
|
+
justifyContent: "flex-start",
|
|
354
|
+
fontWeight: 400
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
".MuiTabs-root": {
|
|
358
|
+
"&:after": {
|
|
359
|
+
content: '""',
|
|
360
|
+
display: "block",
|
|
361
|
+
width: "100%",
|
|
362
|
+
height: "1px",
|
|
363
|
+
backgroundColor: "divider"
|
|
364
|
+
}
|
|
365
|
+
}
|
|
463
366
|
}
|
|
464
367
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
!
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
|
|
368
|
+
),
|
|
369
|
+
$
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
) : null,
|
|
373
|
+
a.length === 0 && Z
|
|
374
|
+
]
|
|
375
|
+
}
|
|
376
|
+
),
|
|
377
|
+
!d && /* @__PURE__ */ i(Pr, { orientation: "vertical", sx: { ml: 5 } }),
|
|
378
|
+
/* @__PURE__ */ i(
|
|
379
|
+
sr,
|
|
477
380
|
{
|
|
478
|
-
isMobile,
|
|
479
|
-
order:
|
|
480
|
-
isMyself,
|
|
481
|
-
switchPassport:
|
|
482
|
-
switchProfile:
|
|
483
|
-
user:
|
|
484
|
-
refreshProfile:
|
|
485
|
-
showFullDid:
|
|
381
|
+
isMobile: d,
|
|
382
|
+
order: d ? 1 : "unset",
|
|
383
|
+
isMyself: n,
|
|
384
|
+
switchPassport: Y,
|
|
385
|
+
switchProfile: r.switchProfile,
|
|
386
|
+
user: l.data,
|
|
387
|
+
refreshProfile: q,
|
|
388
|
+
showFullDid: !1,
|
|
486
389
|
sx: {
|
|
487
|
-
padding:
|
|
488
|
-
|
|
390
|
+
padding: d ? "16px 0 0 0" : "40px 24px 24px 40px",
|
|
391
|
+
...d ? {} : { width: 320, maxWidth: 320, flexShrink: 0 },
|
|
489
392
|
boxSizing: "content-box"
|
|
490
393
|
}
|
|
491
394
|
}
|
|
492
395
|
)
|
|
493
396
|
] });
|
|
494
397
|
}, [
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
]);
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
if (onlyProfile) {
|
|
512
|
-
return false;
|
|
513
|
-
}
|
|
514
|
-
const noActiveTabButHasTabs = !disableAutoRedirect && !currentTab && userCenterTabs?.length > 0;
|
|
515
|
-
const invalidCurrentTab = !currentActiveTab;
|
|
516
|
-
const accessingPrivateTab = isPrivateActive;
|
|
517
|
-
return noActiveTabButHasTabs || invalidCurrentTab || accessingPrivateTab;
|
|
518
|
-
}, [disableAutoRedirect, currentTab, userCenterTabs, currentActiveTab, isPrivateActive, onlyProfile]);
|
|
519
|
-
if (shouldRedirect) {
|
|
520
|
-
const firstUserCenterUrl = userCenterTabs[0]?.url;
|
|
521
|
-
const firstTab = userCenterTabs.find((x) => x.value === firstUserCenterUrl);
|
|
522
|
-
if (firstUserCenterUrl && !firstTab?.isPrivate) {
|
|
523
|
-
window.location.replace(
|
|
524
|
-
withQuery(firstUserCenterUrl, {
|
|
525
|
-
did: isMyself ? void 0 : currentDid
|
|
526
|
-
})
|
|
527
|
-
);
|
|
528
|
-
}
|
|
529
|
-
return null;
|
|
530
|
-
}
|
|
531
|
-
if (embed || onlyProfile) {
|
|
532
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
533
|
-
/* @__PURE__ */ jsx(Header, { style: { display: "none" } }),
|
|
534
|
-
/* @__PURE__ */ jsxs(Main, { children: [
|
|
535
|
-
content,
|
|
536
|
-
confirmHolder
|
|
537
|
-
] })
|
|
538
|
-
] });
|
|
398
|
+
l,
|
|
399
|
+
a,
|
|
400
|
+
n,
|
|
401
|
+
t,
|
|
402
|
+
c,
|
|
403
|
+
x,
|
|
404
|
+
O,
|
|
405
|
+
z
|
|
406
|
+
]), A = f(() => n ? !1 : t == null ? void 0 : t.isPrivate, [n, t]);
|
|
407
|
+
if (f(() => b ? !1 : !E && !x && (a == null ? void 0 : a.length) > 0 || !t || A, [E, x, a, t, A, b])) {
|
|
408
|
+
const e = (tr = a[0]) == null ? void 0 : tr.url, o = a.find((p) => p.value === e);
|
|
409
|
+
return e && !(o != null && o.isPrivate) && window.location.replace(
|
|
410
|
+
lr(e, {
|
|
411
|
+
did: n ? void 0 : h
|
|
412
|
+
})
|
|
413
|
+
), null;
|
|
539
414
|
}
|
|
540
|
-
return /* @__PURE__ */
|
|
541
|
-
|
|
415
|
+
return Q || b ? /* @__PURE__ */ m(L, { children: [
|
|
416
|
+
/* @__PURE__ */ i(ar, { style: { display: "none" } }),
|
|
417
|
+
/* @__PURE__ */ m(ur, { children: [
|
|
418
|
+
T,
|
|
419
|
+
G
|
|
420
|
+
] })
|
|
421
|
+
] }) : /* @__PURE__ */ m(
|
|
422
|
+
s,
|
|
542
423
|
{
|
|
543
424
|
sx: {
|
|
544
425
|
minHeight: "100vh",
|
|
@@ -546,16 +427,16 @@ export default function UserCenter({
|
|
|
546
427
|
flexDirection: "column"
|
|
547
428
|
},
|
|
548
429
|
children: [
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
|
|
552
|
-
|
|
430
|
+
/* @__PURE__ */ i(ar, { bordered: !0, ...pr, maxWidth: "100%" }),
|
|
431
|
+
/* @__PURE__ */ m(ur, { children: [
|
|
432
|
+
T,
|
|
433
|
+
G
|
|
553
434
|
] }),
|
|
554
|
-
|
|
555
|
-
|
|
435
|
+
cr ? null : /* @__PURE__ */ i(
|
|
436
|
+
Br,
|
|
556
437
|
{
|
|
557
|
-
bordered:
|
|
558
|
-
...
|
|
438
|
+
bordered: !0,
|
|
439
|
+
...mr,
|
|
559
440
|
sx: {
|
|
560
441
|
".MuiContainer-root": {
|
|
561
442
|
maxWidth: 1600
|
|
@@ -567,3 +448,6 @@ export default function UserCenter({
|
|
|
567
448
|
}
|
|
568
449
|
);
|
|
569
450
|
}
|
|
451
|
+
export {
|
|
452
|
+
Le as default
|
|
453
|
+
};
|