File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ export function SideBar(): JSX.Element {
1919 const { drive, sideBarLocked, setSideBarLocked } = useSettings ( ) ;
2020 const [ ref , hoveringOverSideBar ] = useHover < HTMLElement > ( sideBarLocked ) ;
2121 // Check if the window is small enough to hide the sidebar
22- const isWideScreen = useMediaQuery ( `(min-width: ${ SIDEBAR_TOGGLE_WIDTH } px)` ) ;
22+ const isWideScreen = useMediaQuery (
23+ `(min-width: ${ SIDEBAR_TOGGLE_WIDTH } px)` ,
24+ true ,
25+ ) ;
2326
2427 const { size, targetRef, dragAreaRef, isDragging } = useResizable (
2528 300 ,
Original file line number Diff line number Diff line change 11import { useEffect , useState } from 'react' ;
22
33/** Watches a media query and returns a statefull result. */
4- export function useMediaQuery ( query : string ) : boolean {
5- const [ matches , setMatches ] = useState ( false ) ;
4+ export function useMediaQuery ( query : string , def = false ) : boolean {
5+ const [ matches , setMatches ] = useState ( def ) ;
66
77 useEffect ( ( ) => {
88 if ( ! window . matchMedia ) {
You can’t perform that action at this time.
0 commit comments