mirror of
https://github.com/docmost/docmost.git
synced 2026-05-20 16:44:05 +08:00
b85b34d6b1
* feat: resizable sidebar * only expand space sidebar
24 lines
533 B
TypeScript
24 lines
533 B
TypeScript
import { atomWithWebStorage } from "@/lib/jotai-helper.ts";
|
|
import { atom } from "jotai";
|
|
|
|
export const mobileSidebarAtom = atom<boolean>(false);
|
|
|
|
export const desktopSidebarAtom = atomWithWebStorage<boolean>(
|
|
"showSidebar",
|
|
true,
|
|
);
|
|
|
|
export const desktopAsideAtom = atom<boolean>(false);
|
|
|
|
type AsideStateType = {
|
|
tab: string;
|
|
isAsideOpen: boolean;
|
|
};
|
|
|
|
export const asideStateAtom = atom<AsideStateType>({
|
|
tab: "",
|
|
isAsideOpen: false,
|
|
});
|
|
|
|
export const sidebarWidthAtom = atomWithWebStorage<number>('sidebarWidth', 300);
|