Skip to content

Commit

Permalink
Show identifier in category badges
Browse files Browse the repository at this point in the history
  • Loading branch information
woodwoerk committed Sep 20, 2023
1 parent 47c2065 commit 7d83923
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions components/actions/CategoryTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ type CategoryContentProps = {
noLink?: boolean;
};

const Identifier = styled.span`
color: ${(props) => props.theme.graphColors.grey060};
`;

export const CategoryContent = (props: CategoryContentProps) => {
const { categories, categoryType, noLink = false } = props;
return (
Expand All @@ -100,12 +104,20 @@ export const CategoryContent = (props: CategoryContentProps) => {
<BadgeTooltip
id={item.id}
tooltip={item.helpText}
content={item.name}
content={
item.identifier && !item.type.hideCategoryIdentifiers ? (
<>
<Identifier>{item.identifier}.</Identifier> {item.name}
</>
) : (
item.name
)
}
iconImage={
item.iconImage?.rendition.src ||
item.parent?.iconImage?.rendition.src
item.iconImage?.rendition?.src ||
item.parent?.iconImage?.rendition?.src
}
iconSvg={item.iconSvgUrl || item.parent?.iconSvgUrl}
iconSvg={item.iconSvgUrl || item.parent?.iconSvgUrl || undefined}
size="md"
color="neutralLight"
isLink={!noLink}
Expand Down

0 comments on commit 7d83923

Please sign in to comment.