mirror of
https://github.com/docmost/docmost.git
synced 2026-05-19 07:54:05 +08:00
537e45bc11
* feat: page details section and backlinks
24 lines
600 B
TypeScript
24 lines
600 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);
|
|
|
|
// Valid `tab` values: "" | "comments" | "toc" | "chat" | "details"
|
|
type AsideStateType = {
|
|
tab: string;
|
|
isAsideOpen: boolean;
|
|
};
|
|
|
|
export const asideStateAtom = atom<AsideStateType>({
|
|
tab: "",
|
|
isAsideOpen: false,
|
|
});
|
|
|
|
export const sidebarWidthAtom = atomWithWebStorage<number>('sidebarWidth', 300); |