From 4e1d0d0101175c7ae6d0b5710aa7fa7e9eeaa4d9 Mon Sep 17 00:00:00 2001 From: alma Date: Tue, 6 May 2025 13:27:42 +0200 Subject: [PATCH] missions s3 --- app/missions/page.tsx | 173 +++++++++++++++++++++--------------------- 1 file changed, 88 insertions(+), 85 deletions(-) diff --git a/app/missions/page.tsx b/app/missions/page.tsx index d4d64da5..d7dd6554 100644 --- a/app/missions/page.tsx +++ b/app/missions/page.tsx @@ -200,96 +200,99 @@ export default function MissionsPage() { const niveauColor = getNiveauBadgeColor(mission.niveau); return ( -
-
- {/* Card Header with Logo and ODD */} -
-
- {mission.logo ? ( +
+ {/* Card Header with Name and Level */} +
+

{mission.name}

+ + {getNiveauLabel(mission.niveau)} + +
+ + {/* Centered Logo */} +
+
+ {mission.logo ? ( + {mission.name} { + console.log("Logo failed to load:", mission.logo); + console.log("Full URL attempted:", mission.logo); + // If the image fails to load, show the fallback + (e.currentTarget as HTMLImageElement).style.display = 'none'; + // Show the fallback div + const fallbackDiv = e.currentTarget.parentElement?.querySelector('.logo-fallback'); + if (fallbackDiv) { + (fallbackDiv as HTMLElement).style.display = 'flex'; + } + }} + /> + ) : null} +
+ {mission.name.slice(0, 2).toUpperCase()} +
+
+
+ + {/* Card Content */} +
+
+
+ Type: + {getMissionTypeLabel(mission.missionType)} +
+ +
+ Durée: + {getDuration(mission.projection)} +
+ +
+ Participation: + {getParticipationLabel(mission.participation)} +
+ + {mission.services && mission.services.length > 0 && ( +
+ Services: +
+ {mission.services.map(service => ( + + {service} + + ))} +
+
+ )} +
+
+ + {/* Card Footer */} +
+ + Créée le {formatDate(mission.createdAt)} + + +
+ {/* ODD scope icon */} + {oddInfo.number && ( +
{mission.name} { - console.log("Logo failed to load:", mission.logo); - console.log("Full URL attempted:", mission.logo); - // If the image fails to load, show the fallback - (e.currentTarget as HTMLImageElement).style.display = 'none'; - // Show the fallback div - const fallbackDiv = e.currentTarget.parentElement?.querySelector('.logo-fallback'); - if (fallbackDiv) { - (fallbackDiv as HTMLElement).style.display = 'flex'; - } + // Fallback if image fails to load + (e.target as HTMLImageElement).style.display = 'none'; }} /> - ) : null} -
- {mission.name.slice(0, 2).toUpperCase()}
-
-
-
- {oddInfo.number && ( -
- {oddInfo.label} { - // Fallback if image fails to load - (e.target as HTMLImageElement).style.display = 'none'; - }} - /> -
- )} - - {getNiveauLabel(mission.niveau)} - -
-

{mission.name}

-
-
- - {/* Card Content */} -
-
-
- Type: - {getMissionTypeLabel(mission.missionType)} -
- -
- Durée: - {getDuration(mission.projection)} -
- -
- Participation: - {getParticipationLabel(mission.participation)} -
- - {mission.services && mission.services.length > 0 && ( -
- Services: -
- {mission.services.map(service => ( - - {service} - - ))} -
-
- )} -
-
- - {/* Card Footer */} -
- - Créée le {formatDate(mission.createdAt)} - + )} +