feat(badges/content): detect icon pack

This commit is contained in:
Elian Doran 2026-02-14 09:19:46 +02:00
parent 5da9963f31
commit f3dccc0aec
No known key found for this signature in database
3 changed files with 18 additions and 1 deletions

View File

@ -202,6 +202,7 @@
--badge-share-background-color: #6b6b6b;
--badge-clipped-note-background-color: #2284c0;
--badge-execute-background-color: #7b47af;
--badge-icon-pack-background-color: rgb(228, 163, 44);
--note-icon-background-color: #4f4f4f;
--note-icon-color: white;
@ -322,4 +323,4 @@
.note-split.with-hue *::selection,
.quick-edit-dialog-wrapper.with-hue *::selection {
--selection-background-color: hsl(var(--custom-color-hue), 60%, 90%);
}
}

View File

@ -37,6 +37,7 @@
pointer-events: none;
}
}
&.icon-pack-badge { --color: var(--badge-icon-pack-background-color); }
min-width: 0;

View File

@ -19,6 +19,7 @@ export default function NoteBadges() {
<ShareBadge />
<ClippedNoteBadge />
<ExecuteBadge />
<IconPackBadge />
</div>
);
}
@ -147,3 +148,17 @@ export function SaveStatusBadge() {
/>
);
}
function IconPackBadge() {
const { note } = useNoteContext();
const isEnabledIconPack = useNoteLabelBoolean(note, "iconPack");
const isDisabledIconPack = useNoteLabelBoolean(note, "disabled:iconPack");
return ((isEnabledIconPack || isDisabledIconPack) &&
<Badge
className="icon-pack-badge"
icon="bx bx-package"
text="Icon pack"
/>
);
}