wip: new onboarding

This commit is contained in:
2023-10-16 14:42:19 +07:00
parent cd3b9ada5a
commit 3aa4f294f9
28 changed files with 550 additions and 559 deletions

View File

@@ -1,38 +0,0 @@
import { create } from 'zustand';
import { createJSONStorage, persist } from 'zustand/middleware';
interface OnboardingState {
step: null | string;
pubkey: null | string;
tempPrivkey: null | string;
setPubkey: (pubkey: string) => void;
setTempPrivkey: (privkey: string) => void;
setStep: (url: string) => void;
clearStep: () => void;
}
export const useOnboarding = create<OnboardingState>()(
persist(
(set) => ({
step: null,
pubkey: null,
tempPrivkey: null,
setPubkey: (pubkey: string) => {
set({ pubkey });
},
setTempPrivkey: (privkey: string) => {
set({ tempPrivkey: privkey });
},
setStep: (url: string) => {
set({ step: url });
},
clearStep: () => {
set({ step: null, pubkey: null, tempPrivkey: null });
},
}),
{
name: 'onboarding',
storage: createJSONStorage(() => localStorage),
}
)
);