feat: add backhome

This commit is contained in:
DiamondThree
2023-01-12 17:33:12 +08:00
parent 251cfc2340
commit a0c9f9a49c
2 changed files with 15 additions and 5 deletions

View File

@@ -1,10 +1,24 @@
import { NotFoundTitle, PageContainer } from './styles';
import { useTranslation } from '@affine/i18n';
import { Button } from '@/ui/button';
import { useRouter } from 'next/router';
export const NotfoundPage = () => {
const { t } = useTranslation();
const router = useRouter();
return (
<PageContainer>
<NotFoundTitle>{t('404 - Page Not Found')}</NotFoundTitle>
<NotFoundTitle>
{t('404 - Page Not Found')}
<p>
<Button
onClick={() => {
router.push('/workspace');
}}
>
Back Home
</Button>
</p>
</NotFoundTitle>
</PageContainer>
);
};

View File

@@ -1,9 +1,5 @@
import NotfoundPage from '@/components/404';
import { useAppState } from '@/providers/app-state-provider';
export default function Custom404() {
const { workspaceList } = useAppState();
console.log('workspaceList: ', workspaceList);
return <NotfoundPage></NotfoundPage>;
}