@@ -9,7 +9,7 @@ import Box from "@mui/material/Box";
99import Typography from "@mui/material/Typography" ;
1010
1111import Layout from "components/Layout" ;
12- import { Locale } from "shared/interface" ;
12+ import { BuildType , Locale } from "shared/interface" ;
1313import { Page404Icon } from "components/Icons" ;
1414import Seo from "components/Layout/Seo" ;
1515
@@ -27,6 +27,7 @@ interface AllLocales {
2727
2828interface PageNotFoundTemplateProps {
2929 pageContext : {
30+ buildType : BuildType ;
3031 feature ?: {
3132 banner ?: boolean ;
3233 } ;
@@ -35,7 +36,7 @@ interface PageNotFoundTemplateProps {
3536}
3637
3738export default function PageNotFoundTemplate ( {
38- pageContext : { feature } ,
39+ pageContext : { feature, buildType } ,
3940 data,
4041} : PageNotFoundTemplateProps ) {
4142 const pathname =
@@ -72,13 +73,14 @@ export default function PageNotFoundTemplate({
7273 return i18n ;
7374 } , [ language , data ] ) ;
7475
75- const bannerVisible = feature ?. banner && language !== Locale . ja ;
76+ const bannerVisible =
77+ ( feature ?. banner && language !== Locale . ja ) || buildType === "archive" ;
7678
7779 return (
7880 < >
7981 < I18nextProvider i18n = { i18n } >
8082 < I18nextContext . Provider value = { { ...context , language } } >
81- < Layout bannerEnabled = { bannerVisible } >
83+ < Layout bannerEnabled = { bannerVisible } buildType = { buildType } >
8284 < Seo lang = { language as Locale } title = "404 Not Found" noindex />
8385 < Container
8486 sx = { {
@@ -123,13 +125,6 @@ export default function PageNotFoundTemplate({
123125 < Trans i18nKey = "doc404.searchDoc" />
124126 </ Typography >
125127 </ Typography >
126- { /* <div className={styles.searchInput}>
127- <SearchInput
128- docInfo={docInfo}
129- searchValue={searchValue}
130- setSearchValue={handleSetSearchValue}
131- />
132- </div> */ }
133128 </ >
134129 ) }
135130 </ Stack >
@@ -153,40 +148,6 @@ export default function PageNotFoundTemplate({
153148 </ Stack >
154149 </ Container >
155150 </ Layout >
156- { /* <Layout is404={true}>
157- <Seo title="404 Not Found" noindex />
158- <div className={styles.container}>
159- <div className={clsx('markdown-body', styles.left)}>
160- <h1 className={clsx(styles.title)}>
161- {<Trans i18nKey="doc404.title" />}
162- </h1>
163- {['en', 'zh'].includes(language) && (
164- <>
165- <div>{<Trans i18nKey="doc404.youMayWish" />}</div>
166- <ul className={clsx(styles.optionsContainer)}>
167- <li>
168- {
169- <Trans
170- i18nKey="doc404.goToDocHome"
171- components={[<Link to="/" />]}
172- />
173- }
174- </li>
175- <li>{<Trans i18nKey="doc404.searchDoc" />}</li>
176- </ul>
177- <div className={styles.searchInput}>
178- <SearchInput
179- docInfo={docInfo}
180- searchValue={searchValue}
181- setSearchValue={handleSetSearchValue}
182- />
183- </div>
184- </>
185- )}
186- </div>
187- <div className={clsx(styles.right)}></div>
188- </div>
189- </Layout> */ }
190151 </ I18nextContext . Provider >
191152 </ I18nextProvider >
192153 </ >
0 commit comments