Skip to content

Commit 35fcfe9

Browse files
committed
refactor: replace inline styles with class-based color management in SuccessCell component
1 parent 133b88b commit 35fcfe9

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/modules/deals/SuccessCell.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,12 @@ export function SuccessCell({ deal }: { deal: Deal }) {
1515
const timeout = timeoutTimestamp && timeoutTimestamp < Date.now();
1616
let color;
1717
if (successRate === 1) {
18-
color = '#11B15E';
18+
color = 'text-success-foreground';
1919
} else if (!timeout) {
20-
color = '#F4C503';
20+
color = 'text-warning-foreground';
2121
} else {
22-
color = '#EF5353';
22+
color = 'text-danger-foreground';
2323
}
2424

25-
return (
26-
<div
27-
style={{
28-
color: color,
29-
}}
30-
>
31-
{successRate * 100}%
32-
</div>
33-
);
25+
return <div className={color}>{successRate * 100}%</div>;
3426
}

0 commit comments

Comments
 (0)