mirror of
https://github.com/zadam/trilium.git
synced 2025-12-04 14:34:24 +01:00
refactor(react/launch_bar): extract icon class
This commit is contained in:
parent
a83f20e454
commit
5f54e42a43
@ -7,7 +7,6 @@ import appContext from "../../components/app_context";
|
|||||||
import { escapeHtml, isCtrlKey } from "../../services/utils";
|
import { escapeHtml, isCtrlKey } from "../../services/utils";
|
||||||
import link_context_menu from "../../menus/link_context_menu";
|
import link_context_menu from "../../menus/link_context_menu";
|
||||||
import "./BookmarkButtons.css";
|
import "./BookmarkButtons.css";
|
||||||
import Icon from "../react/Icon";
|
|
||||||
import NoteLink from "../react/NoteLink";
|
import NoteLink from "../react/NoteLink";
|
||||||
|
|
||||||
const PARENT_NOTE_ID = "_lbBookmarks";
|
const PARENT_NOTE_ID = "_lbBookmarks";
|
||||||
@ -74,8 +73,8 @@ function BookmarkFolder({ note }: { note: FNote }) {
|
|||||||
|
|
||||||
return title && iconClass && (
|
return title && iconClass && (
|
||||||
<LaunchBarDropdownButton
|
<LaunchBarDropdownButton
|
||||||
|
icon={iconClass}
|
||||||
title={escapeHtml(title)}
|
title={escapeHtml(title)}
|
||||||
text={<Icon icon={iconClass} />}
|
|
||||||
>
|
>
|
||||||
<div className="bookmark-folder-widget">
|
<div className="bookmark-folder-widget">
|
||||||
<div className="parent-note">
|
<div className="parent-note">
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import ActionButton, { ActionButtonProps } from "../react/ActionButton";
|
import ActionButton, { ActionButtonProps } from "../react/ActionButton";
|
||||||
import Dropdown, { DropdownProps } from "../react/Dropdown";
|
import Dropdown, { DropdownProps } from "../react/Dropdown";
|
||||||
|
import Icon from "../react/Icon";
|
||||||
|
|
||||||
export interface LaunchBarWidgetProps {
|
export interface LaunchBarWidgetProps {
|
||||||
isHorizontalLayout: boolean;
|
isHorizontalLayout: boolean;
|
||||||
@ -16,12 +17,13 @@ export function LaunchBarActionButton(props: Omit<ActionButtonProps, "className"
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function LaunchBarDropdownButton({ children, ...props }: Pick<DropdownProps, "title" | "text" | "children">) {
|
export function LaunchBarDropdownButton({ children, icon, ...props }: Pick<DropdownProps, "title" | "children"> & { icon: string }) {
|
||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
className="right-dropdown-widget"
|
className="right-dropdown-widget"
|
||||||
buttonClassName="right-dropdown-button launcher-button"
|
buttonClassName="right-dropdown-button launcher-button"
|
||||||
hideToggleArrow
|
hideToggleArrow
|
||||||
|
text={<Icon icon={icon} />}
|
||||||
{...props}
|
{...props}
|
||||||
>{children}</Dropdown>
|
>{children}</Dropdown>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user