mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-10 03:53:37 -06: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">
|
||||
{notePath.map((item, index) => (
|
||||
<Fragment key={item}>
|
||||
<BreadcrumbItem notePath={item} />
|
||||
<BreadcrumbItem notePath={item} activeNotePath={noteContext?.notePath ?? ""} />
|
||||
{(index < notePath.length - 1 || note?.hasChildren()) &&
|
||||
<BreadcrumbSeparator notePath={item} activeNotePath={notePath[index+1]} noteContext={noteContext} />}
|
||||
</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");
|
||||
return (
|
||||
<NoteLink
|
||||
notePath={notePath}
|
||||
noPreview
|
||||
title={isRootNote ? "" : undefined}
|
||||
title={isRootNote && activeNotePath !== "root" ? "" : undefined}
|
||||
showNoteIcon={isRootNote}
|
||||
/>
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user