mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
feat(core): add page group and display properties (#6228)
close TOV-23 https://github.com/toeverything/AFFiNE/assets/102217452/c05474de-b73c-40ab-9f18-cc43bb9fd828
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
AllPageListOperationsMenu,
|
||||
PageDisplayMenu,
|
||||
PageListNewPageButton,
|
||||
} from '@affine/core/components/page-list';
|
||||
import { Header } from '@affine/core/components/pure/header';
|
||||
@@ -32,15 +33,18 @@ export const AllPageHeader = ({
|
||||
/>
|
||||
}
|
||||
right={
|
||||
<PageListNewPageButton
|
||||
size="small"
|
||||
className={clsx(
|
||||
styles.headerCreateNewButton,
|
||||
!showCreateNew && styles.headerCreateNewButtonHidden
|
||||
)}
|
||||
>
|
||||
<PlusIcon />
|
||||
</PageListNewPageButton>
|
||||
<>
|
||||
<PageListNewPageButton
|
||||
size="small"
|
||||
className={clsx(
|
||||
styles.headerCreateNewButton,
|
||||
!showCreateNew && styles.headerCreateNewButtonHidden
|
||||
)}
|
||||
>
|
||||
<PlusIcon />
|
||||
</PageListNewPageButton>
|
||||
<PageDisplayMenu />
|
||||
</>
|
||||
}
|
||||
center={<WorkspaceModeFilterTab activeFilter={'docs'} />}
|
||||
/>
|
||||
|
||||
@@ -7,6 +7,7 @@ export const scrollContainer = style({
|
||||
export const headerCreateNewButton = style({
|
||||
transition: 'opacity 0.1s ease-in-out',
|
||||
});
|
||||
|
||||
export const headerCreateNewCollectionIconButton = style({
|
||||
padding: '4px 8px',
|
||||
fontSize: '16px',
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
useFilteredPageMetas,
|
||||
VirtualizedList,
|
||||
} from '@affine/core/components/page-list';
|
||||
import { pageHeaderColsDef } from '@affine/core/components/page-list/header-col-def';
|
||||
import { usePageHeaderColsDef } from '@affine/core/components/page-list/header-col-def';
|
||||
import { Header } from '@affine/core/components/pure/header';
|
||||
import { WindowsAppControls } from '@affine/core/components/pure/header/windows-app-controls';
|
||||
import { useBlockSuiteMetaHelper } from '@affine/core/hooks/affine/use-block-suite-meta-helper';
|
||||
@@ -60,6 +60,7 @@ export const TrashPage = () => {
|
||||
useBlockSuiteMetaHelper(docCollection);
|
||||
const { isPreferredEdgeless } = usePageHelper(docCollection);
|
||||
const t = useAFFiNEI18N();
|
||||
const pageHeaderColsDef = usePageHeaderColsDef();
|
||||
|
||||
const pageOperationsRenderer = useCallback(
|
||||
(item: ListItem) => {
|
||||
@@ -92,7 +93,7 @@ export const TrashPage = () => {
|
||||
}, []);
|
||||
const pageHeaderRenderer = useCallback(() => {
|
||||
return <ListTableHeader headerCols={pageHeaderColsDef} />;
|
||||
}, []);
|
||||
}, [pageHeaderColsDef]);
|
||||
return (
|
||||
<>
|
||||
<ViewHeaderIsland>
|
||||
@@ -104,7 +105,6 @@ export const TrashPage = () => {
|
||||
<VirtualizedList
|
||||
items={filteredPageMetas}
|
||||
rowAsLink
|
||||
groupBy={false}
|
||||
isPreferredEdgeless={isPreferredEdgeless}
|
||||
docCollection={currentWorkspace.docCollection}
|
||||
operationsRenderer={pageOperationsRenderer}
|
||||
|
||||
Reference in New Issue
Block a user