Skip to content

Commit

Permalink
Highlight tag if it contains mature word
Browse files Browse the repository at this point in the history
  • Loading branch information
miko committed Jan 7, 2025
1 parent 0494b75 commit a7fc86a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/component/tag/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ type Props = {

export default function Tag(props: Props) {
const { name, onClick, type = 'link', disabled = false } = props;
const isMature = MATURE_TAGS.includes(name);
const isMature = name.split(' ').some((word) => {
return MATURE_TAGS.some((tag) => word === tag);
});
const clickProps = onClick ? { onClick } : { navigate: `/$/${PAGES.DISCOVER}?t=${encodeURIComponent(name)}` };

let title;
Expand Down

0 comments on commit a7fc86a

Please sign in to comment.