mirror of
https://github.com/zadam/trilium.git
synced 2025-12-21 14:54:24 +01:00
feat(breadcrumb): display workspace text
This commit is contained in:
parent
80b61a35a9
commit
441958028d
@ -40,6 +40,14 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn.root-note {
|
||||||
|
box-shadow: unset;
|
||||||
|
background: unset;
|
||||||
|
padding-inline: 0.5em;
|
||||||
|
color: inherit;
|
||||||
|
min-width: unset;
|
||||||
|
}
|
||||||
|
|
||||||
.dropdown-item span,
|
.dropdown-item span,
|
||||||
.dropdown-item strong,
|
.dropdown-item strong,
|
||||||
.breadcrumb-last-item {
|
.breadcrumb-last-item {
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import FNote from "../../entities/fnote";
|
|||||||
import link_context_menu from "../../menus/link_context_menu";
|
import link_context_menu from "../../menus/link_context_menu";
|
||||||
import froca from "../../services/froca";
|
import froca from "../../services/froca";
|
||||||
import ActionButton from "../react/ActionButton";
|
import ActionButton from "../react/ActionButton";
|
||||||
|
import Button from "../react/Button";
|
||||||
import Dropdown from "../react/Dropdown";
|
import Dropdown from "../react/Dropdown";
|
||||||
import { FormListItem } from "../react/FormList";
|
import { FormListItem } from "../react/FormList";
|
||||||
import { useChildNotes, useNote, useNoteLabel, useNoteProperty } from "../react/hooks";
|
import { useChildNotes, useNote, useNoteLabel, useNoteProperty } from "../react/hooks";
|
||||||
@ -62,10 +63,10 @@ function BreadcrumbRoot({ noteContext }: { noteContext: NoteContext | undefined
|
|||||||
const title = useNoteProperty(note, "title");
|
const title = useNoteProperty(note, "title");
|
||||||
|
|
||||||
return (note &&
|
return (note &&
|
||||||
<ActionButton
|
<Button
|
||||||
className="root-note"
|
className="root-note"
|
||||||
icon={note.getIcon()}
|
icon={note.getIcon()}
|
||||||
text={title ?? ""}
|
text={note.noteId !== "root" ? (title ?? "") : ""}
|
||||||
onClick={() => noteContext?.setNote(note.noteId)}
|
onClick={() => noteContext?.setNote(note.noteId)}
|
||||||
onContextMenu={(e) => {
|
onContextMenu={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import type { ComponentChildren, RefObject } from "preact";
|
import type { ComponentChildren, HTMLAttributes, RefObject } from "preact";
|
||||||
import type { CSSProperties } from "preact/compat";
|
|
||||||
import { useMemo } from "preact/hooks";
|
|
||||||
import { memo } from "preact/compat";
|
import { memo } from "preact/compat";
|
||||||
|
import { useMemo } from "preact/hooks";
|
||||||
|
|
||||||
import { CommandNames } from "../../components/app_context";
|
import { CommandNames } from "../../components/app_context";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
|
|
||||||
export interface ButtonProps {
|
export interface ButtonProps extends Pick<HTMLAttributes<HTMLButtonElement>, "className" | "style" | "onContextMenu"> {
|
||||||
name?: string;
|
name?: string;
|
||||||
/** Reference to the button element. Mostly useful for requesting focus. */
|
/** Reference to the button element. Mostly useful for requesting focus. */
|
||||||
buttonRef?: RefObject<HTMLButtonElement>;
|
buttonRef?: RefObject<HTMLButtonElement>;
|
||||||
@ -18,7 +18,6 @@ export interface ButtonProps {
|
|||||||
primary?: boolean;
|
primary?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
size?: "normal" | "small" | "micro";
|
size?: "normal" | "small" | "micro";
|
||||||
style?: CSSProperties;
|
|
||||||
triggerCommand?: CommandNames;
|
triggerCommand?: CommandNames;
|
||||||
title?: string;
|
title?: string;
|
||||||
}
|
}
|
||||||
@ -78,7 +77,7 @@ export function ButtonGroup({ children }: { children: ComponentChildren }) {
|
|||||||
<div className="btn-group" role="group">
|
<div className="btn-group" role="group">
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SplitButton({ text, icon, children, ...restProps }: {
|
export function SplitButton({ text, icon, children, ...restProps }: {
|
||||||
@ -103,7 +102,7 @@ export function SplitButton({ text, icon, children, ...restProps }: {
|
|||||||
{children}
|
{children}
|
||||||
</ul>
|
</ul>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Button;
|
export default Button;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user