wip: redesign nwc

This commit is contained in:
Ren Amamiya
2023-09-12 08:27:29 +07:00
parent 602d012efe
commit a4f221f868
8 changed files with 283 additions and 35 deletions

View File

@@ -4,8 +4,10 @@ import { createJSONStorage, persist } from 'zustand/middleware';
interface SidebarState {
feeds: boolean;
chats: boolean;
integrations: boolean;
toggleFeeds: () => void;
toggleChats: () => void;
toggleIntegrations: () => void;
}
export const useSidebar = create<SidebarState>()(
@@ -13,12 +15,14 @@ export const useSidebar = create<SidebarState>()(
(set) => ({
feeds: true,
chats: true,
integrations: true,
toggleFeeds: () => set((state) => ({ feeds: !state.feeds })),
toggleChats: () => set((state) => ({ chats: !state.chats })),
toggleIntegrations: () => set((state) => ({ integrations: !state.integrations })),
}),
{
name: 'sidebar',
storage: createJSONStorage(() => sessionStorage),
storage: createJSONStorage(() => localStorage),
}
)
);