feat: integrate emoji-mart and refactor emoji usage

- Added @emoji-mart/data and @emoji-mart/react dependencies for enhanced emoji support.
- Replaced static emoji characters with Emoji component in various UI components for consistency and improved rendering.
- Updated generateDateTitle function to return an object with emoji and text for better structure.
- Marked the task for removing emojis from the UI as complete in TODO.md.
This commit is contained in:
Julien Froidefond
2025-10-05 20:29:46 +02:00
parent 7490c38d55
commit 714f8ccd5e
54 changed files with 568 additions and 340 deletions

View File

@@ -123,3 +123,4 @@ export function validateCustomAvatarUrl(url: string): boolean {
return false
}
}

View File

@@ -251,16 +251,16 @@ export function formatDateSmart(date: Date): string {
/**
* Génère un titre intelligent pour une date (avec emojis)
*/
export function generateDateTitle(date: Date, emoji: string = '📅'): string {
export function generateDateTitle(date: Date, emoji: string = '📅'): { emoji: string; text: string } {
if (isToday(date)) {
return `${emoji} Aujourd'hui`;
return { emoji, text: 'Aujourd\'hui' };
}
if (isYesterday(date)) {
return `${emoji} Hier`;
return { emoji, text: 'Hier' };
}
return `${emoji} ${formatDateShort(date)}`;
return { emoji, text: formatDateShort(date) };
}
/**

View File

@@ -66,3 +66,4 @@ export async function checkGravatarExists(email: string): Promise<boolean> {
return false
}
}

View File

@@ -14,7 +14,7 @@ export interface SortOption {
label: string;
field: SortField;
direction: SortDirection;
icon: string;
iconName: string;
}
// Configuration des options de tri disponibles
@@ -24,63 +24,63 @@ export const SORT_OPTIONS: SortOption[] = [
label: 'Priorité (Urgente → Faible)',
field: 'priority',
direction: 'desc',
icon: '🔥'
iconName: 'flame'
},
{
key: 'priority-asc',
label: 'Priorité (Faible → Urgente)',
field: 'priority',
direction: 'asc',
icon: '🔵'
iconName: 'circle'
},
{
key: 'tags-asc',
label: 'Tags (A → Z)',
field: 'tags',
direction: 'asc',
icon: '🏷️'
iconName: 'tag'
},
{
key: 'title-asc',
label: 'Titre (A → Z)',
field: 'title',
direction: 'asc',
icon: '📝'
iconName: 'file-text'
},
{
key: 'title-desc',
label: 'Titre (Z → A)',
field: 'title',
direction: 'desc',
icon: '📝'
iconName: 'file-text'
},
{
key: 'createdAt-desc',
label: 'Date création (Récent → Ancien)',
field: 'createdAt',
direction: 'desc',
icon: '📅'
iconName: 'calendar'
},
{
key: 'createdAt-asc',
label: 'Date création (Ancien → Récent)',
field: 'createdAt',
direction: 'asc',
icon: '📅'
iconName: 'calendar'
},
{
key: 'dueDate-asc',
label: 'Échéance (Proche → Lointaine)',
field: 'dueDate',
direction: 'asc',
icon: ''
iconName: 'clock'
},
{
key: 'dueDate-desc',
label: 'Échéance (Lointaine → Proche)',
field: 'dueDate',
direction: 'desc',
icon: ''
iconName: 'clock'
}
];