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
feat(note_icon): change design for icon reset button
Elian Doran736c69816d75
diff --git a/apps/client/src/widgets/note_icon.tsx b/apps/client/src/widgets/note_icon.tsxindex ed7a272c8d..e70f2ae20b 100644--- a/apps/client/src/widgets/note_icon.tsx+++ b/apps/client/src/widgets/note_icon.tsx@@ -9,7 +9,7 @@ import { useEffect, useRef, useState } from "preact/hooks";import FNote from "../entities/fnote";import attributes from "../services/attributes";import server from "../services/server";-import Button from "./react/Button";+import ActionButton from "./react/ActionButton";import Dropdown from "./react/Dropdown";import { FormDropdownDivider, FormListItem } from "./react/FormList";import FormTextBox from "./react/FormTextBox";@@ -119,6 +119,22 @@ function NoteIconList({ note, dropdownRef }: {autoFocus/>+ {getIconLabels(note).length > 0 && (+ <div style={{ textAlign: "center" }}>+ <ActionButton+ icon="bx bx-reset"+ text={t("note_icon.reset-default")}+ onClick={() => {+ if (!note) return;+ for (const label of getIconLabels(note)) {+ attributes.removeAttributeById(note.noteId, label.attributeId);+ }+ dropdownRef?.current?.hide();+ }}+ />+ </div>+ )}+{glob.iconRegistry.sources.length > 0 && <DropdownbuttonClassName="bx bx-filter-alt"hideToggleArrow@@ -146,23 +162,6 @@ function NoteIconList({ note, dropdownRef }: {dropdownRef?.current?.hide();}}>- {getIconLabels(note).length > 0 && (- <div style={{ textAlign: "center" }}>- <Button- text={t("note_icon.reset-default")}- onClick={() => {- if (!note) {- return;- }- for (const label of getIconLabels(note)) {- attributes.removeAttributeById(note.noteId, label.attributeId);- }- dropdownRef?.current?.hide();- }}- />- </div>- )}-{(iconData?.icons ?? []).map(({ id, terms }) => (<span key={id} class={id} title={terms[0]} />))}