diff --git a/apps/web/src/components/blocksuite/workspace-header/download-tips.tsx b/apps/web/src/components/blocksuite/workspace-header/download-tips.tsx index 4ee3fc554a..e4dfd3e6bf 100644 --- a/apps/web/src/components/blocksuite/workspace-header/download-tips.tsx +++ b/apps/web/src/components/blocksuite/workspace-header/download-tips.tsx @@ -1,21 +1,27 @@ import { DownloadTips } from '@affine/component/affine-banner'; import { isDesktop } from '@affine/env/constant'; -import { useAtom } from 'jotai'; -import { useCallback } from 'react'; -import { guideDownloadClientTipAtom } from '../../../atoms/guide'; +export const DownloadClientTip = ({ + show, + onClose, +}: { + // const [showDownloadClientTips, setShowDownloadClientTips] = useAtom( + // guideDownloadClientTipAtom + // ); + // const onCloseDownloadClient = useCallback(() => { + // setShowDownloadClientTips(false); + // }, [setShowDownloadClientTips]); -export const DownloadClientTip = () => { - const [showDownloadClientTips, setShowDownloadClientTips] = useAtom( - guideDownloadClientTipAtom - ); - const onCloseDownloadClient = useCallback(() => { - setShowDownloadClientTips(false); - }, [setShowDownloadClientTips]); + // if (!showDownloadClientTips || isDesktop) { + // return <>; + // } - if (!showDownloadClientTips || isDesktop) { - return <>; + show: boolean; + onClose: () => void; +}) => { + if (!show || isDesktop) { + return null; } - return ; + return ; }; export default DownloadClientTip; diff --git a/apps/web/src/components/blocksuite/workspace-header/header.tsx b/apps/web/src/components/blocksuite/workspace-header/header.tsx index 3ee4db07d6..99849b8428 100644 --- a/apps/web/src/components/blocksuite/workspace-header/header.tsx +++ b/apps/web/src/components/blocksuite/workspace-header/header.tsx @@ -10,7 +10,7 @@ import { CloseIcon, MinusIcon, RoundedRectangleIcon } from '@blocksuite/icons'; import type { Page } from '@blocksuite/store'; import { affinePluginsAtom } from '@toeverything/plugin-infra/manager'; import type { PluginUIAdapter } from '@toeverything/plugin-infra/type'; -import { useAtom, useAtomValue } from 'jotai'; +import { useAtomValue } from 'jotai'; import type { FC, HTMLAttributes, PropsWithChildren, ReactNode } from 'react'; import { forwardRef, @@ -21,7 +21,6 @@ import { useState, } from 'react'; -import { guideDownloadClientTipAtom } from '../../../atoms/guide'; import { contentLayoutAtom } from '../../../atoms/layout'; import { currentModeAtom } from '../../../atoms/mode'; import type { AffineOfficialWorkspace } from '../../../shared'; @@ -194,14 +193,13 @@ export const Header = forwardRef< >((props, ref) => { const [showWarning, setShowWarning] = useState(false); const [showGuideDownloadClientTip, setShowGuideDownloadClientTip] = - useState(false); - const [shouldShowGuideDownloadClientTip] = useAtom( - guideDownloadClientTipAtom - ); + useState(true); + // const [shouldShowGuideDownloadClientTip] = useAtom( + // guideDownloadClientTipAtom + // ); useEffect(() => { setShowWarning(shouldShowWarning()); - setShowGuideDownloadClientTip(shouldShowGuideDownloadClientTip); - }, [shouldShowGuideDownloadClientTip]); + }, []); const open = useAtomValue(appSidebarOpenAtom); const appSidebarFloating = useAtomValue(appSidebarFloatingAtom); @@ -216,7 +214,12 @@ export const Header = forwardRef< data-sidebar-floating={appSidebarFloating} > {showGuideDownloadClientTip ? ( - + { + setShowGuideDownloadClientTip(false); + }} + /> ) : ( void }) => {
- Enjoying the demo? + This demo is limited. void }) => { > Download the AFFiNE Client - for the full experience. + for the latest features and Performance.
diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.json index 36943a056f..c74d5d0b1f 100644 --- a/packages/i18n/src/resources/en.json +++ b/packages/i18n/src/resources/en.json @@ -32,7 +32,7 @@ "com.affine.onboarding.title2": "Intuitive & robust block-based editing", "com.affine.onboarding.videoDescription1": "Easily switch between Page mode for structured document creation and Whiteboard mode for the freeform visual expression of creative ideas.", "com.affine.onboarding.videoDescription2": "Create structured documents with ease, using a modular interface to drag and drop blocks of text, images, and other content.", - "com.affine.banner.content": "Enjoying the demo? <1>Download the AFFiNE Client for the full experience.", + "com.affine.banner.content": "This demo is limited. <1>Download the AFFiNE Client for the latest features and Performance.", "com.affine.helpIsland.gettingStarted": "Getting started", "com.affine.updater.downloading": "Downloading", "com.affine.updater.update-available": "Update available", diff --git a/packages/i18n/src/resources/zh-Hans.json b/packages/i18n/src/resources/zh-Hans.json index 7932390462..796f625ed2 100644 --- a/packages/i18n/src/resources/zh-Hans.json +++ b/packages/i18n/src/resources/zh-Hans.json @@ -57,7 +57,7 @@ "com.affine.emptyDesc": "这里还没有页面", "com.affine.last7Days": "过去 7 天", "com.affine.lastMonth": "上个月", - "com.affine.banner.content": "正在享受演示吗?<1>下载 AFFiNE 客户端以获得完整体验。", + "com.affine.banner.content": "此演示有限。<1>下载 AFFiNE 客户端以获取最新功能和表现。", "com.affine.cloudTempDisable.title": "AFFiNE Cloud 正在进行升级。", "com.affine.cloudTempDisable.description": "我们正在升级 AFFiNE Cloud 服务,客户端暂时不可启用它。如果您希望随时了解进度并收到关于云服务的可用性通知,您可以填写我们的<1>表单。", "com.affine.edgelessMode": "无界模式", diff --git a/tests/affine-local/e2e/all-page.spec.ts b/tests/affine-local/e2e/all-page.spec.ts index d69943210e..83e5973d6e 100644 --- a/tests/affine-local/e2e/all-page.spec.ts +++ b/tests/affine-local/e2e/all-page.spec.ts @@ -177,6 +177,7 @@ test('allow creation of filters by tags', async ({ page }) => { await createPageWithTag(page, { title: 'Page A', tags: ['A'] }); await createPageWithTag(page, { title: 'Page B', tags: ['B'] }); await clickSideBarAllPageButton(page); + await closeDownloadTip(page); await createFirstFilter(page, 'Tags'); await checkFilterName(page, 'is not empty'); await checkPagesCount(page, 2); diff --git a/tests/affine-local/e2e/open-affine.spec.ts b/tests/affine-local/e2e/open-affine.spec.ts index e338af4506..27aa2971dc 100644 --- a/tests/affine-local/e2e/open-affine.spec.ts +++ b/tests/affine-local/e2e/open-affine.spec.ts @@ -40,5 +40,5 @@ test('Download client tip', async ({ page }) => { const currentDownloadClientTipItem = page.locator( '[data-testid=download-client-tip]' ); - await expect(currentDownloadClientTipItem).not.toBeVisible(); + await expect(currentDownloadClientTipItem).toBeVisible(); });