From 7ddcd7afb6eb3b28cda7bca02b121424c88482ff Mon Sep 17 00:00:00 2001 From: g Date: Mon, 12 Jan 2026 08:03:19 +0000 Subject: [PATCH] Update UI styles and dashboard product display Refined color scheme in AnimatedStatsSection to use indigo instead of pink, and improved gradient backgrounds. In dashboard/content.tsx, updated TopProduct price to support arrays and display revenue per product. UnifiedNotifications received minor style and layout adjustments for better consistency and usability. --- app/page.tsx | 2 +- components/animated-stats-section.tsx | 28 +++++------ components/dashboard/content.tsx | 11 ++-- .../notifications/UnifiedNotifications.tsx | 50 +++++++++---------- 4 files changed, 45 insertions(+), 46 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index ec2b261..733e6d8 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -13,7 +13,7 @@ export default async function Home() { const stats = await getPlatformStatsServer(); return ( -
+
diff --git a/components/animated-stats-section.tsx b/components/animated-stats-section.tsx index c7eafdd..d84616d 100644 --- a/components/animated-stats-section.tsx +++ b/components/animated-stats-section.tsx @@ -20,12 +20,12 @@ export function AnimatedStatsSection({ stats }: AnimatedStatsProps) { return (
-
+
- +
- @@ -38,14 +38,14 @@ export function AnimatedStatsSection({ stats }: AnimatedStatsProps) {

- +
-
+
- +
- @@ -58,14 +58,14 @@ export function AnimatedStatsSection({ stats }: AnimatedStatsProps) {

- +
-
+
- +
- diff --git a/components/dashboard/content.tsx b/components/dashboard/content.tsx index f8f9c62..50ca07b 100644 --- a/components/dashboard/content.tsx +++ b/components/dashboard/content.tsx @@ -25,7 +25,7 @@ interface ContentProps { interface TopProduct { id: string; name: string; - price: number; + price: number | number[]; image: string; count: number; revenue: number; @@ -73,7 +73,7 @@ export default function Content({ username, orderStats }: ContentProps) {

{greeting}, {username}!

-

+

"{randomQuote.text}" — {randomQuote.author}

@@ -181,14 +181,13 @@ export default function Content({ username, orderStats }: ContentProps) {

{product.name}

- £{(Number(product.price) || 0).toFixed(2)} - - ID: {product.id.slice(-6)} + £{(Number(Array.isArray(product.price) ? product.price[0] : product.price) || 0).toFixed(2)}
{product.count}
-
Units Sold
+
Units Sold
+
£{product.revenue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
))} diff --git a/components/notifications/UnifiedNotifications.tsx b/components/notifications/UnifiedNotifications.tsx index 1a8cfe0..c19eb6d 100644 --- a/components/notifications/UnifiedNotifications.tsx +++ b/components/notifications/UnifiedNotifications.tsx @@ -18,7 +18,7 @@ import { useNotifications } from "@/lib/notification-context"; export default function UnifiedNotifications() { const router = useRouter(); const [activeTab, setActiveTab] = useState("all"); - + // Get notification state from context const { unreadCounts, @@ -33,11 +33,11 @@ export default function UnifiedNotifications() { const handleChatClick = (chatId: string) => { router.push(`/dashboard/chats/${chatId}`); }; - + const handleOrderClick = (orderId: string) => { router.push(`/dashboard/orders/${orderId}`); }; - + // Format the price as currency const formatPrice = (price: number) => { return `£${price.toFixed(2)}`; @@ -49,8 +49,8 @@ export default function UnifiedNotifications() { - +
- All + All {totalNotifications > 0 && ( {totalNotifications} @@ -87,7 +87,7 @@ export default function UnifiedNotifications() { )} - + {totalNotifications === 0 ? (
@@ -102,7 +102,7 @@ export default function UnifiedNotifications() { Unread Messages
{Object.entries(unreadCounts.chatCounts).slice(0, 3).map(([chatId, count]) => ( - handleChatClick(chatId)} @@ -130,15 +130,15 @@ export default function UnifiedNotifications() { )} )} - + {/* Orders Section */} {newOrders.length > 0 && ( <>
New Paid Orders -
{newOrders.slice(0, 3).map((order) => ( - handleOrderClick(order._id)} @@ -178,7 +178,7 @@ export default function UnifiedNotifications() {
)} - + {unreadCounts.totalUnread === 0 ? (
@@ -188,7 +188,7 @@ export default function UnifiedNotifications() { <>
{Object.entries(unreadCounts.chatCounts).map(([chatId, count]) => ( - handleChatClick(chatId)} @@ -211,8 +211,8 @@ export default function UnifiedNotifications() { ))}
-
{newOrders.map((order) => ( - handleOrderClick(order._id)} @@ -267,8 +267,8 @@ export default function UnifiedNotifications() { ))}
-