feat: add backhome

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

No files matched your search

+15 -1
View File
@@ -1,10 +1,24 @@
import { NotFoundTitle, PageContainer } from './styles'; import { NotFoundTitle, PageContainer } from './styles';
import { useTranslation } from '@affine/i18n'; import { useTranslation } from '@affine/i18n';
import { Button } from '@/ui/button';
import { useRouter } from 'next/router';
export const NotfoundPage = () => { export const NotfoundPage = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const router = useRouter();
return ( return (
<PageContainer> <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> </PageContainer>
); );
}; };
-4
View File
@@ -1,9 +1,5 @@
import NotfoundPage from '@/components/404'; import NotfoundPage from '@/components/404';
import { useAppState } from '@/providers/app-state-provider';
export default function Custom404() { export default function Custom404() {
const { workspaceList } = useAppState();
console.log('workspaceList: ', workspaceList);
return <NotfoundPage></NotfoundPage>; return <NotfoundPage></NotfoundPage>;
} }