mirror of
https://github.com/zadam/trilium.git
synced 2026-01-06 14:44:25 +01:00
fix(breadcrumbs): last arrow not displayed on overflow menu
This commit is contained in:
parent
bd24cf68b6
commit
478c0e93f0
@ -35,7 +35,7 @@ const INITIAL_ITEMS = 2;
|
|||||||
const FINAL_ITEMS = 3;
|
const FINAL_ITEMS = 3;
|
||||||
|
|
||||||
export default function Breadcrumb() {
|
export default function Breadcrumb() {
|
||||||
const { note, notePath, notePaths, noteContext } = useNotePaths();
|
const { notePath, notePaths, noteContext } = useNotePaths();
|
||||||
const parentComponent = useContext(ParentComponent);
|
const parentComponent = useContext(ParentComponent);
|
||||||
const [ hideArchivedNotes ] = useTriliumOptionBool("hideArchivedNotes_main");
|
const [ hideArchivedNotes ] = useTriliumOptionBool("hideArchivedNotes_main");
|
||||||
const separatorProps: Omit<BreadcrumbSeparatorProps, "notePath" | "activeNotePath"> = { noteContext, hideArchivedNotes };
|
const separatorProps: Omit<BreadcrumbSeparatorProps, "notePath" | "activeNotePath"> = { noteContext, hideArchivedNotes };
|
||||||
@ -57,6 +57,7 @@ export default function Breadcrumb() {
|
|||||||
<BreadcrumbItem index={notePaths.length - FINAL_ITEMS + index} notePath={item} notePathLength={notePaths.length} noteContext={noteContext} parentComponent={parentComponent} />
|
<BreadcrumbItem index={notePaths.length - FINAL_ITEMS + index} notePath={item} notePathLength={notePaths.length} noteContext={noteContext} parentComponent={parentComponent} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
))}
|
))}
|
||||||
|
<BreadcrumbSeparator notePath={notePaths.at(-1)} {...separatorProps} />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
notePaths.map((item, index) => (
|
notePaths.map((item, index) => (
|
||||||
@ -179,8 +180,8 @@ function BreadcrumbItem({ index, notePath, noteContext, notePathLength, parentCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface BreadcrumbSeparatorProps {
|
interface BreadcrumbSeparatorProps {
|
||||||
notePath: string,
|
notePath: string | undefined,
|
||||||
activeNotePath: string,
|
activeNotePath?: string,
|
||||||
noteContext: NoteContext | undefined,
|
noteContext: NoteContext | undefined,
|
||||||
hideArchivedNotes: boolean;
|
hideArchivedNotes: boolean;
|
||||||
}
|
}
|
||||||
@ -201,7 +202,7 @@ function BreadcrumbSeparator(props: BreadcrumbSeparatorProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function BreadcrumbSeparatorDropdownContent({ notePath, noteContext, activeNotePath, hideArchivedNotes }: BreadcrumbSeparatorProps) {
|
function BreadcrumbSeparatorDropdownContent({ notePath, noteContext, activeNotePath, hideArchivedNotes }: BreadcrumbSeparatorProps) {
|
||||||
const notePathComponents = notePath.split("/");
|
const notePathComponents = (notePath ?? "").split("/");
|
||||||
const parentNoteId = notePathComponents.at(-1);
|
const parentNoteId = notePathComponents.at(-1);
|
||||||
const childNotes = useChildNotes(parentNoteId);
|
const childNotes = useChildNotes(parentNoteId);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user