feat: add navigation path in quick search (#1920)

This commit is contained in:
Qi
2023-04-13 16:31:28 +08:00
committed by GitHub
parent f20a151e57
commit 7d64815aca
17 changed files with 450 additions and 47 deletions
+12 -1
View File
@@ -9,6 +9,8 @@ export type RenderProps = {
blockSuiteWorkspace: BlockSuiteWorkspace;
onClick?: (e: MouseEvent<HTMLDivElement>, node: PinboardNode) => void;
showOperationButton?: boolean;
// If true, the node will be rendered with path icon at start
asPath?: boolean;
};
export type NodeRenderProps = RenderProps & {
@@ -57,6 +59,7 @@ export function usePinboardData({
blockSuiteWorkspace,
onClick,
showOperationButton,
asPath,
}: {
metas: PageMeta[];
pinboardRender: PinboardNode['render'];
@@ -67,8 +70,16 @@ export function usePinboardData({
blockSuiteWorkspace,
onClick,
showOperationButton,
asPath,
}),
[blockSuiteWorkspace, metas, onClick, pinboardRender, showOperationButton]
[
asPath,
blockSuiteWorkspace,
metas,
onClick,
pinboardRender,
showOperationButton,
]
);
return {