diff --git a/apps/client/src/widgets/Breadcrumb.tsx b/apps/client/src/widgets/Breadcrumb.tsx
index 1b3ae4888..a4874599d 100644
--- a/apps/client/src/widgets/Breadcrumb.tsx
+++ b/apps/client/src/widgets/Breadcrumb.tsx
@@ -13,10 +13,10 @@ export default function Breadcrumb() {
return (
- {notePath.map(item => (
+ {notePath.map((item, index) => (
-
+
))}
@@ -35,7 +35,7 @@ function BreadcrumbItem({ notePath }: { notePath: string }) {
)
}
-function BreadcrumbSeparator({ notePath, noteContext }: { notePath: string, noteContext: NoteContext | undefined }) {
+function BreadcrumbSeparator({ notePath, noteContext, activeNotePath }: { notePath: string, activeNotePath: string, noteContext: NoteContext | undefined }) {
return (
}
@@ -43,27 +43,29 @@ function BreadcrumbSeparator({ notePath, noteContext }: { notePath: string, note
buttonClassName="icon-action"
hideToggleArrow
>
-
+
)
}
-function BreadcrumbSeparatorDropdownContent({ notePath, noteContext }: { notePath: string, noteContext: NoteContext | undefined }) {
+function BreadcrumbSeparatorDropdownContent({ notePath, noteContext, activeNotePath }: { notePath: string, activeNotePath: string, noteContext: NoteContext | undefined }) {
const notePathComponents = notePath.split("/");
+ const notePathPrefix = notePathComponents.join("/"); // last item was removed already.
const parentNoteId = notePathComponents.length > 1 ? notePathComponents.pop() : "root";
const childNotes = useChildNotes(parentNoteId);
- const notePathPrefix = notePathComponents.join("/"); // last item was removed already.
return (
- {childNotes.map((note) => (
- -
+ {childNotes.map((note) => {
+ const childNotePath = `${notePathPrefix}/${note.noteId}`
+ return
-
noteContext?.setNote(`${notePathPrefix}/${note.noteId}`)}
+ onClick={() => noteContext?.setNote(childNotePath)}
+ checked={childNotePath === activeNotePath}
>{note.title}
- ))}
+ })}
)
}