@@ -11,7 +11,7 @@ import {
11
11
createMuiTheme ,
12
12
ThemeProvider as MuiThemeProvider
13
13
} from '@material-ui/core/styles'
14
-
14
+ import { SnackbarProvider } from 'notistack'
15
15
import SEO from 'src/components/SEO'
16
16
import theme from '../../config/Theme'
17
17
import { media } from 'src/utils/media'
@@ -22,6 +22,7 @@ import Scroller from 'src/components/Scroller'
22
22
import axios from 'src/utils/http'
23
23
import { AuthenticationContext } from 'src/hooks/useAuthentication'
24
24
import { Dialog , DialogTitle , Typography } from '@material-ui/core'
25
+ import DailyCheckIn from 'src/components/DailyCheckIn'
25
26
26
27
const Login = React . lazy ( ( ) => import ( 'src/app/Login' ) )
27
28
@@ -167,68 +168,74 @@ const Layout = ({ children, location, pageContext, i18nMessages }) => {
167
168
const langKey = getCurrentLangKey ( langs , defaultLangKey , url )
168
169
169
170
return (
170
- < AuthenticationContext . Provider
171
- value = { {
172
- user : authentication ,
173
- refresher,
174
- isAuthenticated,
175
- authenticationLoading
176
- } }
177
- >
178
- < MuiThemeProvider theme = { muiTheme } >
179
- < IntlProvider locale = { langKey } messages = { i18nMessages } >
180
- < ThemeProvider theme = { theme } >
181
- < React . Fragment >
182
- < Parallax />
183
- < SEO />
184
- < GlobalStyle />
185
- < Navigation />
186
- { children }
187
-
188
- < Dialog
189
- open = { showLogin }
190
- onClose = { ( ) => setshowLogin ( false ) }
191
- >
192
- < DialogTitle >
193
- < Typography > 登录</ Typography >
194
- </ DialogTitle >
195
- < React . Suspense fallback = { '加载中' } >
196
- < Login > </ Login >
197
- </ React . Suspense >
198
- </ Dialog >
199
- < Scroller >
200
- < VerticalAlignTopIcon
201
- style = { { marginRight : '0px' , transform : 'scale(1.5)' } }
202
- > </ VerticalAlignTopIcon >
203
- </ Scroller >
204
- { pageContext . layout !== 'docs' && (
205
- < Footer >
206
- < div >
207
- < SocialIcon . GitHub link = "https://github.com/serializedowen" />
208
- < SocialIcon . LinkedIn link = "https://www.linkedin.com/in/jiahao-wang-7319b45b/" />
209
- < SocialIcon . Wechat
210
- link = { withPrefix ( '/social/QRcode.jpg' ) }
211
- />
212
- < SocialIcon . Facebook link = "https://www.facebook.com/owentheoracle" />
213
- </ div >
214
- < FormattedMessage id = "copyrights" > </ FormattedMessage > { ' ' }
215
- < br />
216
- < a href = "https://github.com/serializedowen/serializedowen.github.io" >
217
- GitHub Repository
218
- </ a > { ' ' }
219
- < br />
220
- < span > Last build: { data . site . buildTime } </ span >
221
- < br />
222
- < a href = "http://beian.miit.gov.cn/" >
223
- 浙ICP备2020034764
224
- </ a >
225
- </ Footer >
226
- ) }
227
- </ React . Fragment >
228
- </ ThemeProvider >
229
- </ IntlProvider >
230
- </ MuiThemeProvider >
231
- </ AuthenticationContext . Provider >
171
+ < IntlProvider locale = { langKey } messages = { i18nMessages } >
172
+ < AuthenticationContext . Provider
173
+ value = { {
174
+ user : authentication ,
175
+ refresher,
176
+ isAuthenticated,
177
+ authenticationLoading
178
+ } }
179
+ >
180
+ < SnackbarProvider maxSnack = { 3 } >
181
+ < MuiThemeProvider theme = { muiTheme } >
182
+ < ThemeProvider theme = { theme } >
183
+ < React . Fragment >
184
+ < DailyCheckIn > </ DailyCheckIn >
185
+ < Parallax />
186
+ < SEO />
187
+ < GlobalStyle />
188
+ < Navigation />
189
+ { children }
190
+
191
+ < Dialog
192
+ open = { showLogin }
193
+ onClose = { ( ) => setshowLogin ( false ) }
194
+ >
195
+ < DialogTitle >
196
+ < Typography > 登录</ Typography >
197
+ </ DialogTitle >
198
+ < React . Suspense fallback = { '加载中' } >
199
+ < Login > </ Login >
200
+ </ React . Suspense >
201
+ </ Dialog >
202
+ < Scroller >
203
+ < VerticalAlignTopIcon
204
+ style = { {
205
+ marginRight : '0px' ,
206
+ transform : 'scale(1.5)'
207
+ } }
208
+ > </ VerticalAlignTopIcon >
209
+ </ Scroller >
210
+ { pageContext . layout !== 'docs' && (
211
+ < Footer >
212
+ < div >
213
+ < SocialIcon . GitHub link = "https://github.com/serializedowen" />
214
+ < SocialIcon . LinkedIn link = "https://www.linkedin.com/in/jiahao-wang-7319b45b/" />
215
+ < SocialIcon . Wechat
216
+ link = { withPrefix ( '/social/QRcode.jpg' ) }
217
+ />
218
+ < SocialIcon . Facebook link = "https://www.facebook.com/owentheoracle" />
219
+ </ div >
220
+ < FormattedMessage id = "copyrights" > </ FormattedMessage > { ' ' }
221
+ < br />
222
+ < a href = "https://github.com/serializedowen/serializedowen.github.io" >
223
+ GitHub Repository
224
+ </ a > { ' ' }
225
+ < br />
226
+ < span > Last build: { data . site . buildTime } </ span >
227
+ < br />
228
+ < a href = "http://beian.miit.gov.cn/" >
229
+ 浙ICP备2020034764
230
+ </ a >
231
+ </ Footer >
232
+ ) }
233
+ </ React . Fragment >
234
+ </ ThemeProvider >
235
+ </ MuiThemeProvider >
236
+ </ SnackbarProvider >
237
+ </ AuthenticationContext . Provider >
238
+ </ IntlProvider >
232
239
)
233
240
} }
234
241
/>
0 commit comments