re-enable nip-04 with more polish, prepare for nip-44

This commit is contained in:
Ren Amamiya
2023-08-24 09:05:34 +07:00
parent 3455eb701f
commit 4893ebd932
19 changed files with 376 additions and 242 deletions

24
src/stores/sidebar.ts Normal file
View File

@@ -0,0 +1,24 @@
import { create } from 'zustand';
import { createJSONStorage, persist } from 'zustand/middleware';
interface SidebarState {
feeds: boolean;
chats: boolean;
toggleFeeds: () => void;
toggleChats: () => void;
}
export const useSidebar = create<SidebarState>()(
persist(
(set) => ({
feeds: true,
chats: true,
toggleFeeds: () => set((state) => ({ feeds: !state.feeds })),
toggleChats: () => set((state) => ({ chats: !state.chats })),
}),
{
name: 'sidebar',
storage: createJSONStorage(() => localStorage),
}
)
);