11'use client' ;
22
3- import { ReactNode , useState } from 'react' ;
4- import { Providers } from '@/providers/session' ;
53import { AppShell , Container , rem , useMantineTheme } from '@mantine/core' ;
6- import HeaderNav from '@/components/HeaderNav ' ;
7- import Navigation from '@/components/Navigation ' ;
4+ import { ReactNode , useState } from 'react ' ;
5+ import { useDisclosure , useMediaQuery } from '@mantine/hooks ' ;
86import AppMain from '@/components/AppMain' ;
7+ import Navigation from '@/components/Navigation' ;
8+ import HeaderNav from '@/components/HeaderNav' ;
99import FooterNav from '@/components/FooterNav' ;
10- import { useDisclosure , useMediaQuery } from '@mantine/hooks ' ;
10+ import { Providers } from '@/providers/session ' ;
1111
12- type Auth0LayoutProps = {
12+ type Props = {
1313 children : ReactNode ;
1414} ;
1515
16- export default function Auth0Layout ( { children } : Auth0LayoutProps ) {
16+ function Auth0Layout ( { children } : Props ) {
1717 const theme = useMantineTheme ( ) ;
18- const [ opened , setOpened ] = useState ( false ) ;
19- const [ themeOpened , { open : themeOpen , close : themeClose } ] =
20- useDisclosure ( false ) ;
2118 const tablet_match = useMediaQuery ( '(max-width: 768px)' ) ;
2219 const [ mobileOpened , { toggle : toggleMobile } ] = useDisclosure ( ) ;
2320 const [ desktopOpened , { toggle : toggleDesktop } ] = useDisclosure ( true ) ;
@@ -43,8 +40,6 @@ export default function Auth0Layout({ children }: Auth0LayoutProps) {
4340 >
4441 < Container fluid py = "sm" px = "lg" >
4542 < HeaderNav
46- opened = { opened }
47- handleOpen = { ( ) => setOpened ( ( o ) => ! o ) }
4843 desktopOpened = { desktopOpened }
4944 mobileOpened = { mobileOpened }
5045 toggleDesktop = { toggleDesktop }
@@ -53,7 +48,7 @@ export default function Auth0Layout({ children }: Auth0LayoutProps) {
5348 </ Container >
5449 </ AppShell . Header >
5550 < AppShell . Navbar >
56- < Navigation onClose = { ( ) => setOpened ( false ) } />
51+ < Navigation onClose = { toggleMobile } />
5752 </ AppShell . Navbar >
5853 < AppShell . Main >
5954 < AppMain >
@@ -68,3 +63,5 @@ export default function Auth0Layout({ children }: Auth0LayoutProps) {
6863 </ AppShell >
6964 ) ;
7065}
66+
67+ export default Auth0Layout ;
0 commit comments