re-enable nip-04 with more polish, prepare for nip-44
This commit is contained in:
24
src/stores/sidebar.ts
Normal file
24
src/stores/sidebar.ts
Normal 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),
|
||||
}
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user