From d0e603ee8436c4d304615afa305218586a2226d7 Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Mon, 14 Oct 2024 11:58:54 +0300 Subject: [PATCH] fix: add spacing around "/" and graysacale in check names Fixes #2189 --- src/components/Canary/renderers.tsx | 33 ++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/components/Canary/renderers.tsx b/src/components/Canary/renderers.tsx index fda97f7e3..787fcdc5d 100644 --- a/src/components/Canary/renderers.tsx +++ b/src/components/Canary/renderers.tsx @@ -131,10 +131,41 @@ export function CanaryCheckName({ title, isDeleted }: CanaryCheckNameProps) { + const hasSlash = title.includes("/"); + + if (hasSlash) { + const parts = title.split("/"); + return ( + <> + {icon && } + {parts.map((part, idx) => { + // if not last part + if (idx !== parts.length - 1) { + return ( + <> + + {part} + + / + + ); + } + // last part + return ( + + {part} + + ); + })} + {isDeleted && } + + ); + } + return ( <> {icon && } - {title} {isDeleted && } + {title} {isDeleted && } ); }