feat(component): init app sidebar (#2135)

This commit is contained in:
Himself65
2023-04-27 16:46:08 -05:00
committed by GitHub
parent f3cbe54625
commit c1a65b6b76
23 changed files with 668 additions and 451 deletions
-28
View File
@@ -1,28 +0,0 @@
import { useTheme } from '@mui/material';
import { useMediaQuery } from '@react-hookz/web';
import { atom, useAtom } from 'jotai';
import { atomWithStorage } from 'jotai/utils';
const sideBarOpenAtom = atomWithStorage('sidebarOpen', true);
const sideBarWidthAtom = atomWithStorage('sidebarWidth', 256);
const sidebarResizingAtom = atom(false);
export function useSidebarStatus() {
return useAtom(sideBarOpenAtom);
}
export function useSidebarWidth() {
return useAtom(sideBarWidthAtom);
}
export function useSidebarFloating() {
const theme = useTheme();
return (
useMediaQuery(theme.breakpoints.down('md').replace(/^@media( ?)/m, '')) ??
false
);
}
export function useSidebarResizing() {
return useAtom(sidebarResizingAtom);
}