Files
AFFiNE-Mirror/apps/web/src/pages/404.tsx
T
Peng Xiao 5699c99bf6 feat: add new rule for floating promise (#2726)
Co-authored-by: Himself65 <himself65@outlook.com>
(cherry picked from commit bedf838fe5)
2023-06-20 14:44:27 +08:00

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>
</>
);
}