mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
fix(web): async load images (#1714)
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { Button, displayFlex, styled } from '@affine/component';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
import Head from 'next/head';
|
||||
import Image from 'next/image';
|
||||
import Image from 'next/legacy/image';
|
||||
import { useRouter } from 'next/router';
|
||||
import React from 'react';
|
||||
|
||||
import ErrorImg from '../../public/imgs/invite-error.svg';
|
||||
|
||||
export const StyledContainer = styled('div')(() => {
|
||||
return {
|
||||
...displayFlex('center', 'center'),
|
||||
@@ -30,7 +28,7 @@ export const NotfoundPage = () => {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<StyledContainer data-testid="notFound">
|
||||
<Image alt="404" src={ErrorImg}></Image>
|
||||
<Image alt="404" src="/imgs/invite-error.svg"></Image>
|
||||
|
||||
<p>{t('404 - Page Not Found')}</p>
|
||||
<Button
|
||||
|
||||
@@ -6,13 +6,11 @@ import {
|
||||
UnsucessfulDuotoneIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { NoSsr } from '@mui/material';
|
||||
import Image from 'next/image';
|
||||
import Image from 'next/legacy/image';
|
||||
import { useRouter } from 'next/router';
|
||||
import { Suspense } from 'react';
|
||||
import useSWR from 'swr';
|
||||
|
||||
import inviteError from '../../../public/imgs/invite-error.svg';
|
||||
import inviteSuccess from '../../../public/imgs/invite-success.svg';
|
||||
import { PageLoading } from '../../components/pure/loading';
|
||||
import { RouteLogic, useRouterHelper } from '../../hooks/use-router-helper';
|
||||
import { QueryKey } from '../../plugins/affine/fetcher';
|
||||
@@ -31,7 +29,7 @@ const InvitePage: NextPageWithLayout = () => {
|
||||
if (inviteData?.accepted) {
|
||||
return (
|
||||
<StyledContainer>
|
||||
<Image src={inviteSuccess} alt="" />
|
||||
<Image src="/imgs/invite-success.svg" alt="" />
|
||||
<Button
|
||||
type="primary"
|
||||
shape="round"
|
||||
@@ -56,7 +54,7 @@ const InvitePage: NextPageWithLayout = () => {
|
||||
if (inviteData?.accepted === false) {
|
||||
return (
|
||||
<StyledContainer>
|
||||
<Image src={inviteError} alt="" />
|
||||
<Image src="/imgs/invite-error.svg" alt="" />
|
||||
<Button
|
||||
shape="round"
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user