diff --git a/apps/core/src/components/pure/workspace-list-modal/index.tsx b/apps/core/src/components/pure/workspace-list-modal/index.tsx index ec929e4a5b..e42f261d77 100644 --- a/apps/core/src/components/pure/workspace-list-modal/index.tsx +++ b/apps/core/src/components/pure/workspace-list-modal/index.tsx @@ -1,5 +1,4 @@ import { Menu, MenuItem, Tooltip } from '@affine/component'; -import { ScrollableContainer } from '@affine/component'; import { WorkspaceList } from '@affine/component/workspace-list'; import type { AffineCloudWorkspace, @@ -32,7 +31,9 @@ import { StyledImportWorkspaceCardPill, StyledModalBody, StyledModalContent, + StyledModalFooterContent, StyledModalHeader, + StyledModalHeaderContent, StyledModalHeaderLeft, StyledModalTitle, StyledOperationWrapper, @@ -170,141 +171,140 @@ export const WorkspaceListModal = ({ zIndex: 999, '& .MuiPopover-paper': { borderRadius: '8px', - boxShadow: 'var(--affine-shadow-1)', + display: 'flex', + flexDirection: 'column', + boxShadow: 'var(--affine-shadow-2)', + backgroundColor: 'var(--affine-background-overlay-panel-color)', }, + maxHeight: '90vh', }} open={open} anchorEl={anchorEl} onClose={onClose} > - - - {isLoggedIn ? ( - - ) : ( - <> - - - { - if (!runtimeConfig.enableCloud) { - setOpen(true); - } - }} - data-testid="cloud-signin-button" - > - - - - - - - {t['com.affine.workspace.cloud.auth']()} - - - Sync with AFFiNE Cloud - - - - - - - - - )} - - {t['Local Workspace']()} - - - - - - - - flavour !== WorkspaceFlavour.PUBLIC - ) as (AffineCloudWorkspace | LocalWorkspace)[] + + + { + if (!runtimeConfig.enableCloud) { + setOpen(true); } - currentWorkspaceId={currentWorkspaceId} - onClick={onClickWorkspace} - onSettingClick={onClickWorkspaceSetting} - onDragEnd={useCallback( - (event: DragEndEvent) => { - const { active, over } = event; - if (active.id !== over?.id) { - onMoveWorkspace(active.id as string, over?.id as string); - } - }, - [onMoveWorkspace] - )} - /> - - - {runtimeConfig.enableSQLiteProvider && environment.isDesktop ? ( - - - - - - -
-

{t['com.affine.workspace.local.import']()}

-
-
-
-
- ) : null} - - - - - - -
-

{t['New Workspace']()}

-
-
-
-
-
-
+ }} + data-testid="cloud-signin-button" + > + + + + + + + {t['com.affine.workspace.cloud.auth']()} + + + Sync with AFFiNE Cloud + + + + + + + + + {isLoggedIn ? ( + + ) : null} + + {t['Local Workspace']()} + + + + + + + + flavour !== WorkspaceFlavour.PUBLIC + ) as (AffineCloudWorkspace | LocalWorkspace)[] + } + currentWorkspaceId={currentWorkspaceId} + onClick={onClickWorkspace} + onSettingClick={onClickWorkspaceSetting} + onDragEnd={useCallback( + (event: DragEndEvent) => { + const { active, over } = event; + if (active.id !== over?.id) { + onMoveWorkspace(active.id as string, over?.id as string); + } + }, + [onMoveWorkspace] + )} + /> + + {runtimeConfig.enableSQLiteProvider && environment.isDesktop ? ( + + + + + + +
+

{t['com.affine.workspace.local.import']()}

+
+
+
+
+ ) : null}
+ + + + + + + +
+

{t['New Workspace']()}

+
+
+
+
+
); }; diff --git a/apps/core/src/components/pure/workspace-list-modal/styles.ts b/apps/core/src/components/pure/workspace-list-modal/styles.ts index 8e6447c6d3..96d1f517ff 100644 --- a/apps/core/src/components/pure/workspace-list-modal/styles.ts +++ b/apps/core/src/components/pure/workspace-list-modal/styles.ts @@ -86,7 +86,6 @@ export const StyledCreateWorkspaceCardPill = styled('div')(() => { display: 'flex', width: '100%', height: '58px', - background: 'var(--affine-background-primary-color)', border: `1px solid var(--affine-border-color)`, }; }); @@ -97,8 +96,6 @@ export const StyledSignInCardPill = styled('div')(() => { display: 'flex', width: '100%', height: '58px', - marginBottom: '6px', - background: 'var(--affine-background-primary-color)', }; }); @@ -107,7 +104,6 @@ export const StyledImportWorkspaceCardPill = styled('div')(() => { borderRadius: '5px', display: 'flex', width: '100%', - marginBottom: '12px', }; }); @@ -176,7 +172,27 @@ export const StyledModalContent = styled('div')({ ...displayFlex('space-between', 'flex-start', 'flex-start'), flexWrap: 'wrap', flexDirection: 'column', + width: '100%', }); + +export const StyledModalFooterContent = styled('div')({ + ...displayFlex('space-between', 'flex-start', 'flex-start'), + flexWrap: 'wrap', + flexDirection: 'column', + width: '100%', + padding: '12px', + backgroundColor: 'var(--affine-background-overlay-panel-color)', +}); + +export const StyledModalHeaderContent = styled('div')({ + ...displayFlex('space-between', 'flex-start', 'flex-start'), + flexWrap: 'wrap', + flexDirection: 'column', + width: '100%', + padding: '12px 12px 0px 12px', + backgroundColor: 'var(--affine-background-overlay-panel-color)', +}); + export const StyledOperationWrapper = styled('div')(() => { return { ...displayFlex('flex-end', 'center'), @@ -188,13 +204,13 @@ export const StyleWorkspaceAdd = styled('div')(() => { width: '58px', height: '58px', borderRadius: '100%', - background: 'var(--affine-white-80)', + background: 'var(--affine-background-overlay-panel-color)', border: '1.5px dashed #f4f5fa', transition: 'background .2s', fontSize: '24px', ...displayFlex('center', 'center'), borderColor: 'var(--affine-white)', - color: 'var(--affine-primary-color)', + color: 'var(--affine-background-overlay-panel-color)', }; }); export const StyledModalHeader = styled('div')(() => { @@ -210,12 +226,12 @@ export const StyledModalHeader = styled('div')(() => { export const StyledModalBody = styled('div')(() => { return { - borderRadius: '8px', - padding: '12px', + padding: '0px 12px', display: 'inline-flex', flexDirection: 'column', alignItems: 'flex-start', gap: '12px', - background: 'var(--affine-white)', + flex: 1, + overflowY: 'auto', }; }); diff --git a/packages/component/src/components/card/workspace-card/index.tsx b/packages/component/src/components/card/workspace-card/index.tsx index e769809c9f..0ee7ec8454 100644 --- a/packages/component/src/components/card/workspace-card/index.tsx +++ b/packages/component/src/components/card/workspace-card/index.tsx @@ -2,11 +2,6 @@ import { WorkspaceFlavour } from '@affine/env/workspace'; import { useAFFiNEI18N } from '@affine/i18n/hooks'; import type { RootWorkspaceMetadata } from '@affine/workspace/atom'; import { SettingsIcon } from '@blocksuite/icons'; -import { - CloudWorkspaceIcon as DefaultCloudWorkspaceIcon, - CollaborationIcon as DefaultJoinedWorkspaceIcon, - LocalWorkspaceIcon as DefaultLocalWorkspaceIcon, -} from '@blocksuite/icons'; import { useBlockSuiteWorkspaceName } from '@toeverything/hooks/use-block-suite-workspace-name'; import { useStaticBlockSuiteWorkspace } from '@toeverything/infra/__internal__/react'; import { useCallback } from 'react'; @@ -19,21 +14,6 @@ import { StyledWorkspaceTitle, } from './styles'; -const JoinedWorkspaceIcon = () => { - return ; -}; -const LocalWorkspaceIcon = () => { - return ; -}; - -const CloudWorkspaceIcon = () => { - return ; -}; - -// const LocalDataIcon = () => { -// return ; -// }; - export interface WorkspaceTypeProps { flavour: WorkspaceFlavour; } @@ -46,7 +26,6 @@ const WorkspaceType = ({ flavour }: WorkspaceTypeProps) => { if (flavour === WorkspaceFlavour.LOCAL) { return (

- {t['Local Workspace']()}

); @@ -54,12 +33,10 @@ const WorkspaceType = ({ flavour }: WorkspaceTypeProps) => { return isOwner ? (

- {t['Cloud Workspace']()}

) : (

- {t['Joined Workspace']()}

); diff --git a/packages/component/src/ui/tooltip/tooltip.tsx b/packages/component/src/ui/tooltip/tooltip.tsx index c2a94a5d9e..f44d9facf7 100644 --- a/packages/component/src/ui/tooltip/tooltip.tsx +++ b/packages/component/src/ui/tooltip/tooltip.tsx @@ -8,7 +8,7 @@ import StyledPopperContainer from '../shared/container'; const StyledTooltip = styled(StyledPopperContainer)(() => { return { display: 'inline-flex', - height: '38px', + minHeight: '38px', flexDirection: 'column', justifyContent: 'center', alignItems: 'center',