This repository has been archived by the owner on Apr 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7d5588
commit bf27d77
Showing
8 changed files
with
65 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ChakraProvider, useBreakpointValue } from '@chakra-ui/react'; | ||
|
||
import { desktopTheme, mobileTheme } from '~/shared/config/theme'; | ||
|
||
interface LayoutProps { | ||
base: JSX.Element; | ||
desktop?: JSX.Element; | ||
} | ||
|
||
export const Layout = ({ base, desktop }: LayoutProps) => { | ||
const breakpoint = useBreakpointValue({ base: 'base', md: 'desktop' }, { ssr: false }); | ||
|
||
const isBase = breakpoint === 'base' || !desktop; | ||
|
||
return ( | ||
<ChakraProvider theme={isBase ? mobileTheme : desktopTheme}> | ||
{isBase ? base : desktop} | ||
{isBase ? <div>Mobile Menu</div> : <div>Desktop Menu</div>} | ||
</ChakraProvider> | ||
); | ||
}; |
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 @@ | ||
export * from './Layout'; |
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,5 @@ | ||
import { extendTheme } from '@chakra-ui/react'; | ||
|
||
import { basicTheme } from './theme'; | ||
|
||
export const desktopTheme = extendTheme(basicTheme); |
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,3 @@ | ||
export { basicTheme } from './theme'; | ||
export { mobileTheme } from './mobileTheme'; | ||
export { desktopTheme } from './desktopTheme'; |
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,5 @@ | ||
import { extendTheme } from '@chakra-ui/react'; | ||
|
||
import { basicTheme } from './theme'; | ||
|
||
export const mobileTheme = extendTheme(basicTheme); |
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 |
---|---|---|
|
@@ -111,4 +111,7 @@ export const basicTheme = extendTheme({ | |
900: '#111111', | ||
}, | ||
}, | ||
breakpoints: { | ||
md: '37.5rem', | ||
}, | ||
}); |