From 2420b2849fb3184317a89130642d83da3f1869b6 Mon Sep 17 00:00:00 2001 From: EYHN Date: Tue, 30 Apr 2024 04:58:15 +0000 Subject: [PATCH] chore(core): remove unused module (#6744) --- packages/frontend/core/src/atoms/guide.ts | 77 ----------------------- 1 file changed, 77 deletions(-) delete mode 100644 packages/frontend/core/src/atoms/guide.ts diff --git a/packages/frontend/core/src/atoms/guide.ts b/packages/frontend/core/src/atoms/guide.ts deleted file mode 100644 index 3c40f9e6b1..0000000000 --- a/packages/frontend/core/src/atoms/guide.ts +++ /dev/null @@ -1,77 +0,0 @@ -// these atoms cannot be moved to @affine/jotai since they use atoms from @affine/component -import { atom } from 'jotai'; -import { atomWithStorage } from 'jotai/utils'; - -import { appSidebarOpenAtom } from '../components/app-sidebar'; - -export type Guide = { - // should show quick search tips - quickSearchTips: boolean; - // should show change log - changeLog: boolean; - // should show recording tips - onBoarding: boolean; - // should show download client tips - downloadClientTip: boolean; -}; - -const guidePrimitiveAtom = atomWithStorage('helper-guide', { - quickSearchTips: true, - changeLog: true, - onBoarding: true, - downloadClientTip: true, -}); - -export const guideQuickSearchTipsAtom = atom< - Guide['quickSearchTips'], - [open: boolean], - void ->( - get => { - const open = get(appSidebarOpenAtom); - const guide = get(guidePrimitiveAtom); - // only show the tips when the sidebar is closed - return guide.quickSearchTips && open === false; - }, - (_, set, open) => { - set(guidePrimitiveAtom, tips => ({ - ...tips, - quickSearchTips: open, - })); - } -); - -export const guideChangeLogAtom = atom< - Guide['changeLog'], - [open: boolean], - void ->( - get => { - return get(guidePrimitiveAtom).changeLog; - }, - (_, set, open) => { - set(guidePrimitiveAtom, tips => ({ - ...tips, - changeLog: open, - })); - } -); - -export const guideDownloadClientTipAtom = atom< - Guide['downloadClientTip'], - [open: boolean], - void ->( - get => { - if (environment.isDesktop) { - return false; - } - return get(guidePrimitiveAtom).downloadClientTip; - }, - (_, set, open) => { - set(guidePrimitiveAtom, tips => ({ - ...tips, - downloadClientTip: open, - })); - } -);