mirror of
https://github.com/docmost/docmost.git
synced 2025-11-21 02:01:13 +10:00
feat: resizable sidebar (#452)
* feat: resizable sidebar * only expand space sidebar
This commit is contained in:
@ -2,9 +2,9 @@ import { atom } from "jotai";
|
||||
|
||||
export function atomWithWebStorage<Value>(key: string, initialValue: Value, storage = localStorage) {
|
||||
const storedValue = localStorage.getItem(key);
|
||||
const isString = typeof initialValue === "string";
|
||||
const isStringOrInt = typeof initialValue === "string" || typeof initialValue === "number";
|
||||
|
||||
const storageValue = storedValue ? isString ? storedValue : storedValue === "true" : undefined;
|
||||
const storageValue = storedValue ? isStringOrInt ? storedValue : storedValue === "true" : undefined;
|
||||
|
||||
const baseAtom = atom(storageValue ?? initialValue);
|
||||
return atom(
|
||||
|
||||
Reference in New Issue
Block a user