11import { FC , PropsWithChildren , ReactNode } from 'react'
22import { Header } from './Header'
33import { Footer } from './Footer'
4- import Box from '@mui/material/Box'
54import { useScreenSize } from '../../hooks/useScreensize'
6- import { styled , useTheme } from '@mui/material/styles'
75import { BuildBanner } from '../BuildBanner'
86import { useScopeParam } from '../../hooks/useScopeParam'
97import { NetworkOfflineBanner , RuntimeOfflineBanner , ConsensusOfflineBanner } from '../OfflineBanner'
@@ -14,12 +12,7 @@ interface PageLayoutProps {
1412 mobileFooterAction ?: ReactNode
1513}
1614
17- export const StyledMain = styled ( 'main' ) ( {
18- minHeight : '75vh' ,
19- } )
20-
2115export const PageLayout : FC < PropsWithChildren < PageLayoutProps > > = ( { children, mobileFooterAction } ) => {
22- const theme = useTheme ( )
2316 const { isMobile, isTablet } = useScreenSize ( )
2417 const scope = useScopeParam ( )
2518 const isApiReachable = useIsApiReachable ( scope ?. network ?? 'mainnet' ) . reachable
@@ -30,45 +23,18 @@ export const PageLayout: FC<PropsWithChildren<PageLayoutProps>> = ({ children, m
3023 < NetworkOfflineBanner />
3124 { scope && scope . layer !== 'consensus' && < RuntimeOfflineBanner /> }
3225 { scope && scope . layer === 'consensus' && < ConsensusOfflineBanner /> }
33- < Box
34- sx = { {
35- minHeight : '100vh' ,
36- } }
37- >
26+ < div className = "min-h-screen" >
3827 < Header />
39- < Box
40- sx = {
41- isMobile
42- ? {
43- border :
44- theme . palette . background . default !== theme . palette . layout . border
45- ? `solid 10px ${ theme . palette . layout . border } `
46- : 'none' ,
47- borderTop : 0 ,
48- px : 0 ,
49- pt : 4 ,
50- }
51- : {
52- border : `solid 15px ${ theme . palette . layout . border } ` ,
53- borderTop : 0 ,
54- px : '4%' ,
55- pt : 6 ,
56- }
57- }
58- >
28+ < div className = "border-8 md:border-[15px] border-transparent px-0 md:px-[4%] pt-4 md:pt-6 md:border-t-0" >
5929 { ! isMobile && (
60- < Box
61- sx = { {
62- mb : 6 ,
63- } }
64- >
30+ < div className = "mb-6" >
6531 < Search scope = { scope } variant = { isTablet ? 'icon' : 'button' } disabled = { ! isApiReachable } />
66- </ Box >
32+ </ div >
6733 ) }
68- < StyledMain > { children } </ StyledMain >
34+ < main className = "min-h-[75vh]" > { children } </ main >
6935 < Footer scope = { scope } mobileSearchAction = { mobileFooterAction } />
70- </ Box >
71- </ Box >
36+ </ div >
37+ </ div >
7238 </ >
7339 )
7440}
0 commit comments