From 5bb1e1792e697797e9b33bba7c5c36e1934d40d9 Mon Sep 17 00:00:00 2001 From: Lea Renaux Date: Thu, 4 Jan 2024 13:40:49 +0100 Subject: [PATCH] wip referents --- .../CampaignPortal/CampaignPortal.css | 8 ++++ .../CampaignPortal/CampaignPortal.jsx | 39 ++++++++++++++++- src/components/CampaignPortal/Contacts.jsx | 43 ++++++++++++++----- 3 files changed, 79 insertions(+), 11 deletions(-) diff --git a/src/components/CampaignPortal/CampaignPortal.css b/src/components/CampaignPortal/CampaignPortal.css index 0453488..bffc9f8 100644 --- a/src/components/CampaignPortal/CampaignPortal.css +++ b/src/components/CampaignPortal/CampaignPortal.css @@ -2,6 +2,14 @@ width: 30%; } +.MailRow{ + background-color: white; +} + +.ContactRow{ + width: 100%; +} + .DatesLeftHeader{ width: 30%; } diff --git a/src/components/CampaignPortal/CampaignPortal.jsx b/src/components/CampaignPortal/CampaignPortal.jsx index fde6d41..9d31ac1 100644 --- a/src/components/CampaignPortal/CampaignPortal.jsx +++ b/src/components/CampaignPortal/CampaignPortal.jsx @@ -106,7 +106,44 @@ function CampaignPortal({ - + @@ -13,6 +13,11 @@ function Contacts({email}) { ); + + const primaryReferents = referents?.filter((referent) => referent.role === "PRIMARY"); + const secondaryReferents = referents?.filter((referent) => referent.role === "SECONDARY"); + + console.log(primaryReferents) return (
@@ -27,23 +32,41 @@ function Contacts({email}) { onClick={() => { window.location.assign(`mailto:${email}`); }} > {D.functionalBox} - {email} + {email} {D.cpos} - ChloƩ Dupont - - - 01 01 01 01 01 + {primaryReferents.map((primaryReferent) => { + return ( + + +
+ {primaryReferent.firstName || primaryReferent.lastName ? + `${primaryReferent.firstName ?? ""} ${primaryReferent.lastName ?? ""}` + : "-" + } +
+
+ {primaryReferent.phoneNumber ?? "-"} +
+ + + ) + })} - + {/* {D.deputyCpos} - Thierry Fabres + + {secondaryReferent.firstName || secondaryReferent.lastName ? + `${secondaryReferent.firstName ?? ""} ${secondaryReferent.lastName ?? ""}` + : "-" + } + - 02 01 01 01 01 - + {secondaryReferent && secondaryReferent.phoneNumber } + */}