tag colors

This commit is contained in:
2025-11-17 16:49:32 +01:00
parent 61573431e3
commit 5fe11f18ac
5 changed files with 146 additions and 44 deletions
+9 -4
View File
@@ -380,6 +380,13 @@ const Sidebar: React.FC<SidebarProps> = ({
[activeTagIds],
);
const untaggedActive = untaggedFilterId ? activeTagSet.has(untaggedFilterId) : false;
const untaggedButtonClassName = ['badge', 'tag-chip', 'tag-chip--untagged', untaggedActive ? 'active' : null]
.filter(Boolean)
.join(' ');
const getTagChipClassName = (isActive: boolean) =>
['badge', 'tag-chip', isActive ? 'active' : null]
.filter(Boolean)
.join(' ');
const handleManageTags = useCallback(() => {
onManageTags?.();
}, [onManageTags]);
@@ -933,9 +940,7 @@ const Sidebar: React.FC<SidebarProps> = ({
<button
type="button"
role="listitem"
className={`sidebar-tag-pill sidebar-tag-pill--untagged${
untaggedActive ? ' active' : ''
}`}
className={untaggedButtonClassName}
onClick={() => handleToggleTag(untaggedFilterId)}
aria-pressed={untaggedActive}
draggable={false}
@@ -946,7 +951,7 @@ const Sidebar: React.FC<SidebarProps> = ({
{tags.map((tag) => {
const isActive = activeTagSet.has(tag.id);
const style = getTagColorStyle(tag.color);
const className = `sidebar-tag-pill${isActive ? ' active' : ''}`;
const className = getTagChipClassName(isActive);
return (
<button
key={tag.id}