@@ -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,46 @@ 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
+ maxW = { {
139
+ lg : lightTheme . variables . maxPageWidth
140
+ } }
141
+ >
165
142
< ZenMode >
166
143
< Nav path = { path } />
167
144
{ shouldShowSideNav && < SideNavMobile path = { path } /> }
168
145
</ ZenMode >
169
146
< SkipLinkAnchor id = "main-content" />
170
- < MainContainer >
147
+ < Flex
148
+ flexDirection = { { base : 'column' , lg : 'row' } }
149
+ >
171
150
{ shouldShowSideNav && (
172
151
< ZenMode >
173
152
< SideNav path = { path } />
174
153
</ ZenMode >
175
154
) }
176
- < MainContent >
177
- < Main > { children } </ Main >
178
- </ MainContent >
179
- </ MainContainer >
155
+ < Flex flexDirection = "column" width = "100%" >
156
+ < Flex
157
+ justifyContent = "space-around"
158
+ alignItems = "flex-start"
159
+ overflow = "visible"
160
+ width = "100%"
161
+ flexGrow = "1"
162
+ >
163
+ { children }
164
+ </ Flex >
165
+ </ Flex >
166
+ </ Flex >
180
167
< ZenMode >
181
168
< Footer />
182
169
</ ZenMode >
183
170
< FeedbackWidget location = { path } />
184
- </ ContentContainer >
171
+ </ Flex >
185
172
</ ZenModeContext . Provider >
186
173
</ ThemeProvider >
187
174
</ ApolloProvider >
0 commit comments