Skip to content

Commit

Permalink
fix: permanent tag icons (#4804)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg authored Nov 6, 2024
1 parent 865b26b commit 57ad28c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frontend/web/components/tags/TagContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ function escapeHTML(unsafe: string) {
)
}

const renderIcon = (tagType: string, tagColor: string, tagLabel: string) => {
const renderIcon = (
tagType: string,
tagColor: string,
tagLabel: string,
isPermanent: boolean,
) => {
switch (tagType) {
case 'STALE':
return (
Expand Down Expand Up @@ -48,13 +53,13 @@ const renderIcon = (tagType: string, tagColor: string, tagLabel: string) => {
return
}
default:
return (
return isPermanent ? (
<IonIcon
className='ms-1'
icon={lockClosed}
color={color(tagColor).darken(0.1).string()}
/>
)
) : null
}
}

Expand Down Expand Up @@ -125,7 +130,7 @@ const TagContent: FC<TagContent> = ({ tag }) => {
})}
>
{tagLabel}
{renderIcon(tag.type!, tag.color!, tag.label!)}
{renderIcon(tag.type!, tag.color!, tag.label!, tag.is_permanent)}
</span>
}
>
Expand Down

0 comments on commit 57ad28c

Please sign in to comment.