tasko/hooks/use-mobile-sidebar.ts

14 lines
304 B
TypeScript
Raw Normal View History

2024-02-15 02:30:10 +00:00
import { create } from "zustand";
type MobileSidebarStore = {
isOpen: boolean;
onOpen: () => void;
onClose: () => void;
};
export const useMobileSidebar = create<MobileSidebarStore>((set) => ({
isOpen: false,
onOpen: () => set({ isOpen: true }),
onClose: () => set({ isOpen: false }),
}));