From 21d496c324b025d907574076e4115919ba2e7f64 Mon Sep 17 00:00:00 2001
From: Pinapelz <yukais@pinapelz.com>
Date: Thu, 10 Oct 2024 02:01:35 -0700
Subject: add postive/negative symbol to diff stats on channel card

---
 src/components/ChannelCard/ChannelCard.tsx | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

(limited to 'src/components/ChannelCard/ChannelCard.tsx')

diff --git a/src/components/ChannelCard/ChannelCard.tsx b/src/components/ChannelCard/ChannelCard.tsx
index 5337b26..df7ccd0 100644
--- a/src/components/ChannelCard/ChannelCard.tsx
+++ b/src/components/ChannelCard/ChannelCard.tsx
@@ -77,7 +77,9 @@ const ChannelCard: React.FC<ChannelCardProps> = ({
                 </div>
                 <div>
                     <p className="text-lg sm:text-xl font-bold text-white">
-                        {diff_1d.toLocaleString()}
+                        {diff_1d > 0
+                            ? `+${diff_1d.toLocaleString()}`
+                            : diff_1d.toLocaleString()}
                     </p>
                     <p className="text-xs sm:text-sm text-gray-400">
                         24 Hour Change
@@ -85,7 +87,9 @@ const ChannelCard: React.FC<ChannelCardProps> = ({
                 </div>
                 <div>
                     <p className="text-lg sm:text-xl font-bold text-white">
-                        {diff_7d.toLocaleString()}
+                        {diff_7d > 0
+                            ? `+${diff_7d.toLocaleString()}`
+                            : diff_7d.toLocaleString()}
                     </p>
                     <p className="text-xs sm:text-sm text-gray-400">
                         7 Day Change
@@ -93,7 +97,9 @@ const ChannelCard: React.FC<ChannelCardProps> = ({
                 </div>
                 <div>
                     <p className="text-lg sm:text-xl font-bold text-white">
-                        {diff_30d.toLocaleString()}
+                        {diff_30d > 0
+                            ? `+${diff_30d.toLocaleString()}`
+                            : diff_30d.toLocaleString()}
                     </p>
                     <p className="text-xs sm:text-sm text-gray-400">
                         30 Day Change
-- 
cgit v1.2.3

