Skip to content

Commit 504f5fb

Browse files
committed
theme game locale 404
1 parent 22446ec commit 504f5fb

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

themes/game/index.js

+16-10
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import NotionPage from '@/components/NotionPage'
66
import { PWA as initialPWA } from '@/components/PWA'
77
import ShareBar from '@/components/ShareBar'
88
import { siteConfig } from '@/lib/config'
9+
import { useGlobal } from '@/lib/global'
910
import { loadWowJS } from '@/lib/plugins/wow'
1011
import { deepClone, isBrowser, shuffleArray } from '@/lib/utils'
1112
import Link from 'next/link'
13+
import { useRouter } from 'next/router'
1214
import { createContext, useContext, useEffect, useRef, useState } from 'react'
1315
import Announcement from './components/Announcement'
1416
import { ArticleLock } from './components/ArticleLock'
@@ -30,7 +32,6 @@ import SideBarContent from './components/SideBarContent'
3032
import SideBarDrawer from './components/SideBarDrawer'
3133
import CONFIG from './config'
3234
import { Style } from './style'
33-
import { useRouter } from 'next/router'
3435

3536
// const AlgoliaSearchModal = dynamic(() => import('@/components/AlgoliaSearchModal'), { ssr: false })
3637

@@ -354,7 +355,7 @@ const LayoutSlug = props => {
354355
*/
355356
const Layout404 = props => {
356357
const router = useRouter()
357-
const { locale } = useGameGlobal()
358+
const { locale } = useGlobal()
358359
useEffect(() => {
359360
// 延时3秒如果加载失败就返回首页
360361
setTimeout(() => {
@@ -367,16 +368,21 @@ const Layout404 = props => {
367368
}, 3000)
368369
}, [])
369370

370-
return <>
371-
<div className='md:-mt-20 text-black w-full h-screen text-center justify-center content-center items-center flex flex-col'>
372-
<div className='dark:text-gray-200'>
373-
<h2 className='inline-block border-r-2 border-gray-600 mr-2 px-3 py-2 align-top'><i className='mr-2 fas fa-spinner animate-spin' />404</h2>
374-
<div className='inline-block text-left h-32 leading-10 items-center'>
375-
<h2 className='m-0 p-0'>{locale.NAV.PAGE_NOT_FOUND_REDIRECT}</h2>
376-
</div>
377-
</div>
371+
return (
372+
<>
373+
<div className='md:-mt-20 text-black w-full h-screen text-center justify-center content-center items-center flex flex-col'>
374+
<div className='dark:text-gray-200'>
375+
<h2 className='inline-block border-r-2 border-gray-600 mr-2 px-3 py-2 align-top'>
376+
<i className='mr-2 fas fa-spinner animate-spin' />
377+
404
378+
</h2>
379+
<div className='inline-block text-left h-32 leading-10 items-center'>
380+
<h2 className='m-0 p-0'>{locale.NAV.PAGE_NOT_FOUND_REDIRECT}</h2>
381+
</div>
378382
</div>
383+
</div>
379384
</>
385+
)
380386
}
381387

382388
/**

0 commit comments

Comments
 (0)