wip: complete new onboarding

This commit is contained in:
2023-10-17 16:33:41 +07:00
parent 3aa4f294f9
commit 7fa1e89dc8
44 changed files with 580 additions and 732 deletions

40
src/stores/onboarding.ts Normal file
View File

@@ -0,0 +1,40 @@
import { create } from 'zustand';
import { createJSONStorage, persist } from 'zustand/middleware';
interface OnboardingState {
enrich: boolean;
hashtag: boolean;
circle: boolean;
relays: boolean;
outbox: boolean;
notification: boolean;
toggleEnrich: () => void;
toggleHashtag: () => void;
toggleCircle: () => void;
toggleRelays: () => void;
toggleOutbox: () => void;
toggleNotification: () => void;
}
export const useOnboarding = create<OnboardingState>()(
persist(
(set) => ({
enrich: false,
hashtag: false,
circle: false,
relays: false,
outbox: false,
notification: false,
toggleEnrich: () => set((state) => ({ enrich: !state.enrich })),
toggleHashtag: () => set((state) => ({ hashtag: !state.hashtag })),
toggleCircle: () => set((state) => ({ circle: !state.circle })),
toggleRelays: () => set((state) => ({ relays: !state.relays })),
toggleOutbox: () => set((state) => ({ outbox: !state.outbox })),
toggleNotification: () => set((state) => ({ notification: !state.notification })),
}),
{
name: 'onboarding',
storage: createJSONStorage(() => sessionStorage),
}
)
);