Skip to content

Commit 45b0668

Browse files
committed
🐛 fix coloring bug for arrows on main campaign stats data
1 parent ef1ec78 commit 45b0668

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

src/components/CampaignsStatsHighlights.tsx

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import { ArrowDownIcon, ArrowUpIcon } from '@heroicons/react/20/solid';
88
import { CampaignStatsData } from '@tincre/promo-types';
99
import { YouTubeIcon } from './YouTubeIcon';
10+
11+
const costBasedMetrics = ['CPM', 'CPC', 'CPV'];
1012
/* @ts-ignore */
1113
function classNames(...classes) {
1214
return classes.filter(Boolean).join(' ');
@@ -83,15 +85,29 @@ export function CampaignsStatsHighlights({
8385
)}
8486
>
8587
{item.changeType === 'increase' ? (
86-
<ArrowUpIcon
87-
className="h-3 w-3 flex-shrink-0 self-center text-green-600 dark:text-green-400"
88-
aria-hidden="true"
89-
/>
88+
!costBasedMetrics.includes(item.name) ? (
89+
<ArrowUpIcon
90+
className="h-5 w-5 flex-shrink-0 self-center text-green-600 dark:text-green-400"
91+
aria-hidden="true"
92+
/>
93+
) : (
94+
<ArrowDownIcon
95+
className="h-5 w-5 flex-shrink-0 self-center text-green-600 dark:text-green-400"
96+
aria-hidden="true"
97+
/>
98+
)
9099
) : item.changeType !== 'same' ? (
91-
<ArrowDownIcon
92-
className="h-3 w-3 flex-shrink-0 self-center text-red-600 dark:text-red-400"
93-
aria-hidden="true"
94-
/>
100+
!costBasedMetrics.includes(item.name) ? (
101+
<ArrowDownIcon
102+
className="h-5 w-5 flex-shrink-0 self-center text-red-600 dark:text-red-400"
103+
aria-hidden="true"
104+
/>
105+
) : (
106+
<ArrowUpIcon
107+
className="h-5 w-5 flex-shrink-0 self-center text-red-600 dark:text-red-400"
108+
aria-hidden="true"
109+
/>
110+
)
95111
) : null}
96112

97113
<span className="sr-only">

0 commit comments

Comments
 (0)