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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user