mirror of
https://github.com/zadam/trilium.git
synced 2025-12-29 02:34:25 +01:00
feat(note_icon): add message if no results
This commit is contained in:
parent
e57f1e6f23
commit
faa069b8a1
@ -771,7 +771,8 @@
|
||||
"filter": "Filter",
|
||||
"filter-none": "All icons",
|
||||
"filter-default": "Default icons",
|
||||
"icon_tooltip": "{{name}}\nIcon pack: {{iconPack}}"
|
||||
"icon_tooltip": "{{name}}\nIcon pack: {{iconPack}}",
|
||||
"no_results": "No icons found."
|
||||
},
|
||||
"basic_properties": {
|
||||
"note_type": "Note type",
|
||||
|
||||
@ -72,6 +72,14 @@ div.note-icon-widget {
|
||||
height: 1em;
|
||||
}
|
||||
|
||||
.note-icon-widget {
|
||||
.no-results {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
color: var(--muted-text-color);
|
||||
}
|
||||
}
|
||||
|
||||
body.experimental-feature-new-layout {
|
||||
.note-icon-widget button.note-icon {
|
||||
--input-focus-outline-color: var(--note-icon-hover-background-color);
|
||||
|
||||
@ -174,13 +174,17 @@ function NoteIconList({ note, dropdownRef }: {
|
||||
dropdownRef?.current?.hide();
|
||||
}}
|
||||
>
|
||||
{(iconData?.icons ?? []).map(({ id, terms, iconPack }) => (
|
||||
<span
|
||||
key={id}
|
||||
class={id}
|
||||
title={t("note_icon.icon_tooltip", { name: terms?.[0] ?? id, iconPack })}
|
||||
/>
|
||||
))}
|
||||
{iconData?.icons?.length ? (
|
||||
(iconData?.icons ?? []).map(({ id, terms, iconPack }) => (
|
||||
<span
|
||||
key={id}
|
||||
class={id}
|
||||
title={t("note_icon.icon_tooltip", { name: terms?.[0] ?? id, iconPack })}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
<div class="no-results">{t("note_icon.no_results")}</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user