mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor: remove react-helmet-async (#1409)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import type { EditorContainer } from '@blocksuite/editor';
|
||||
import { assertExists, Page } from '@blocksuite/store';
|
||||
import dynamic from 'next/dynamic';
|
||||
import Head from 'next/head';
|
||||
import React from 'react';
|
||||
import { Helmet } from 'react-helmet-async';
|
||||
|
||||
import { useBlockSuiteWorkspacePageTitle } from '../hooks/use-blocksuite-workspace-page-title';
|
||||
import { usePageMeta } from '../hooks/use-page-meta';
|
||||
@@ -48,9 +48,9 @@ export const PageDetailEditor: React.FC<PageDetailEditorProps> = ({
|
||||
assertExists(meta);
|
||||
return (
|
||||
<>
|
||||
<Helmet defaultTitle={title}>
|
||||
<Head>
|
||||
<title>{title}</title>
|
||||
</Helmet>
|
||||
</Head>
|
||||
<BlockSuiteEditorHeader
|
||||
isPublic={isPublic}
|
||||
isPreview={isPreview}
|
||||
|
||||
@@ -5,9 +5,9 @@ import { NoSsr } from '@mui/material';
|
||||
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
|
||||
import { atomWithStorage } from 'jotai/utils';
|
||||
import dynamic from 'next/dynamic';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
import React, { Suspense, useCallback, useEffect } from 'react';
|
||||
import { Helmet } from 'react-helmet-async';
|
||||
|
||||
import {
|
||||
currentWorkspaceIdAtom,
|
||||
@@ -173,9 +173,9 @@ export const WorkspaceLayoutInner: React.FC<React.PropsWithChildren> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<Head>
|
||||
<title>{title}</title>
|
||||
</Helmet>
|
||||
</Head>
|
||||
<StyledPage>
|
||||
<WorkSpaceSliderBar
|
||||
isPublicWorkspace={isPublicWorkspace}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Button, displayFlex, styled } from '@affine/component';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import Head from 'next/head';
|
||||
import Image from 'next/image';
|
||||
import { useRouter } from 'next/router';
|
||||
import React from 'react';
|
||||
import { Helmet } from 'react-helmet-async';
|
||||
|
||||
import ErrorImg from '../../public/imgs/invite-error.svg';
|
||||
|
||||
@@ -48,9 +48,9 @@ export const NotfoundPage = () => {
|
||||
export default function Custom404() {
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
s<title>404 - AFFiNE</title>
|
||||
</Helmet>
|
||||
<Head>
|
||||
<title>404 - AFFiNE</title>
|
||||
</Head>
|
||||
<NotfoundPage></NotfoundPage>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -10,7 +10,6 @@ import { AppProps } from 'next/app';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
import React, { memo, ReactElement, Suspense, useEffect, useMemo } from 'react';
|
||||
import { Helmet, HelmetProvider } from 'react-helmet-async';
|
||||
|
||||
import { jotaiStore } from '../atoms';
|
||||
import { AffineErrorBoundary } from '../components/affine/affine-error-eoundary';
|
||||
@@ -71,47 +70,43 @@ const App = function App({
|
||||
[]
|
||||
)}
|
||||
>
|
||||
<HelmetProvider key="HelmetProvider" context={helmetContext}>
|
||||
<Helmet>
|
||||
<title>AFFiNE</title>
|
||||
<meta
|
||||
name="viewport"
|
||||
content="initial-scale=1, width=device-width"
|
||||
/>
|
||||
</Helmet>
|
||||
<Head>
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:url" content="https://app.affine.pro/" />
|
||||
<meta
|
||||
name="twitter:title"
|
||||
content="AFFiNE:There can be more than Notion and Miro."
|
||||
/>
|
||||
<meta
|
||||
name="twitter:description"
|
||||
content="There can be more than Notion and Miro. AFFiNE is a next-gen knowledge base that brings planning, sorting and creating all together."
|
||||
/>
|
||||
<meta name="twitter:site" content="@AffineOfficial" />
|
||||
<meta
|
||||
name="twitter:image"
|
||||
content="https://affine.pro/og.jpeg"
|
||||
/>
|
||||
<meta
|
||||
property="og:title"
|
||||
content="AFFiNE:There can be more than Notion and Miro."
|
||||
/>
|
||||
<meta property="og:type" content="website" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="There can be more than Notion and Miro. AFFiNE is a next-gen knowledge base that brings planning, sorting and creating all together."
|
||||
/>
|
||||
<meta property="og:url" content="https://app.affine.pro/" />
|
||||
<meta
|
||||
property="og:image"
|
||||
content="https://affine.pro/og.jpeg"
|
||||
/>
|
||||
</Head>
|
||||
{getLayout(<Component {...pageProps} />)}
|
||||
</HelmetProvider>
|
||||
<Head>
|
||||
<title>AFFiNE</title>
|
||||
<meta
|
||||
name="viewport"
|
||||
content="initial-scale=1, width=device-width"
|
||||
/>
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:url" content="https://app.affine.pro/" />
|
||||
<meta
|
||||
name="twitter:title"
|
||||
content="AFFiNE:There can be more than Notion and Miro."
|
||||
/>
|
||||
<meta
|
||||
name="twitter:description"
|
||||
content="There can be more than Notion and Miro. AFFiNE is a next-gen knowledge base that brings planning, sorting and creating all together."
|
||||
/>
|
||||
<meta name="twitter:site" content="@AffineOfficial" />
|
||||
<meta
|
||||
name="twitter:image"
|
||||
content="https://affine.pro/og.jpeg"
|
||||
/>
|
||||
<meta
|
||||
property="og:title"
|
||||
content="AFFiNE:There can be more than Notion and Miro."
|
||||
/>
|
||||
<meta property="og:type" content="website" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="There can be more than Notion and Miro. AFFiNE is a next-gen knowledge base that brings planning, sorting and creating all together."
|
||||
/>
|
||||
<meta property="og:url" content="https://app.affine.pro/" />
|
||||
<meta
|
||||
property="og:image"
|
||||
content="https://affine.pro/og.jpeg"
|
||||
/>
|
||||
</Head>
|
||||
{getLayout(<Component {...pageProps} />)}
|
||||
</ProviderComposer>
|
||||
</Suspense>
|
||||
</AffineErrorBoundary>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import { FavoriteIcon } from '@blocksuite/icons';
|
||||
import { assertExists } from '@blocksuite/store';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
import React, { useCallback } from 'react';
|
||||
import { Helmet } from 'react-helmet-async';
|
||||
|
||||
import PageList from '../../../components/blocksuite/block-suite-page-list/page-list';
|
||||
import { PageLoading } from '../../../components/pure/loading';
|
||||
@@ -42,9 +42,9 @@ const FavouritePage: NextPageWithLayout = () => {
|
||||
assertExists(blockSuiteWorkspace);
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<Head>
|
||||
<title>{t('Favorites')} - AFFiNE</title>
|
||||
</Helmet>
|
||||
</Head>
|
||||
<WorkspaceTitle icon={<FavoriteIcon />}>{t('Favorites')}</WorkspaceTitle>
|
||||
<PageList
|
||||
blockSuiteWorkspace={blockSuiteWorkspace}
|
||||
|
||||
@@ -130,7 +130,7 @@ const SettingPage: NextPageWithLayout = () => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{t('Workspace Settings')} - AFFiNE</title>
|
||||
<title>{t('Settings')} - AFFiNE</title>
|
||||
</Head>
|
||||
<WorkspaceTitle icon={<SettingsIcon />}>
|
||||
{t('Workspace Settings')}
|
||||
@@ -150,7 +150,7 @@ const SettingPage: NextPageWithLayout = () => {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{t('Workspace Settings')} - AFFiNE</title>
|
||||
<title>{t('Settings')} - AFFiNE</title>
|
||||
</Head>
|
||||
<WorkspaceTitle icon={<SettingsIcon />}>
|
||||
{t('Workspace Settings')}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import { DeleteTemporarilyIcon } from '@blocksuite/icons';
|
||||
import { assertExists } from '@blocksuite/store';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
import React, { useCallback } from 'react';
|
||||
import { Helmet } from 'react-helmet-async';
|
||||
|
||||
import PageList from '../../../components/blocksuite/block-suite-page-list/page-list';
|
||||
import { PageLoading } from '../../../components/pure/loading';
|
||||
@@ -45,9 +45,9 @@ const TrashPage: NextPageWithLayout = () => {
|
||||
assertExists(blockSuiteWorkspace);
|
||||
return (
|
||||
<>
|
||||
<Helmet>
|
||||
<Head>
|
||||
<title>{t('Trash')} - AFFiNE</title>
|
||||
</Helmet>
|
||||
</Head>
|
||||
<WorkspaceTitle icon={<DeleteTemporarilyIcon />}>
|
||||
{t('Trash')}
|
||||
</WorkspaceTitle>
|
||||
|
||||
Reference in New Issue
Block a user