Separate floating sidebar hidden state

This commit is contained in:
Gregory Schier
2024-03-22 10:43:10 -07:00
parent e292235792
commit 00b1f90074
6 changed files with 57 additions and 42 deletions

View File

@@ -0,0 +1,8 @@
import { useWindowSize } from 'react-use';
const WINDOW_FLOATING_SIDEBAR_WIDTH = 600;
export function useShouldFloatSidebar() {
const windowSize = useWindowSize();
return windowSize.width <= WINDOW_FLOATING_SIDEBAR_WIDTH;
}