From 3aabb0facfacc4f8ec0a544c21ba0b0fbb177339 Mon Sep 17 00:00:00 2001 From: Dexter Date: Mon, 4 Apr 2022 09:22:44 +0100 Subject: [PATCH] fix incorrectly rendering indicators statuses --- libs/network-stats/src/components/table-row/table-row.tsx | 4 ++-- libs/ui-toolkit/src/utils/{intent.ts => intent.tsx} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename libs/ui-toolkit/src/utils/{intent.ts => intent.tsx} (97%) diff --git a/libs/network-stats/src/components/table-row/table-row.tsx b/libs/network-stats/src/components/table-row/table-row.tsx index 955824344..be26cf334 100644 --- a/libs/network-stats/src/components/table-row/table-row.tsx +++ b/libs/network-stats/src/components/table-row/table-row.tsx @@ -19,7 +19,7 @@ export const TableRow = ({ ? goodThreshold(value) ? TailwindIntents.Success : TailwindIntents.Danger - : TailwindIntents.Help, + : TailwindIntents.Highlight, [goodThreshold, value] ); return ( @@ -30,7 +30,7 @@ export const TableRow = ({ {formatter ? formatter(value) : defaultFieldFormatter(value)} - + diff --git a/libs/ui-toolkit/src/utils/intent.ts b/libs/ui-toolkit/src/utils/intent.tsx similarity index 97% rename from libs/ui-toolkit/src/utils/intent.ts rename to libs/ui-toolkit/src/utils/intent.tsx index 0c9e92bdb..c5618ef0a 100644 --- a/libs/ui-toolkit/src/utils/intent.ts +++ b/libs/ui-toolkit/src/utils/intent.tsx @@ -30,12 +30,12 @@ export const getIntentShadow = (intent?: Intent) => { }; export const getVariantBackground = (variant?: TailwindIntents) => { - return classNames({ + return { 'bg-intent-danger text-white': variant === TailwindIntents.Danger, 'bg-intent-warning text-black': variant === TailwindIntents.Warning, 'bg-intent-prompt text-black': variant === TailwindIntents.Prompt, 'bg-intent-success text-black': variant === TailwindIntents.Success, 'bg-intent-help text-white': variant === TailwindIntents.Help, 'bg-intent-highlight text-black': variant === TailwindIntents.Highlight, - }); + }; };