mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-08 12:45:55 +08:00
feat(core): add new doc button to collection page (#6423)
close TOV-64 You can add this document to the collection while creating a new document on the collection page. <img width="790" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/828f80af-a1a5-47c2-98c2-a574cf79052c">
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { usePageHelper } from '@affine/core/components/blocksuite/block-suite-page-list/utils';
|
||||
import {
|
||||
AllPageListOperationsMenu,
|
||||
PageDisplayMenu,
|
||||
@@ -22,7 +23,9 @@ export const AllPageHeader = ({
|
||||
onChangeFilters: (filters: Filter[]) => void;
|
||||
}) => {
|
||||
const workspace = useService(Workspace);
|
||||
|
||||
const { importFile, createEdgeless, createPage } = usePageHelper(
|
||||
workspace.docCollection
|
||||
);
|
||||
return (
|
||||
<Header
|
||||
left={
|
||||
@@ -40,6 +43,9 @@ export const AllPageHeader = ({
|
||||
styles.headerCreateNewButton,
|
||||
!showCreateNew && styles.headerCreateNewButtonHidden
|
||||
)}
|
||||
onCreateEdgeless={createEdgeless}
|
||||
onCreatePage={createPage}
|
||||
onImportFile={importFile}
|
||||
>
|
||||
<PlusIcon />
|
||||
</PageListNewPageButton>
|
||||
|
||||
Reference in New Issue
Block a user