From fbe7a346c60caff6779c750e0d2c7a66f94382af Mon Sep 17 00:00:00 2001 From: CatsJuice Date: Thu, 28 Mar 2024 07:13:27 +0000 Subject: [PATCH] fix(core): adjust sidebar workspace card syncing tooltip style (#6356) --- .../component/src/ui/tooltip/tooltip.tsx | 6 ++- .../workspace-card/index.tsx | 8 ++- .../workspace-card/styles.css.ts | 8 +++ .../workspace-card/styles.ts | 54 ------------------- 4 files changed, 18 insertions(+), 58 deletions(-) delete mode 100644 packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/styles.ts diff --git a/packages/frontend/component/src/ui/tooltip/tooltip.tsx b/packages/frontend/component/src/ui/tooltip/tooltip.tsx index 4dc827865c..423aaed81e 100644 --- a/packages/frontend/component/src/ui/tooltip/tooltip.tsx +++ b/packages/frontend/component/src/ui/tooltip/tooltip.tsx @@ -4,6 +4,7 @@ import type { TooltipProps as RootProps, } from '@radix-ui/react-tooltip'; import * as TooltipPrimitive from '@radix-ui/react-tooltip'; +import clsx from 'clsx'; import type { ReactElement, ReactNode } from 'react'; import * as styles from './styles.css'; @@ -32,6 +33,7 @@ export const Tooltip = ({ if (!content) { return children; } + const { className, ...contentOptions } = options || {}; return ( @@ -39,12 +41,12 @@ export const Tooltip = ({ {content} { return ( <> {!environment.isDesktop ? ( - + ) : ( )} @@ -234,7 +235,10 @@ const WorkspaceInfo = ({ name }: { name: string }) => { {/* when syncing/offline/... */}
- +
diff --git a/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/styles.css.ts b/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/styles.css.ts index 42b56e7389..ddfd99431f 100644 --- a/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/styles.css.ts +++ b/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/styles.css.ts @@ -96,4 +96,12 @@ export const workspaceActiveStatus = style({ globalStyle(`.${workspaceActiveStatus} svg`, { width: 16, height: 16, + color: cssVar('iconSecondary'), +}); + +export const workspaceInfoTooltip = style({ + fontSize: cssVar('fontXs'), + lineHeight: '20px', + padding: '0 8px', + minHeight: 20, }); diff --git a/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/styles.ts b/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/styles.ts deleted file mode 100644 index 55d0fb3ec6..0000000000 --- a/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/styles.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { displayFlex, styled, textEllipsis } from '@affine/component'; -import { cssVar } from '@toeverything/theme'; -export const StyledSelectorContainer = styled('div')({ - height: '50px', - display: 'flex', - alignItems: 'center', - padding: '0 6px', - borderRadius: '8px', - outline: 'none', - width: 'fit-content', - maxWidth: '100%', - color: cssVar('textPrimaryColor'), - ':hover': { - cursor: 'pointer', - background: cssVar('hoverColor'), - }, -}); - -export const StyledSelectorWrapper = styled('div')(() => { - return { - marginLeft: '8px', - flexGrow: 1, - overflow: 'hidden', - }; -}); -export const StyledWorkspaceName = styled('div')(() => { - return { - fontSize: cssVar('fontSm'), - lineHeight: '22px', - fontWeight: 500, - userSelect: 'none', - ...textEllipsis(1), - marginLeft: '4px', - }; -}); - -export const StyledWorkspaceStatus = styled('div')(() => { - return { - height: '22px', - ...displayFlex('flex-start', 'center'), - fontSize: cssVar('fontXs'), - color: cssVar('black50'), - userSelect: 'none', - padding: '0 4px', - gap: '4px', - zIndex: '1', - svg: { - color: cssVar('iconSecondary'), - '&[data-warning-color="true"]': { - color: cssVar('errorColor'), - }, - }, - }; -});