-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update responsive overlay and improve dashboard layout
- Removed ResponsiveOverlay component. - Added ResetMiniNavOnResize component to handle mini nav visibility. - Updated dashboard layout to conditionally render navigation components. - Adjusted main content padding and enhanced layout styles.
- Loading branch information
Showing
8 changed files
with
60 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/components/responsive-overlay/ResetMiniNavOnResize.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useState, useEffect } from 'react'; | ||
import {useSettingsContext} from "@src/components/settings"; | ||
|
||
const ResetMiniNavOnResize = () => { | ||
const [isSmallScreen, setIsSmallScreen] = useState(false); | ||
const settings = useSettingsContext(); | ||
|
||
useEffect(() => { | ||
const handleResize = () => { | ||
setIsSmallScreen(window.innerWidth < 1200); | ||
}; | ||
|
||
window.addEventListener('resize', handleResize); | ||
handleResize(); | ||
|
||
return () => window.removeEventListener('resize', handleResize); | ||
}, []); | ||
|
||
if(isSmallScreen && settings.themeLayout === 'mini') { | ||
settings.onUpdate('themeLayout', 'vertical'); | ||
} | ||
|
||
if (!isSmallScreen) { | ||
return null; | ||
} | ||
}; | ||
|
||
export default ResetMiniNavOnResize; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { default as ResponsiveOverlay } from './ResponsiveOverlay.tsx'; | ||
export { default as ResponsiveOverlay } from './ResetMiniNavOnResize.tsx'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters