Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(react/ribbon): note context menu button looking off
Elian Doran1eaac79d63b3
diff --git a/apps/client/src/widgets/react/Dropdown.tsx b/apps/client/src/widgets/react/Dropdown.tsxindex 3445bd832a..fbcd6a78e8 100644--- a/apps/client/src/widgets/react/Dropdown.tsx+++ b/apps/client/src/widgets/react/Dropdown.tsx@@ -13,12 +13,14 @@ export interface DropdownProps {dropdownContainerStyle?: CSSProperties;dropdownContainerClassName?: string;hideToggleArrow?: boolean;+ /** If set to true, then the dropdown button will be considered an icon action (without normal border and sized for icons only). */+ iconAction?: boolean;noSelectButtonStyle?: boolean;disabled?: boolean;text?: ComponentChildren;}-export default function Dropdown({ className, buttonClassName, isStatic, children, title, text, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, disabled, noSelectButtonStyle }: DropdownProps) {+export default function Dropdown({ className, buttonClassName, isStatic, children, title, text, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, iconAction, disabled, noSelectButtonStyle }: DropdownProps) {const dropdownRef = useRef<HTMLDivElement | null>(null);const triggerRef = useRef<HTMLButtonElement | null>(null);@@ -58,7 +60,7 @@ export default function Dropdown({ className, buttonClassName, isStatic, childrereturn (<div ref={dropdownRef} class={`dropdown ${className ?? ""}`} style={{ display: "flex" }}><button- className={`btn ${!noSelectButtonStyle ? "select-button" : ""} ${buttonClassName ?? ""} ${!hideToggleArrow ? "dropdown-toggle" : ""}`}+ className={`${iconAction ? "icon-action" : "btn"} ${!noSelectButtonStyle ? "select-button" : ""} ${buttonClassName ?? ""} ${!hideToggleArrow ? "dropdown-toggle" : ""}`}ref={triggerRef}type="button"data-bs-toggle="dropdown"diff --git a/apps/client/src/widgets/ribbon/NoteActions.tsx b/apps/client/src/widgets/ribbon/NoteActions.tsxindex 0ff40f85cf..f780eab8bf 100644--- a/apps/client/src/widgets/ribbon/NoteActions.tsx+++ b/apps/client/src/widgets/ribbon/NoteActions.tsx@@ -59,6 +59,7 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: NotclassName="note-actions"hideToggleArrownoSelectButtonStyle+ iconAction>{canBeConvertedToAttachment && <ConvertToAttachment note={note} /> }{note.type === "render" && <CommandItem command="renderActiveNote" icon="bx bx-extension" text={t("note_actions.re_render_note")} />}