client: add illustration when document auth error

This commit is contained in:
fantasticit 2022-05-30 17:51:04 +08:00
parent beb7642159
commit 990152b11c
1 changed files with 15 additions and 1 deletions

View File

@ -19,6 +19,7 @@ import { usePublicDocumentDetail } from 'data/document';
import { useDocumentStyle } from 'hooks/use-document-style'; import { useDocumentStyle } from 'hooks/use-document-style';
import { useMount } from 'hooks/use-mount'; import { useMount } from 'hooks/use-mount';
import { IsOnMobile } from 'hooks/use-on-mobile'; import { IsOnMobile } from 'hooks/use-on-mobile';
import { SecureDocumentIllustration } from 'illustrations/secure-document';
import Link from 'next/link'; import Link from 'next/link';
import React, { useCallback, useMemo, useRef } from 'react'; import React, { useCallback, useMemo, useRef } from 'react';
import { createPortal } from 'react-dom'; import { createPortal } from 'react-dom';
@ -92,7 +93,20 @@ export const DocumentPublicReader: React.FC<IProps> = ({ documentId, hideLogo =
); );
} }
// @ts-ignore // @ts-ignore
return <Text>{error.message || error || '未知错误'}</Text>; return (<div
style={{
margin: '10%',
display: 'flex',
justifyContent: 'center',
flexDirection: 'column',
alignItems: 'center',
}}
>
<SecureDocumentIllustration />
<Text style={{ marginTop: 12 }} type="danger">
{(error && (error as Error).message) || '未知错误'}
</Text>
</div>);
} }
return ( return (