Skip to content

Commit

Permalink
fix: add spacing around "/" and graysacale in check names
Browse files Browse the repository at this point in the history
Fixes #2189
  • Loading branch information
mainawycliffe authored and moshloop committed Oct 31, 2024
1 parent 22a4eec commit d0e603e
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/components/Canary/renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,41 @@ export function CanaryCheckName({
title,
isDeleted
}: CanaryCheckNameProps) {
const hasSlash = title.includes("/");

if (hasSlash) {
const parts = title.split("/");
return (
<>
{icon && <Icon name={icon} className="h-6 w-auto pr-1" />}
{parts.map((part, idx) => {
// if not last part
if (idx !== parts.length - 1) {
return (
<>
<span key={part} className="text-sm text-gray-500">
{part}
</span>
<span className="text-light px-0.5 text-gray-500">/</span>
</>
);
}
// last part
return (
<span key={part} className="text-sm">
{part}
</span>
);
})}
{isDeleted && <TbTrash />}
</>
);
}

return (
<>
{icon && <Icon name={icon} className="h-6 w-auto" />}
<span className="pl-1 text-sm">{title}</span> {isDeleted && <TbTrash />}
<span className="pl-1 text-sm">{title} </span> {isDeleted && <TbTrash />}
</>
);
}
Expand Down

0 comments on commit d0e603e

Please sign in to comment.