feat: update Daily and Jira dashboard pages with dynamic titles and improved UI

- Implemented `getTodayTitle` and `getYesterdayTitle` functions in `DailyPageClient` to dynamically set section titles based on the current date.
- Updated `TODO.md` to mark completed tasks related to the Jira dashboard UI consistency.
- Enhanced card content in `JiraDashboardPageClient` to ensure charts are responsive and maintain consistent styling.
- Removed unused date formatting function in `DailySection` for cleaner code.
This commit is contained in:
Julien Froidefond
2025-09-21 10:49:39 +02:00
parent 4152b0bdfc
commit a0e2a78372
4 changed files with 147 additions and 100 deletions

View File

@@ -125,6 +125,26 @@ export function DailyPageClient({
return currentDate.toDateString() === today.toDateString();
};
const getTodayTitle = () => {
const today = new Date();
if (currentDate.toDateString() === today.toDateString()) {
return "🎯 Aujourd'hui";
}
return `🎯 ${currentDate.toLocaleDateString('fr-FR', { day: '2-digit', month: '2-digit', year: '2-digit' })}`;
};
const getYesterdayTitle = () => {
const today = new Date();
const yesterday = new Date(today);
yesterday.setDate(yesterday.getDate() - 1);
const yesterdayDate = getYesterdayDate();
if (yesterdayDate.toDateString() === yesterday.toDateString()) {
return "📋 Hier";
}
return `📋 ${yesterdayDate.toLocaleDateString('fr-FR', { day: '2-digit', month: '2-digit', year: '2-digit' })}`;
};
if (loading) {
return (
<div className="container mx-auto px-4 py-8">
@@ -217,7 +237,7 @@ export function DailyPageClient({
<div className="xl:col-span-2 grid grid-cols-1 lg:grid-cols-2 gap-6">
{/* Section Hier */}
<DailySection
title="📋 Hier"
title={getYesterdayTitle()}
date={getYesterdayDate()}
checkboxes={dailyView.yesterday}
onAddCheckbox={handleAddYesterdayCheckbox}
@@ -232,7 +252,7 @@ export function DailyPageClient({
{/* Section Aujourd'hui */}
<DailySection
title="🎯 Aujourd'hui"
title={getTodayTitle()}
date={getTodayDate()}
checkboxes={dailyView.today}
onAddCheckbox={handleAddTodayCheckbox}