update thread widget

This commit is contained in:
2023-10-19 14:45:41 +07:00
parent 0de72eb009
commit e1e54c1a98
14 changed files with 144 additions and 206 deletions

View File

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