diff --git a/apps/client/src/widgets/Breadcrumb.tsx b/apps/client/src/widgets/Breadcrumb.tsx index bf26fef04..1c4f6a4dc 100644 --- a/apps/client/src/widgets/Breadcrumb.tsx +++ b/apps/client/src/widgets/Breadcrumb.tsx @@ -1,11 +1,14 @@ import { Fragment } from "preact/jsx-runtime"; import "./Breadcrumb.css"; -import { useChildNotes, useNoteContext } from "./react/hooks"; +import { useChildNotes, useNoteContext, useNoteLabel, useNoteProperty, useStaticTooltip } from "./react/hooks"; import NoteLink from "./react/NoteLink"; import Dropdown from "./react/Dropdown"; import Icon from "./react/Icon"; import { FormListItem } from "./react/FormList"; import NoteContext from "../components/note_context"; +import ActionButton from "./react/ActionButton"; +import { useMemo } from "preact/hooks"; +import froca from "../services/froca"; export default function Breadcrumb() { const { note, noteContext } = useNoteContext(); @@ -15,7 +18,10 @@ export default function Breadcrumb() {
{notePath.map((item, index) => ( - + {index === 0 && notePath.length > 1 + ? + : + } {(index < notePath.length - 1 || note?.hasChildren()) && } @@ -24,6 +30,20 @@ export default function Breadcrumb() { ) } +function BreadcrumbRoot({ noteContext }: { noteContext: NoteContext | undefined }) { + const note = useMemo(() => froca.getNoteFromCache("root"), []); + useNoteLabel(note, "iconClass"); + const title = useNoteProperty(note, "title"); + + return (note && + noteContext?.setNote("root")} + /> + ) +} + function BreadcrumbItem({ notePath, activeNotePath }: { notePath: string, activeNotePath: string }) { const isRootNote = (notePath === "root"); return (