feat: add download tips banner (#2151)

This commit is contained in:
JimmFly
2023-05-10 00:07:34 +08:00
committed by GitHub
parent b937c1b5f6
commit b978bb171a
9 changed files with 282 additions and 27 deletions

View File

@@ -10,12 +10,15 @@ export type Guide = {
changeLog: boolean;
// should show recording tips
onBoarding: boolean;
// should show download client tips
downloadClientTip: boolean;
};
const guidePrimitiveAtom = atomWithStorage<Guide>('helper-guide', {
quickSearchTips: true,
changeLog: true,
onBoarding: true,
downloadClientTip: true,
});
export const guideQuickSearchTipsAtom = atom<
@@ -67,3 +70,18 @@ export const guideOnboardingAtom = atom<
}));
}
);
export const guideDownloadClientTipAtom = atom<
Guide['downloadClientTip'],
[open: boolean],
void
>(
get => {
return get(guidePrimitiveAtom).downloadClientTip;
},
(_, set, open) => {
set(guidePrimitiveAtom, tips => ({
...tips,
downloadClientTip: open,
}));
}
);