From 95e580aff6dea71ab842a0ed39ddb1e4ca735fe6 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Wed, 10 Dec 2025 05:49:44 +0100 Subject: [PATCH] Refactor event date handling in EventsSection and PlayerStats components: Serialize event dates for consistent formatting and update date display to use localized string representation. Remove profile link from Navigation and integrate it into PlayerStats for improved user experience. --- app/page.tsx | 8 +++++++- components/EventsSection.tsx | 6 +++++- components/Navigation.tsx | 6 ------ components/PlayerStats.tsx | 37 ++++++++++++++++++++---------------- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 670f317..2674fd6 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -11,11 +11,17 @@ export default async function Home() { take: 3, }); + // Convert Date objects to strings for serialization + const serializedEvents = events.map((event) => ({ + ...event, + date: event.date.toISOString(), + })); + return (
- +
); } diff --git a/components/EventsSection.tsx b/components/EventsSection.tsx index e912c45..3bee3ed 100644 --- a/components/EventsSection.tsx +++ b/components/EventsSection.tsx @@ -25,7 +25,11 @@ export default function EventsSection({ events }: EventsSectionProps) {
- {event.date} + {new Date(event.date).toLocaleDateString("fr-FR", { + day: "numeric", + month: "long", + year: "numeric", + })}
{event.name} diff --git a/components/Navigation.tsx b/components/Navigation.tsx index c26d49f..a72e355 100644 --- a/components/Navigation.tsx +++ b/components/Navigation.tsx @@ -80,12 +80,6 @@ export default function Navigation({ {isAuthenticated ? ( <> - - PROFIL -