Skip to content

Commit

Permalink
Move BannerContainer into PayeLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
Matushl committed Nov 16, 2023
1 parent 9509110 commit 99feb11
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
39 changes: 21 additions & 18 deletions src/components/PageLayout/PageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import clsx from 'clsx'
import {FC, ReactNode, useEffect} from 'react'
import {FC, ReactNode} from 'react'

import {BannerContainer} from '@/utils/BannerContainer'
import {PageTitleContainer} from '@/utils/PageTitleContainer'

import {Banner} from './Banner/Banner'
Expand All @@ -21,25 +22,27 @@ type PageLayoutProps = {
export const PageLayout: FC<PageLayoutProps> = ({contentWidth = 2, title = '', children}) => {
return (
<PageTitleContainer.Provider initialState={title}>
<div className={styles.pageContainer}>
<TopGrid />
<Banner />
<MenuMain />
<div className={styles.grid}>
<StromLogo />
<div
className={clsx(
styles.mainContent,
contentWidth === 1 && styles.col1,
contentWidth === 2 && styles.col2,
contentWidth === 3 && styles.col3,
)}
>
{children}
<BannerContainer.Provider>
<div className={styles.pageContainer}>
<TopGrid />
<Banner />
<MenuMain />
<div className={styles.grid}>
<StromLogo />
<div
className={clsx(
styles.mainContent,
contentWidth === 1 && styles.col1,
contentWidth === 2 && styles.col2,
contentWidth === 3 && styles.col3,
)}
>
{children}
</div>
</div>
<Footer />
</div>
<Footer />
</div>
</BannerContainer.Provider>
</PageTitleContainer.Provider>
)
}
9 changes: 3 additions & 6 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {CookiesProvider} from 'react-cookie'

import {theme} from '@/theme'
import {AuthContainer} from '@/utils/AuthContainer'
import {BannerContainer} from '@/utils/BannerContainer'

const ReactQueryDevtools = dynamic(
() => import('@tanstack/react-query-devtools').then(({ReactQueryDevtools}) => ReactQueryDevtools),
Expand Down Expand Up @@ -83,11 +82,9 @@ const MyApp: FC<AppProps> = ({Component, pageProps}) => {
<ReactQueryDevtools />
<CookiesProvider>
<AuthContainer.Provider>
<BannerContainer.Provider>
<ThemeProvider theme={theme}>
<Component {...pageProps} />
</ThemeProvider>
</BannerContainer.Provider>
<ThemeProvider theme={theme}>
<Component {...pageProps} />
</ThemeProvider>
</AuthContainer.Provider>
</CookiesProvider>
</QueryClientProvider>
Expand Down

0 comments on commit 99feb11

Please sign in to comment.