From 1698c9a9a4d7800e9186cc25d2e4e0e033cfb4b2 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 2 Jan 2025 16:49:33 -0500 Subject: [PATCH] Update and fix colors --- .../dashboard/MiniRealtimeAnalytics.jsx | 9 +-- .../components/dashboard/MiniSalesChart.jsx | 62 +++++++++---------- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/dashboard/src/components/dashboard/MiniRealtimeAnalytics.jsx b/dashboard/src/components/dashboard/MiniRealtimeAnalytics.jsx index b862514..0b0b9b4 100644 --- a/dashboard/src/components/dashboard/MiniRealtimeAnalytics.jsx +++ b/dashboard/src/components/dashboard/MiniRealtimeAnalytics.jsx @@ -151,21 +151,22 @@ const MiniRealtimeAnalytics = () => { dataKey="minute" tickFormatter={(value) => value + "m"} className="text-xs" - tick={{ fill: "#BAE6FD" }} + tick={{ fill: "#e0f2fe" }} /> { if (active && payload && payload.length) { - const timestamp = new Date(payload[0].payload.timestamp); + const timestamp = payload[0].payload.timestamp; + const formattedTime = timestamp ? format(new Date(timestamp), "h:mm a") : "N/A"; return (

- {format(timestamp, "h:mm a")} + {formattedTime}

diff --git a/dashboard/src/components/dashboard/MiniSalesChart.jsx b/dashboard/src/components/dashboard/MiniSalesChart.jsx index 26a553c..acccd8c 100644 --- a/dashboard/src/components/dashboard/MiniSalesChart.jsx +++ b/dashboard/src/components/dashboard/MiniSalesChart.jsx @@ -102,8 +102,8 @@ const MiniStatCard = memo(({ {trend === "up" ? ( @@ -241,13 +241,13 @@ const MiniSalesChart = ({ className = "" }) => { previousValue={formatCurrency(summaryStats.prevRevenue, false)} trend={summaryStats.growth.revenue >= 0 ? "up" : "down"} trendValue={`${Math.abs(Math.round(summaryStats.growth.revenue))}%`} - colorClass="text-emerald-200" - titleClass="text-emerald-100 font-bold text-md" - descriptionClass="text-emerald-200 text-md font-semibold" + colorClass="text-rose-200" + titleClass="text-rose-100 font-bold text-md" + descriptionClass="text-rose-200 text-md font-semibold" icon={PiggyBank} - iconColor="text-emerald-900" - iconBackground="bg-emerald-300" - background="h-[150px] bg-gradient-to-br from-emerald-900 to-emerald-800" + iconColor="text-rose-900" + iconBackground="bg-rose-300" + background="h-[150px] bg-gradient-to-br from-rose-900 to-rose-800" onClick={() => toggleMetric('revenue')} active={visibleMetrics.revenue} /> @@ -257,27 +257,27 @@ const MiniSalesChart = ({ className = "" }) => { previousValue={summaryStats.prevOrders.toLocaleString()} trend={summaryStats.growth.orders >= 0 ? "up" : "down"} trendValue={`${Math.abs(Math.round(summaryStats.growth.orders))}%`} - colorClass="text-blue-200" - titleClass="text-blue-100 font-bold text-md" - descriptionClass="text-blue-200 text-md font-semibold" + colorClass="text-indigo-200" + titleClass="text-indigo-100 font-bold text-md" + descriptionClass="text-indigo-200 text-md font-semibold" icon={Truck} - iconColor="text-blue-900" - iconBackground="bg-blue-300" - background="h-[150px] bg-gradient-to-br from-blue-900 to-blue-800" + iconColor="text-indigo-900" + iconBackground="bg-indigo-300" + background="h-[150px] bg-gradient-to-br from-indigo-900 to-indigo-800" onClick={() => toggleMetric('orders')} active={visibleMetrics.orders} />
{/* Chart Card */} - + {loading ? ( ) : !data.length ? ( -
+
No sales data available
@@ -290,29 +290,29 @@ const MiniSalesChart = ({ className = "" }) => { - + {visibleMetrics.revenue && ( formatCurrency(value, false)} - className="text-[10px]" - tick={{ fill: "#E9D5FF" }} + className="text-xs" + tick={{ fill: "#f5f5f4" }} /> )} {visibleMetrics.orders && ( )} { if (active && payload && payload.length) { const timestamp = new Date(payload[0].payload.timestamp); return ( - + -

+

{timestamp.toLocaleDateString([], { weekday: "short", month: "short", @@ -333,10 +333,10 @@ const MiniSalesChart = ({ className = "" }) => { .filter(entry => visibleMetrics[entry.dataKey]) .map((entry, index) => (

- + {entry.name}: - + {entry.dataKey === 'revenue' ? formatCurrency(entry.value) : entry.value.toLocaleString()} @@ -354,9 +354,9 @@ const MiniSalesChart = ({ className = "" }) => { @@ -367,7 +367,7 @@ const MiniSalesChart = ({ className = "" }) => { type="monotone" dataKey="orders" name="Orders" - stroke="#38BDF8" + stroke="#6366f1" strokeWidth={2} dot={false} />