mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-28 09:14:57 +03:00
fix: add page titles (#883)
This commit is contained in:
parent
0ccaf2bc45
commit
0984c37cad
@ -59,7 +59,6 @@ export const Editor = ({ page, workspace, setEditor }: Props) => {
|
||||
}
|
||||
|
||||
setEditor(editor);
|
||||
document.title = page.meta.title || 'Untitled';
|
||||
return ret;
|
||||
}, [workspace, page, setEditor]);
|
||||
|
||||
|
@ -1,5 +1,13 @@
|
||||
import NotfoundPage from '@/components/404';
|
||||
import Head from 'next/head';
|
||||
|
||||
export default function Custom404() {
|
||||
return <NotfoundPage></NotfoundPage>;
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>404 - AFFiNE</title>
|
||||
</Head>
|
||||
<NotfoundPage></NotfoundPage>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ const App = ({ Component, pageProps }: AppPropsWithLayout) => {
|
||||
sizes="180x180"
|
||||
href="/icons/apple-touch-icon.png"
|
||||
/>
|
||||
<title>AFFiNE</title>
|
||||
</Head>
|
||||
<Logger />
|
||||
<ProviderComposer
|
||||
|
@ -15,6 +15,8 @@ import { useRouter } from 'next/router';
|
||||
import { usePageHelper } from '@/hooks/use-page-helper';
|
||||
import dynamic from 'next/dynamic';
|
||||
import { EditorContainer } from '@blocksuite/editor';
|
||||
import Head from 'next/head';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
const DynamicBlocksuite = dynamic(() => import('@/components/editor'), {
|
||||
ssr: false,
|
||||
});
|
||||
@ -25,8 +27,12 @@ const Page: NextPageWithLayout = () => {
|
||||
(editor: EditorContainer) => setEditor.current(editor),
|
||||
[setEditor]
|
||||
);
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{currentPage?.meta?.title || t('Untitled')} - AFFiNE</title>
|
||||
</Head>
|
||||
<EditorHeader />
|
||||
<MobileModal />
|
||||
|
||||
|
@ -5,6 +5,8 @@ import { ReactElement } from 'react';
|
||||
import WorkspaceLayout from '@/components/workspace-layout';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import { PageMeta, useAppState } from '@/providers/app-state-provider';
|
||||
import Head from 'next/head';
|
||||
|
||||
const All = () => {
|
||||
const { currentWorkspace } = useAppState();
|
||||
const pageList = (currentWorkspace?.blocksuiteWorkspace?.meta.pageMetas ||
|
||||
@ -12,6 +14,9 @@ const All = () => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{t('All pages')} - AFFiNE</title>
|
||||
</Head>
|
||||
<PageListHeader icon={<AllPagesIcon />}>{t('All pages')}</PageListHeader>
|
||||
<PageList
|
||||
pageList={pageList.filter(p => !p.trash)}
|
||||
|
@ -5,11 +5,15 @@ import { ReactElement } from 'react';
|
||||
import WorkspaceLayout from '@/components/workspace-layout';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import { useAppState } from '@/providers/app-state-provider';
|
||||
import Head from 'next/head';
|
||||
export const Favorite = () => {
|
||||
const { pageList } = useAppState();
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{t('Favourites')} - AFFiNE</title>
|
||||
</Head>
|
||||
<PageListHeader icon={<FavouritesIcon />}>
|
||||
{t('Favourites')}
|
||||
</PageListHeader>
|
||||
|
@ -19,6 +19,7 @@ import WorkspaceLayout from '@/components/workspace-layout';
|
||||
import { WorkspaceUnit } from '@affine/datacenter';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import { PageListHeader } from '@/components/header';
|
||||
import Head from 'next/head';
|
||||
|
||||
const useTabMap = () => {
|
||||
const { t } = useTranslation();
|
||||
@ -79,6 +80,9 @@ const WorkspaceSetting = () => {
|
||||
useTabMap();
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{t('Settings')} - AFFiNE</title>
|
||||
</Head>
|
||||
<StyledSettingContainer>
|
||||
<PageListHeader icon={<SettingsIcon />}>{t('Settings')}</PageListHeader>
|
||||
<StyledSettingSidebar>
|
||||
|
@ -5,11 +5,15 @@ import { ReactElement } from 'react';
|
||||
import WorkspaceLayout from '@/components/workspace-layout';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import { useAppState } from '@/providers/app-state-provider';
|
||||
import Head from 'next/head';
|
||||
export const Trash = () => {
|
||||
const { pageList } = useAppState();
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{t('Trash')} - AFFiNE</title>
|
||||
</Head>
|
||||
<PageListHeader icon={<TrashIcon />}>{t('Trash')}</PageListHeader>
|
||||
<PageList
|
||||
pageList={pageList.filter(p => p.trash)}
|
||||
|
Loading…
Reference in New Issue
Block a user