Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

feat: add backhome

DiamondThreea0c9f9a49c25
diff --git a/packages/app/src/components/404/index.tsx b/packages/app/src/components/404/index.tsx
index 8ed4232807..36f1b90a34 100644
--- a/packages/app/src/components/404/index.tsx
+++ b/packages/app/src/components/404/index.tsx
@@ -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>
);
};
diff --git a/packages/app/src/pages/404.tsx b/packages/app/src/pages/404.tsx
index 74f25f07ed..0eef5261e5 100644
--- a/packages/app/src/pages/404.tsx
+++ b/packages/app/src/pages/404.tsx
@@ -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>;
}