refactor: remove react-helmet-async (#1409)

This commit is contained in:
Himself65 2023-03-08 01:08:24 -06:00 committed by GitHub
parent b8e45d059c
commit 6281122394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 55 additions and 86 deletions

View File

@ -33,7 +33,6 @@
"next-themes": "^0.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet-async": "^1.3.0",
"react-is": "^18.2.0",
"swr": "^2.0.4",
"y-indexeddb": "^9.0.9",

View File

@ -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}

View File

@ -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}

View File

@ -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>
</>
);

View File

@ -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="AFFiNEThere 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="AFFiNEThere 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="AFFiNEThere 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="AFFiNEThere 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>

View File

@ -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}

View File

@ -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')}

View File

@ -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>

View File

@ -179,7 +179,6 @@ importers:
raw-loader: ^4.0.2
react: ^18.2.0
react-dom: ^18.2.0
react-helmet-async: ^1.3.0
react-is: ^18.2.0
redux: ^4.2.1
swr: ^2.0.4
@ -214,7 +213,6 @@ importers:
next-themes: 0.2.1_nvzgbose6yf6w7ijjprgspqefi
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
react-helmet-async: 1.3.0_biqbaboplfbrettd7655fr4n2y
react-is: 18.2.0
swr: 2.0.4_react@18.2.0
y-indexeddb: 9.0.9_yjs@13.5.48
@ -10998,25 +10996,6 @@ packages:
react-is: 18.2.0
dev: true
/react-fast-compare/3.2.0:
resolution: {integrity: sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==}
dev: false
/react-helmet-async/1.3.0_biqbaboplfbrettd7655fr4n2y:
resolution: {integrity: sha512-9jZ57/dAn9t3q6hneQS0wukqC2ENOBgMNVEhb/ZG9ZSxUetzVIw4iAmEU38IaVg3QGYauQPhSeUTuIUtFglWpg==}
peerDependencies:
react: ^16.6.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.6.0 || ^17.0.0 || ^18.0.0
dependencies:
'@babel/runtime': 7.21.0
invariant: 2.2.4
prop-types: 15.8.1
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
react-fast-compare: 3.2.0
shallowequal: 1.1.0
dev: false
/react-i18next/12.2.0_3yopsigl4h4eb2nqrqfsy65uwi:
resolution: {integrity: sha512-5XeVgSygaGfyFmDd2WcXvINRw2WEC1XviW1LXY/xLOEMzsCFRwKqfnHN+hUjla8ZipbVJR27GCMSuTr0BhBBBQ==}
peerDependencies:
@ -11546,10 +11525,6 @@ packages:
kind-of: 6.0.3
dev: true
/shallowequal/1.1.0:
resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==}
dev: false
/shebang-command/2.0.0:
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
engines: {node: '>=8'}