2023-10-11 23:36:14 +00:00
|
|
|
import { create } from 'zustand'
|
2022-07-13 13:56:36 +00:00
|
|
|
|
|
|
|
export const useSidebarStore = create(() => ({ isOpen: true }))
|
|
|
|
|
|
|
|
export const openSidebar = () => {
|
|
|
|
useSidebarStore.setState({ isOpen: true })
|
|
|
|
}
|
|
|
|
export const closeSidebar = () => {
|
|
|
|
useSidebarStore.setState({ isOpen: false })
|
|
|
|
}
|
|
|
|
export const toggleSidebar = () => {
|
|
|
|
useSidebarStore.setState((prev) => ({ isOpen: !prev.isOpen }))
|
|
|
|
}
|