Update and fix colors
This commit is contained in:
@@ -151,21 +151,22 @@ const MiniRealtimeAnalytics = () => {
|
||||
dataKey="minute"
|
||||
tickFormatter={(value) => value + "m"}
|
||||
className="text-xs"
|
||||
tick={{ fill: "#BAE6FD" }}
|
||||
tick={{ fill: "#e0f2fe" }}
|
||||
/>
|
||||
<YAxis
|
||||
className="text-xs"
|
||||
tick={{ fill: "#BAE6FD" }}
|
||||
tick={{ fill: "#e0f2fe" }}
|
||||
/>
|
||||
<Tooltip
|
||||
content={({ active, payload }) => {
|
||||
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 (
|
||||
<Card className="p-2 shadow-lg bg-sky-800 border-none">
|
||||
<CardContent className="p-0 space-y-1">
|
||||
<p className="font-medium text-sm text-sky-100 border-b border-sky-700 pb-1 mb-1">
|
||||
{format(timestamp, "h:mm a")}
|
||||
{formattedTime}
|
||||
</p>
|
||||
<div className="flex justify-between items-center text-sm">
|
||||
<span className="text-sky-200">
|
||||
|
||||
@@ -102,8 +102,8 @@ const MiniStatCard = memo(({
|
||||
<span
|
||||
className={`flex items-center gap-0 px-1 py-0.5 rounded-full ${
|
||||
trend === 'up'
|
||||
? 'text-sm bg-emerald-300 text-emerald-900'
|
||||
: 'text-sm bg-rose-300 text-rose-900'
|
||||
? 'text-sm font-bold bg-emerald-300 text-emerald-900'
|
||||
: 'text-sm font-bold bg-rose-300 text-rose-900'
|
||||
}`}
|
||||
>
|
||||
{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}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Chart Card */}
|
||||
<Card className="bg-gradient-to-br from-purple-900 to-purple-800 backdrop-blur-sm">
|
||||
<Card className="bg-gradient-to-br from-slate-700 to-slate-600 backdrop-blur-sm">
|
||||
{loading ? (
|
||||
<CardContent className="p-4">
|
||||
<SkeletonChart />
|
||||
</CardContent>
|
||||
) : !data.length ? (
|
||||
<CardContent className="p-4">
|
||||
<div className="flex items-center justify-center h-[200px] text-purple-200">
|
||||
<div className="flex items-center justify-center h-[200px] text-stone-200">
|
||||
<div className="text-center">
|
||||
<TrendingUp className="h-8 w-8 mx-auto mb-2" />
|
||||
<div className="text-sm">No sales data available</div>
|
||||
@@ -290,29 +290,29 @@ const MiniSalesChart = ({ className = "" }) => {
|
||||
<ResponsiveContainer width="100%" height="100%">
|
||||
<LineChart
|
||||
data={data}
|
||||
margin={{ top: 0, right: -30, left: -10, bottom: -10 }}
|
||||
margin={{ top: 0, right: -30, left: -5, bottom: -10 }}
|
||||
>
|
||||
<CartesianGrid strokeDasharray="3 3" className="stroke-purple-700" />
|
||||
<CartesianGrid strokeDasharray="3 3" className="stroke-stone-700" />
|
||||
<XAxis
|
||||
dataKey="timestamp"
|
||||
tickFormatter={formatXAxis}
|
||||
className="text-[10px]"
|
||||
tick={{ fill: "#E9D5FF" }}
|
||||
className="text-xs"
|
||||
tick={{ fill: "#f5f5f4" }}
|
||||
/>
|
||||
{visibleMetrics.revenue && (
|
||||
<YAxis
|
||||
yAxisId="revenue"
|
||||
tickFormatter={(value) => formatCurrency(value, false)}
|
||||
className="text-[10px]"
|
||||
tick={{ fill: "#E9D5FF" }}
|
||||
className="text-xs"
|
||||
tick={{ fill: "#f5f5f4" }}
|
||||
/>
|
||||
)}
|
||||
{visibleMetrics.orders && (
|
||||
<YAxis
|
||||
yAxisId="orders"
|
||||
orientation="right"
|
||||
className="text-[10px]"
|
||||
tick={{ fill: "#E9D5FF" }}
|
||||
className="text-xs"
|
||||
tick={{ fill: "#f5f5f4" }}
|
||||
/>
|
||||
)}
|
||||
<Tooltip
|
||||
@@ -320,9 +320,9 @@ const MiniSalesChart = ({ className = "" }) => {
|
||||
if (active && payload && payload.length) {
|
||||
const timestamp = new Date(payload[0].payload.timestamp);
|
||||
return (
|
||||
<Card className="p-2 shadow-lg bg-purple-800 border-none">
|
||||
<Card className="p-2 shadow-lg bg-stone-800 border-none">
|
||||
<CardContent className="p-0 space-y-1">
|
||||
<p className="font-medium text-sm text-purple-100 border-b border-purple-700 pb-1 mb-1">
|
||||
<p className="font-medium text-sm text-stone-100 border-b border-stone-700 pb-1 mb-1">
|
||||
{timestamp.toLocaleDateString([], {
|
||||
weekday: "short",
|
||||
month: "short",
|
||||
@@ -333,10 +333,10 @@ const MiniSalesChart = ({ className = "" }) => {
|
||||
.filter(entry => visibleMetrics[entry.dataKey])
|
||||
.map((entry, index) => (
|
||||
<div key={index} className="flex justify-between items-center text-sm">
|
||||
<span className="text-purple-200">
|
||||
<span className="text-stone-200">
|
||||
{entry.name}:
|
||||
</span>
|
||||
<span className="font-medium ml-4 text-purple-100">
|
||||
<span className="font-medium ml-4 text-stone-100">
|
||||
{entry.dataKey === 'revenue'
|
||||
? formatCurrency(entry.value)
|
||||
: entry.value.toLocaleString()}
|
||||
@@ -354,9 +354,9 @@ const MiniSalesChart = ({ className = "" }) => {
|
||||
<Line
|
||||
yAxisId="revenue"
|
||||
type="monotone"
|
||||
dataKey="revenue"
|
||||
dataKey="revenue"re
|
||||
name="Revenue"
|
||||
stroke="#A855F7"
|
||||
stroke="#f43f5e"
|
||||
strokeWidth={2}
|
||||
dot={false}
|
||||
/>
|
||||
@@ -367,7 +367,7 @@ const MiniSalesChart = ({ className = "" }) => {
|
||||
type="monotone"
|
||||
dataKey="orders"
|
||||
name="Orders"
|
||||
stroke="#38BDF8"
|
||||
stroke="#6366f1"
|
||||
strokeWidth={2}
|
||||
dot={false}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user