feat: update desc for empty page (#2710)

This commit is contained in:
Whitewater
2023-06-08 05:28:37 -07:00
committed by GitHub
parent 7ba5f82aef
commit ec99a0ce05
5 changed files with 94 additions and 10 deletions

View File

@@ -1,15 +1,17 @@
import type { CSSProperties } from 'react';
import type { CSSProperties, ReactNode } from 'react';
import { EmptySvg } from './empty-svg';
import { StyledEmptyContainer } from './style';
export type EmptyContentProps = {
containerStyle?: CSSProperties;
description?: string;
title?: ReactNode;
description?: ReactNode;
descriptionStyle?: CSSProperties;
};
export const Empty = ({
containerStyle,
title,
description,
descriptionStyle,
}: EmptyContentProps) => {
@@ -18,7 +20,22 @@ export const Empty = ({
<div style={{ color: 'var(--affine-black)' }}>
<EmptySvg />
</div>
<p style={{ marginTop: '30px', ...descriptionStyle }}>{description}</p>
{title && (
<p
style={{
marginTop: '30px',
color: 'var(--affine-text-primary-color)',
fontWeight: 700,
}}
>
{title}
</p>
)}
{description && (
<p style={{ marginTop: title ? '8px' : '30px', ...descriptionStyle }}>
{description}
</p>
)}
</StyledEmptyContainer>
);
};