From 0c6bff6053083561ceda979c2886b712ff18427a Mon Sep 17 00:00:00 2001 From: rtrembecky Date: Tue, 17 Dec 2024 22:41:45 +0100 Subject: [PATCH] solve position. still need to figure the content better --- .../Header/HeaderHeightContainer.tsx | 10 +++ src/components/PageLayout/PageLayout.tsx | 54 ++++++++------ .../PageLayout/StromLogo/StromLogo.tsx | 74 ++++++------------- src/components/PageLayout/TopGrid/TopGrid.tsx | 16 +++- 4 files changed, 78 insertions(+), 76 deletions(-) create mode 100644 src/components/PageLayout/Header/HeaderHeightContainer.tsx 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} + - -