mirror of
https://github.com/zadam/trilium.git
synced 2025-12-13 10:54:25 +01:00
feat(breadcrumb): show root title if it's the one active
This commit is contained in:
parent
223ba4643f
commit
1e5fcf635e
@ -15,7 +15,7 @@ export default function Breadcrumb() {
|
|||||||
<div className="breadcrumb">
|
<div className="breadcrumb">
|
||||||
{notePath.map((item, index) => (
|
{notePath.map((item, index) => (
|
||||||
<Fragment key={item}>
|
<Fragment key={item}>
|
||||||
<BreadcrumbItem notePath={item} />
|
<BreadcrumbItem notePath={item} activeNotePath={noteContext?.notePath ?? ""} />
|
||||||
{(index < notePath.length - 1 || note?.hasChildren()) &&
|
{(index < notePath.length - 1 || note?.hasChildren()) &&
|
||||||
<BreadcrumbSeparator notePath={item} activeNotePath={notePath[index+1]} noteContext={noteContext} />}
|
<BreadcrumbSeparator notePath={item} activeNotePath={notePath[index+1]} noteContext={noteContext} />}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@ -24,13 +24,13 @@ export default function Breadcrumb() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function BreadcrumbItem({ notePath }: { notePath: string }) {
|
function BreadcrumbItem({ notePath, activeNotePath }: { notePath: string, activeNotePath: string }) {
|
||||||
const isRootNote = (notePath === "root");
|
const isRootNote = (notePath === "root");
|
||||||
return (
|
return (
|
||||||
<NoteLink
|
<NoteLink
|
||||||
notePath={notePath}
|
notePath={notePath}
|
||||||
noPreview
|
noPreview
|
||||||
title={isRootNote ? "" : undefined}
|
title={isRootNote && activeNotePath !== "root" ? "" : undefined}
|
||||||
showNoteIcon={isRootNote}
|
showNoteIcon={isRootNote}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user