From 0973086045e0533868c1d8e7eb6c58abab0ab7a0 Mon Sep 17 00:00:00 2001 From: Tuur Lievens Date: Wed, 27 Oct 2021 22:11:55 +0200 Subject: [PATCH 1/2] Display note path in search modal --- .../portal/search-modal/search-item.tsx | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/components/portal/search-modal/search-item.tsx b/components/portal/search-modal/search-item.tsx index c403e8978..109810555 100644 --- a/components/portal/search-modal/search-item.tsx +++ b/components/portal/search-modal/search-item.tsx @@ -6,6 +6,8 @@ import MarkText from 'components/portal/filter-modal/mark-text' import PortalState from 'libs/web/state/portal' import classNames from 'classnames' import useScrollView from 'libs/web/hooks/use-scroll-view' +import NoteTreeState from 'libs/web/state/tree' +import { Breadcrumbs } from '@material-ui/core' const SearchItem: FC<{ note: NoteCacheItem @@ -15,8 +17,10 @@ const SearchItem: FC<{ const { search: { close }, } = PortalState.useContainer() - const ref = useRef(null) + const { getPaths } = NoteTreeState.useContainer() + console.log(getPaths(note)) + const ref = useRef(null) useScrollView(ref, selected) return ( @@ -31,10 +35,25 @@ const SearchItem: FC<{

+ + {getPaths(note) + .reverse() + .map((path) => ( + + {path.title} + + ))} +

-