refactor!: next generation AFFiNE code structure (#1176)

This commit is contained in:
Himself65
2023-03-01 01:40:01 -06:00
committed by GitHub
parent 2dcccc772c
commit e0481d29ad
270 changed files with 8308 additions and 6829 deletions
+48 -5
View File
@@ -1,13 +1,56 @@
import Head from 'next/head';
import { Button, displayFlex, styled } from '@affine/component';
import { useTranslation } from '@affine/i18n';
import Image from 'next/image';
import { useRouter } from 'next/router';
import React from 'react';
import { Helmet } from 'react-helmet-async';
import NotfoundPage from '@/components/404';
import ErrorImg from '../../public/imgs/invite-error.svg';
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 } = useTranslation();
const router = useRouter();
return (
<StyledContainer data-testid="notFound">
<Image alt="404" src={ErrorImg}></Image>
<p>{t('404 - Page Not Found')}</p>
<Button
shape="round"
onClick={() => {
router.push('/');
}}
>
{t('Back Home')}
</Button>
</StyledContainer>
);
};
export default function Custom404() {
return (
<>
<Head>
<title>404 - AFFiNE</title>
</Head>
<Helmet>
s<title>404 - AFFiNE</title>
</Helmet>
<NotfoundPage></NotfoundPage>
</>
);