@@ -6,6 +6,8 @@ import styled from "@emotion/styled"
6
6
import { IntlProvider } from "react-intl"
7
7
import { LocaleProvider } from "gatsby-theme-i18n"
8
8
9
+ import { Flex } from "@chakra-ui/react"
10
+
9
11
import { lightTheme , darkTheme } from "../theme"
10
12
11
13
import Footer from "./Footer"
@@ -30,40 +32,6 @@ import type { Context } from "../types"
30
32
31
33
import client from "../apollo"
32
34
33
- const ContentContainer = styled . div `
34
- position: relative;
35
- margin: 0px auto;
36
- min-height: 100vh;
37
- display: flex;
38
- flex-flow: column;
39
-
40
- @media (min-width: ${ ( props ) => props . theme . breakpoints . l } ) {
41
- max-width: ${ ( props ) => props . theme . variables . maxPageWidth } ;
42
- }
43
- `
44
-
45
- const MainContainer = styled . div `
46
- display: flex;
47
- @media (max-width: ${ ( props ) => props . theme . breakpoints . l } ) {
48
- flex-direction: column;
49
- }
50
- `
51
-
52
- const MainContent = styled . div `
53
- display: flex;
54
- flex-direction: column;
55
- width: 100%;
56
- `
57
-
58
- const Main = styled . main `
59
- display: flex;
60
- justify-content: space-around;
61
- align-items: flex-start;
62
- overflow: visible;
63
- width: 100%;
64
- flex-grow: 1;
65
- `
66
-
67
35
export interface IProps {
68
36
children ?: React . ReactNode
69
37
data ?: {
@@ -161,27 +129,53 @@ const Layout: React.FC<IProps> = ({
161
129
isPageRightToLeft = { isPageRightToLeft }
162
130
originalPagePath = { pageContext . originalPath ! }
163
131
/>
164
- < ContentContainer >
132
+
133
+ < Flex
134
+ position = "relative"
135
+ margin = "0px auto"
136
+ minHeight = "100vh"
137
+ flexFlow = "column"
138
+ sx = { {
139
+ "@media" : {
140
+ minWidth : "1024px" ,
141
+ maxWidth : "1504px" ,
142
+ } ,
143
+ } }
144
+ >
165
145
< ZenMode >
166
146
< Nav path = { path } />
167
147
{ shouldShowSideNav && < SideNavMobile path = { path } /> }
168
148
</ ZenMode >
169
149
< SkipLinkAnchor id = "main-content" />
170
- < MainContainer >
150
+ < Flex
151
+ sx = { {
152
+ "@media (max-width: 1024px" : {
153
+ flexDirection : "column" ,
154
+ } ,
155
+ } }
156
+ >
171
157
{ shouldShowSideNav && (
172
158
< ZenMode >
173
159
< SideNav path = { path } />
174
160
</ ZenMode >
175
161
) }
176
- < MainContent >
177
- < Main > { children } </ Main >
178
- </ MainContent >
179
- </ MainContainer >
162
+ < Flex flexDirection = "column" width = "100%" >
163
+ < Flex
164
+ justifyContent = "space-around"
165
+ alignItems = "flex-start"
166
+ overflow = "visible"
167
+ width = "100%"
168
+ flexGrow = "1"
169
+ >
170
+ { children }
171
+ </ Flex >
172
+ </ Flex >
173
+ </ Flex >
180
174
< ZenMode >
181
175
< Footer />
182
176
</ ZenMode >
183
177
< FeedbackWidget location = { path } />
184
- </ ContentContainer >
178
+ </ Flex >
185
179
</ ZenModeContext . Provider >
186
180
</ ThemeProvider >
187
181
</ ApolloProvider >
0 commit comments