Skip to content

Commit

Permalink
Fix permanent tag icons
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg committed Nov 5, 2024
1 parent dad864a commit 28f95b9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions frontend/web/components/tags/TagContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ function escapeHTML(unsafe: string) {
)
}

const renderIcon = (tagType: string, tagColor: string, tagLabel: string) => {
const renderIcon = (
tagType: string,
tagColor: string,
tagLabel: string,
isPermanent: boolean,
) => {
console.log(tagType, tagLabel)
switch (tagType) {
case 'STALE':
return (
Expand Down Expand Up @@ -48,13 +54,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 +131,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 28f95b9

Please sign in to comment.