mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
chore: increase the frequency of the banner (#3264)
This commit is contained in:
@@ -1,21 +1,27 @@
|
|||||||
import { DownloadTips } from '@affine/component/affine-banner';
|
import { DownloadTips } from '@affine/component/affine-banner';
|
||||||
import { isDesktop } from '@affine/env/constant';
|
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 = () => {
|
// if (!showDownloadClientTips || isDesktop) {
|
||||||
const [showDownloadClientTips, setShowDownloadClientTips] = useAtom(
|
// return <></>;
|
||||||
guideDownloadClientTipAtom
|
// }
|
||||||
);
|
|
||||||
const onCloseDownloadClient = useCallback(() => {
|
|
||||||
setShowDownloadClientTips(false);
|
|
||||||
}, [setShowDownloadClientTips]);
|
|
||||||
|
|
||||||
if (!showDownloadClientTips || isDesktop) {
|
show: boolean;
|
||||||
return <></>;
|
onClose: () => void;
|
||||||
|
}) => {
|
||||||
|
if (!show || isDesktop) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return <DownloadTips onClose={onCloseDownloadClient} />;
|
return <DownloadTips onClose={onClose} />;
|
||||||
};
|
};
|
||||||
export default DownloadClientTip;
|
export default DownloadClientTip;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { CloseIcon, MinusIcon, RoundedRectangleIcon } from '@blocksuite/icons';
|
|||||||
import type { Page } from '@blocksuite/store';
|
import type { Page } from '@blocksuite/store';
|
||||||
import { affinePluginsAtom } from '@toeverything/plugin-infra/manager';
|
import { affinePluginsAtom } from '@toeverything/plugin-infra/manager';
|
||||||
import type { PluginUIAdapter } from '@toeverything/plugin-infra/type';
|
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 type { FC, HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
||||||
import {
|
import {
|
||||||
forwardRef,
|
forwardRef,
|
||||||
@@ -21,7 +21,6 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
import { guideDownloadClientTipAtom } from '../../../atoms/guide';
|
|
||||||
import { contentLayoutAtom } from '../../../atoms/layout';
|
import { contentLayoutAtom } from '../../../atoms/layout';
|
||||||
import { currentModeAtom } from '../../../atoms/mode';
|
import { currentModeAtom } from '../../../atoms/mode';
|
||||||
import type { AffineOfficialWorkspace } from '../../../shared';
|
import type { AffineOfficialWorkspace } from '../../../shared';
|
||||||
@@ -194,14 +193,13 @@ export const Header = forwardRef<
|
|||||||
>((props, ref) => {
|
>((props, ref) => {
|
||||||
const [showWarning, setShowWarning] = useState(false);
|
const [showWarning, setShowWarning] = useState(false);
|
||||||
const [showGuideDownloadClientTip, setShowGuideDownloadClientTip] =
|
const [showGuideDownloadClientTip, setShowGuideDownloadClientTip] =
|
||||||
useState(false);
|
useState(true);
|
||||||
const [shouldShowGuideDownloadClientTip] = useAtom(
|
// const [shouldShowGuideDownloadClientTip] = useAtom(
|
||||||
guideDownloadClientTipAtom
|
// guideDownloadClientTipAtom
|
||||||
);
|
// );
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setShowWarning(shouldShowWarning());
|
setShowWarning(shouldShowWarning());
|
||||||
setShowGuideDownloadClientTip(shouldShowGuideDownloadClientTip);
|
}, []);
|
||||||
}, [shouldShowGuideDownloadClientTip]);
|
|
||||||
const open = useAtomValue(appSidebarOpenAtom);
|
const open = useAtomValue(appSidebarOpenAtom);
|
||||||
const appSidebarFloating = useAtomValue(appSidebarFloatingAtom);
|
const appSidebarFloating = useAtomValue(appSidebarFloatingAtom);
|
||||||
|
|
||||||
@@ -216,7 +214,12 @@ export const Header = forwardRef<
|
|||||||
data-sidebar-floating={appSidebarFloating}
|
data-sidebar-floating={appSidebarFloating}
|
||||||
>
|
>
|
||||||
{showGuideDownloadClientTip ? (
|
{showGuideDownloadClientTip ? (
|
||||||
<DownloadClientTip />
|
<DownloadClientTip
|
||||||
|
show={showGuideDownloadClientTip}
|
||||||
|
onClose={() => {
|
||||||
|
setShowGuideDownloadClientTip(false);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<BrowserWarning
|
<BrowserWarning
|
||||||
show={showWarning}
|
show={showWarning}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export const DownloadTips = ({ onClose }: { onClose: () => void }) => {
|
|||||||
<AffineLogoSBlue2_1Icon className={downloadTipIconStyle} />
|
<AffineLogoSBlue2_1Icon className={downloadTipIconStyle} />
|
||||||
<div className={downloadMessageStyle}>
|
<div className={downloadMessageStyle}>
|
||||||
<Trans i18nKey="com.affine.banner.content">
|
<Trans i18nKey="com.affine.banner.content">
|
||||||
Enjoying the demo?
|
This demo is limited.
|
||||||
<a
|
<a
|
||||||
className={linkStyle}
|
className={linkStyle}
|
||||||
href="https://affine.pro/download"
|
href="https://affine.pro/download"
|
||||||
@@ -29,7 +29,7 @@ export const DownloadTips = ({ onClose }: { onClose: () => void }) => {
|
|||||||
>
|
>
|
||||||
Download the AFFiNE Client
|
Download the AFFiNE Client
|
||||||
</a>
|
</a>
|
||||||
for the full experience.
|
for the latest features and Performance.
|
||||||
</Trans>
|
</Trans>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
"com.affine.onboarding.title2": "Intuitive & robust block-based editing",
|
"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.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.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</1> for the full experience.",
|
"com.affine.banner.content": "This demo is limited. <1>Download the AFFiNE Client</1> for the latest features and Performance.",
|
||||||
"com.affine.helpIsland.gettingStarted": "Getting started",
|
"com.affine.helpIsland.gettingStarted": "Getting started",
|
||||||
"com.affine.updater.downloading": "Downloading",
|
"com.affine.updater.downloading": "Downloading",
|
||||||
"com.affine.updater.update-available": "Update available",
|
"com.affine.updater.update-available": "Update available",
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
"com.affine.emptyDesc": "这里还没有页面",
|
"com.affine.emptyDesc": "这里还没有页面",
|
||||||
"com.affine.last7Days": "过去 7 天",
|
"com.affine.last7Days": "过去 7 天",
|
||||||
"com.affine.lastMonth": "上个月",
|
"com.affine.lastMonth": "上个月",
|
||||||
"com.affine.banner.content": "正在享受演示吗?<1>下载 AFFiNE 客户端</1>以获得完整体验。",
|
"com.affine.banner.content": "此演示有限。<1>下载 AFFiNE 客户端</1>以获取最新功能和表现。",
|
||||||
"com.affine.cloudTempDisable.title": "AFFiNE Cloud 正在进行升级。",
|
"com.affine.cloudTempDisable.title": "AFFiNE Cloud 正在进行升级。",
|
||||||
"com.affine.cloudTempDisable.description": "我们正在升级 AFFiNE Cloud 服务,客户端暂时不可启用它。如果您希望随时了解进度并收到关于云服务的可用性通知,您可以填写我们的<1>表单</1>。",
|
"com.affine.cloudTempDisable.description": "我们正在升级 AFFiNE Cloud 服务,客户端暂时不可启用它。如果您希望随时了解进度并收到关于云服务的可用性通知,您可以填写我们的<1>表单</1>。",
|
||||||
"com.affine.edgelessMode": "无界模式",
|
"com.affine.edgelessMode": "无界模式",
|
||||||
|
|||||||
@@ -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 A', tags: ['A'] });
|
||||||
await createPageWithTag(page, { title: 'Page B', tags: ['B'] });
|
await createPageWithTag(page, { title: 'Page B', tags: ['B'] });
|
||||||
await clickSideBarAllPageButton(page);
|
await clickSideBarAllPageButton(page);
|
||||||
|
await closeDownloadTip(page);
|
||||||
await createFirstFilter(page, 'Tags');
|
await createFirstFilter(page, 'Tags');
|
||||||
await checkFilterName(page, 'is not empty');
|
await checkFilterName(page, 'is not empty');
|
||||||
await checkPagesCount(page, 2);
|
await checkPagesCount(page, 2);
|
||||||
|
|||||||
@@ -40,5 +40,5 @@ test('Download client tip', async ({ page }) => {
|
|||||||
const currentDownloadClientTipItem = page.locator(
|
const currentDownloadClientTipItem = page.locator(
|
||||||
'[data-testid=download-client-tip]'
|
'[data-testid=download-client-tip]'
|
||||||
);
|
);
|
||||||
await expect(currentDownloadClientTipItem).not.toBeVisible();
|
await expect(currentDownloadClientTipItem).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user