diff --git a/packages/frontend/core/src/components/affine/setting-modal/index.tsx b/packages/frontend/core/src/components/affine/setting-modal/index.tsx index 68e1371202..bad3cc6713 100644 --- a/packages/frontend/core/src/components/affine/setting-modal/index.tsx +++ b/packages/frontend/core/src/components/affine/setting-modal/index.tsx @@ -1,3 +1,4 @@ +import { Loading } from '@affine/component'; import { WorkspaceDetailSkeleton } from '@affine/component/setting-components'; import { Modal, type ModalProps } from '@affine/component/ui/modal'; import { @@ -36,7 +37,15 @@ export interface SettingProps extends ModalProps { const isGeneralSetting = (key: string): key is GeneralSettingKey => GeneralSettingKeys.includes(key as GeneralSettingKey); -export const SettingModal = ({ +const CenteredLoading = () => { + return ( +
+ +
+ ); +}; + +const SettingModalInner = ({ activeTab = 'appearance', workspaceMetadata = null, onSettingClick, @@ -95,27 +104,12 @@ export const SettingModal = ({ }, [setOpenStarAFFiNEModal]); return ( - + <> -
+ + ); +}; + +export const SettingModal = ({ + activeTab = 'appearance', + workspaceMetadata = null, + onSettingClick, + ...modalProps +}: SettingProps) => { + return ( + + }> + + ); }; diff --git a/packages/frontend/core/src/components/affine/setting-modal/style.css.ts b/packages/frontend/core/src/components/affine/setting-modal/style.css.ts index 57f98c750c..8b95a4e82a 100644 --- a/packages/frontend/core/src/components/affine/setting-modal/style.css.ts +++ b/packages/frontend/core/src/components/affine/setting-modal/style.css.ts @@ -51,3 +51,11 @@ export const link = style({ color: cssVar('linkColor'), cursor: 'pointer', }); + +export const centeredLoading = style({ + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + height: '100%', + width: '100%', +}); diff --git a/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.css.ts b/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.css.ts index 26f78c7fe3..86650bbe09 100644 --- a/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.css.ts +++ b/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.css.ts @@ -49,3 +49,10 @@ export const signInTextSecondary = style({ export const menuItem = style({ borderRadius: '8px', }); +export const loadingWrapper = style({ + height: 42, + width: '100%', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', +}); diff --git a/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.tsx b/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.tsx index 216335fce4..303db9826c 100644 --- a/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.tsx +++ b/packages/frontend/core/src/components/pure/workspace-slider-bar/user-with-workspace-list/index.tsx @@ -1,3 +1,4 @@ +import { Loading } from '@affine/component'; import { Divider } from '@affine/component/ui/divider'; import { MenuItem } from '@affine/component/ui/menu'; import { useSession } from '@affine/core/hooks/affine/use-current-user'; @@ -8,7 +9,7 @@ import { WorkspaceManager } from '@toeverything/infra'; import { useService } from '@toeverything/infra/di'; import { useLiveData } from '@toeverything/infra/livedata'; import { useSetAtom } from 'jotai'; -import { useCallback, useEffect } from 'react'; +import { Suspense, useCallback, useEffect } from 'react'; import { authAtom, @@ -62,11 +63,21 @@ const SignInItem = () => { ); }; -export const UserWithWorkspaceList = ({ - onEventEnd, -}: { +const UserWithWorkspaceListLoading = () => { + return ( +
+ +
+ ); +}; + +interface UserWithWorkspaceListProps { onEventEnd?: () => void; -}) => { +} + +const UserWithWorkspaceListInner = ({ + onEventEnd, +}: UserWithWorkspaceListProps) => { const { user, status } = useSession(); const isAuthenticated = status === 'authenticated'; @@ -139,3 +150,11 @@ export const UserWithWorkspaceList = ({ ); }; + +export const UserWithWorkspaceList = (props: UserWithWorkspaceListProps) => { + return ( + }> + + + ); +};