File tree Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export const TICKETS_NOTS_SUB = gql`
3939 }
4040` ;
4141
42- function DashHeader ( ) {
42+ function DashHeader ( { minimize } : any ) {
4343 /* istanbul ignore next */
4444 const { minimized, toggleMinMenu, showNav, toggleNav } =
4545 useContext ( MenuContext ) ;
@@ -144,7 +144,7 @@ function DashHeader() {
144144 </ div >
145145 < div className = "hidden lg:flex" >
146146 < div
147- onClick = { toggleMinMenu }
147+ onClick = { ( ) => { minimize ( ! minimized ) ; return toggleMinMenu ( ) } }
148148 className = "w-7"
149149 role = "button"
150150 tabIndex = { 0 }
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ function Sidebar({ style, toggle }: { style: string; toggle: () => void }) {
3939 < div
4040 className = { `${
4141 showNav ? 'block' : 'hidden'
42- } lg:block lg:z-0 z-50 fixed top-12 bottom-0 lg:h-[calc(100vh-4rem )] w-[14rem] `}
42+ } lg:block lg:z-0 z-50 fixed top-14 bottom-0 lg:h-[calc(100vh-3rem )] `}
4343 >
4444 < div
4545 className = { `${ style } overflow-auto flex-col h-[100%] px-3 py-8 bg-indigo-100 dark:bg-dark-bg shadow-lg lg:shadow-none dark:shadow-border-dark` }
Original file line number Diff line number Diff line change @@ -83,18 +83,17 @@ const CoordinatorCards = React.lazy(
8383const AdminSission = React . lazy ( ( ) => import ( './admin-dashBoard/Sessions' ) ) ;
8484
8585function DashRoutes ( ) {
86- const { toggleNav } = useContext ( MenuContext ) ;
87-
86+ const { toggleNav } = useContext ( MenuContext ) ;
87+ const [ minimized , setMinimized ] = useState ( false ) ;
8888 const [ nav , setNav ] = useState ( false ) ;
8989 const handleClick = ( ) => setNav ( ! nav ) ;
90-
9190 return (
9291 < PrivateRoute >
9392 < MenuProvider >
94- < DashHeader />
93+ < DashHeader minimize = { setMinimized } />
9594 < Sidebar toggle = { toggleNav } style = "" />
9695 </ MenuProvider >
97- < main className = " px-4 md:px-8 py-4 md:py-8 lg:w-[calc(100%-14rem)] ml-auto mr-0 bg-light-bg overflow-hidden dark:bg-dark-frame-bg" >
96+ < main className = { ` px-4 md:px-8 py-4 md:py-8 ${ ! minimized ? ' lg:w-[calc(100%-12rem)]' : 'lg:w-[calc(100%-5rem)]' } ml-auto mr-0 bg-light-bg overflow-hidden dark:bg-dark-frame-bg` } >
9897 < Suspense >
9998 < Routes >
10099 < Route path = "/dashboard" element = { < Dashboard /> } />
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export const MenuContext = createContext<any>({
1414export function ThemeProvider ( { children } : Props ) {
1515 const [ minimized , setMinimized ] = useState ( false ) ;
1616 const [ showNav , setShowNav ] = useState ( false ) ;
17-
17+ console . log ( minimized )
1818 const toggleMinMenu = ( ) => setMinimized ( ( p ) => ! p ) ;
1919
2020 const toggleNav = ( ) => setShowNav ( ( p ) => ! p ) ;
You can’t perform that action at this time.
0 commit comments