From 26d1a7aada3ecea75df0112d684649bc00a8f488 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Sun, 17 Aug 2025 08:22:15 +0000 Subject: [PATCH] Update announcement cards to match task card design and add type icons Refactors the `AnnouncementCard` component to replicate the styling of the "To Do" task card, including icon placement next to titles, grey message text, square message corners, and right-aligned priority information with corresponding icons. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce/ZIhswcI --- client/src/components/AnnouncementCard.tsx | 76 +++++++++++++--------- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/client/src/components/AnnouncementCard.tsx b/client/src/components/AnnouncementCard.tsx index 2e482af..38bbd38 100644 --- a/client/src/components/AnnouncementCard.tsx +++ b/client/src/components/AnnouncementCard.tsx @@ -250,10 +250,27 @@ export default function AnnouncementCard() { } }; + const getTypeIcon = (type: string) => { + switch (type) { + case 'error': + return AlertTriangle; + case 'warning': + return Bell; + case 'success': + return CheckCircle; + case 'info': + default: + return Info; + } + }; + return ( - Informations +
+ + Informations +
{user?.role === 'admin' && ( { @@ -354,7 +371,6 @@ export default function AnnouncementCard() { )} -
@@ -369,35 +385,37 @@ export default function AnnouncementCard() {
{announcements.map((announcement) => { const priorityConfig = getPriorityConfig(announcement.type); - const PriorityIcon = priorityConfig.icon; + const TypeIcon = getTypeIcon(announcement.type); return ( -
-
-
-

- {announcement.title} -

- - - {priorityConfig.label} - -
- - {announcement.content && ( -

- {announcement.content} -

- )} - -
- - {safeFormat(safeDate(announcement.createdAt), 'dd/MM à HH:mm')} - - - {announcement.author.firstName} {announcement.author.lastName} - {announcement.group && ` • ${announcement.group.name}`} - +
+
+ +
+
+

+ {announcement.title} +

+ + {priorityConfig.label} + +
+ + {announcement.content && ( +

+ {announcement.content} +

+ )} + +
+ + {safeFormat(safeDate(announcement.createdAt), 'dd/MM à HH:mm')} + + + {announcement.author.firstName} {announcement.author.lastName} + {announcement.group && ` • ${announcement.group.name}`} + +
{user?.role === 'admin' && (