style(core): add page list header emptypage (#5162)
Co-authored-by: rakhee28 <rakhee@strings.ai>
This commit is contained in:
@@ -295,6 +295,7 @@ export const AllPage = () => {
|
|||||||
) : (
|
) : (
|
||||||
<EmptyPageList
|
<EmptyPageList
|
||||||
type="all"
|
type="all"
|
||||||
|
heading={<PageListHeader />}
|
||||||
blockSuiteWorkspace={currentWorkspace.blockSuiteWorkspace}
|
blockSuiteWorkspace={currentWorkspace.blockSuiteWorkspace}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Empty } from '@affine/component';
|
|||||||
import { Trans } from '@affine/i18n';
|
import { Trans } from '@affine/i18n';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import type { Workspace } from '@blocksuite/store';
|
import type { Workspace } from '@blocksuite/store';
|
||||||
import { useCallback } from 'react';
|
import { type ReactNode, useCallback } from 'react';
|
||||||
|
|
||||||
import { usePageHelper } from '../../components/blocksuite/block-suite-page-list/utils';
|
import { usePageHelper } from '../../components/blocksuite/block-suite-page-list/utils';
|
||||||
import * as styles from './page-list-empty.css';
|
import * as styles from './page-list-empty.css';
|
||||||
@@ -10,9 +10,11 @@ import * as styles from './page-list-empty.css';
|
|||||||
export const EmptyPageList = ({
|
export const EmptyPageList = ({
|
||||||
type,
|
type,
|
||||||
blockSuiteWorkspace,
|
blockSuiteWorkspace,
|
||||||
|
heading,
|
||||||
}: {
|
}: {
|
||||||
type: 'all' | 'trash' | 'shared' | 'public';
|
type: 'all' | 'trash' | 'shared' | 'public';
|
||||||
blockSuiteWorkspace: Workspace;
|
blockSuiteWorkspace: Workspace;
|
||||||
|
heading?: ReactNode;
|
||||||
}) => {
|
}) => {
|
||||||
const { createPage } = usePageHelper(blockSuiteWorkspace);
|
const { createPage } = usePageHelper(blockSuiteWorkspace);
|
||||||
const t = useAFFiNEI18N();
|
const t = useAFFiNEI18N();
|
||||||
@@ -56,6 +58,7 @@ export const EmptyPageList = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.pageListEmptyStyle}>
|
<div className={styles.pageListEmptyStyle}>
|
||||||
|
{heading && <div>{heading}</div>}
|
||||||
<Empty
|
<Empty
|
||||||
title={t['com.affine.emptyDesc']()}
|
title={t['com.affine.emptyDesc']()}
|
||||||
description={getEmptyDescription()}
|
description={getEmptyDescription()}
|
||||||
|
|||||||
Reference in New Issue
Block a user