mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
5699c99bf6
Co-authored-by: Himself65 <himself65@outlook.com>
(cherry picked from commit bedf838fe5)
56 lines
1.2 KiB
TypeScript
56 lines
1.2 KiB
TypeScript
import { Button, displayFlex, styled } from '@affine/component';
|
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
|
import Head from 'next/head';
|
|
import Image from 'next/legacy/image';
|
|
import { useRouter } from 'next/router';
|
|
import React from 'react';
|
|
|
|
export const StyledContainer = styled('div')(() => {
|
|
return {
|
|
...displayFlex('center', 'center'),
|
|
flexDirection: 'column',
|
|
height: '100vh',
|
|
|
|
img: {
|
|
width: '360px',
|
|
height: '270px',
|
|
},
|
|
p: {
|
|
fontSize: '22px',
|
|
fontWeight: 600,
|
|
margin: '24px 0',
|
|
},
|
|
};
|
|
});
|
|
|
|
export const NotfoundPage = () => {
|
|
const t = useAFFiNEI18N();
|
|
const router = useRouter();
|
|
return (
|
|
<StyledContainer data-testid="notFound">
|
|
<Image alt="404" src="/imgs/invite-error.svg" width={360} height={270} />
|
|
|
|
<p>{t['404 - Page Not Found']()}</p>
|
|
<Button
|
|
shape="round"
|
|
onClick={() => {
|
|
router.push('/').catch(err => console.error(err));
|
|
}}
|
|
>
|
|
{t['Back Home']()}
|
|
</Button>
|
|
</StyledContainer>
|
|
);
|
|
};
|
|
|
|
export default function Custom404() {
|
|
return (
|
|
<>
|
|
<Head>
|
|
<title>404 - AFFiNE</title>
|
|
</Head>
|
|
<NotfoundPage></NotfoundPage>
|
|
</>
|
|
);
|
|
}
|