fix: some minor ui issues (#1783)

This commit is contained in:
Peng Xiao
2023-04-03 13:24:53 +08:00
committed by GitHub
parent 95879cc1d0
commit 487ef35563
10 changed files with 90 additions and 79 deletions

View File

@@ -1,4 +1,5 @@
import { atomWithSyncStorage } from '@affine/jotai';
import { useMediaQuery, useTheme } from '@mui/material';
import { atom, useAtom } from 'jotai';
const sideBarOpenAtom = atomWithSyncStorage('sidebarOpen', true);
@@ -13,6 +14,11 @@ export function useSidebarWidth() {
return useAtom(sideBarWidthAtom);
}
export function useSidebarFloating() {
const theme = useTheme();
return useMediaQuery(theme.breakpoints.down('md'));
}
export function useSidebarResizing() {
return useAtom(sidebarResizingAtom);
}