diff --git a/src/components/PageLayout/Header/HeaderHeightContainer.tsx b/src/components/PageLayout/Header/HeaderHeightContainer.tsx new file mode 100644 index 00000000..65532c75 --- /dev/null +++ b/src/components/PageLayout/Header/HeaderHeightContainer.tsx @@ -0,0 +1,10 @@ +import {useState} from 'react' +import {createContainer} from 'unstated-next' + +const useHeaderHeight = () => { + const [height, setHeight] = useState(0) + + return {height, setHeight} +} + +export const HeaderHeightContainer = createContainer(useHeaderHeight) diff --git a/src/components/PageLayout/PageLayout.tsx b/src/components/PageLayout/PageLayout.tsx index 31e0492b..49debf15 100644 --- a/src/components/PageLayout/PageLayout.tsx +++ b/src/components/PageLayout/PageLayout.tsx @@ -1,4 +1,4 @@ -import {Box, Stack, SxProps} from '@mui/material' +import {Stack, SxProps} from '@mui/material' import Grid from '@mui/material/Unstable_Grid2' import Head from 'next/head' import {FC, ReactNode} from 'react' @@ -8,6 +8,7 @@ import {PageTitleContainer} from '@/utils/PageTitleContainer' import {Seminar, useSeminarInfo} from '@/utils/useSeminarInfo' import {Footer} from './Footer/Footer' +import {HeaderHeightContainer} from './Header/HeaderHeightContainer' import {StromLogo} from './StromLogo/StromLogo' import {TopGrid} from './TopGrid/TopGrid' @@ -39,30 +40,35 @@ export const PageLayout: FC = ({contentWidth = 2, title = '', c - - - - - - - :first-child /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */': - {mt: 0, pt: 0}, - }} - > - {children} + + + + + + + + + + :first-child /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */': + {mt: 0, pt: 0}, + }} + > + {children} + - -