mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
admin ui: started color centralization + made sidebar resizable
This commit is contained in:
23
app/src/ui/store/appshell.ts
Normal file
23
app/src/ui/store/appshell.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { create } from "zustand";
|
||||
import { combine, persist } from "zustand/middleware";
|
||||
|
||||
export const appShellStore = create(
|
||||
persist(
|
||||
combine(
|
||||
{
|
||||
sidebarOpen: false as boolean,
|
||||
sidebarWidth: 350 as number,
|
||||
},
|
||||
(set) => ({
|
||||
toggleSidebar: () => set((state) => ({ sidebarOpen: !state.sidebarOpen })),
|
||||
closeSidebar: () => set({ sidebarOpen: false }),
|
||||
openSidebar: () => set({ sidebarOpen: true }),
|
||||
setSidebarWidth: (width: number) => set({ sidebarWidth: width }),
|
||||
resetSidebarWidth: () => set({ sidebarWidth: 350 }),
|
||||
}),
|
||||
),
|
||||
{
|
||||
name: "appshell",
|
||||
},
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user