From ac8815d674e060ca9bfc329f7dabfec9272dad90 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Tue, 29 Jul 2025 10:46:17 +0530 Subject: [PATCH] In directory List view when only single email and phone number in list view but user can add multiple phone number and email ids. --- .../Directory/ListViewDirectory.jsx | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/components/Directory/ListViewDirectory.jsx b/src/components/Directory/ListViewDirectory.jsx index 801d9915..a216a3b0 100644 --- a/src/components/Directory/ListViewDirectory.jsx +++ b/src/components/Directory/ListViewDirectory.jsx @@ -15,6 +15,10 @@ const ListViewDirectory = ({ }) => { const { dirActions, setDirActions } = useDir(); + // Get the first email and phone number if they exist + const firstEmail = contact.contactEmails?.[0]; + const firstPhone = contact.contactPhones?.[0]; + return (
- {contact.contactEmails.length > 0 ? (contact.contactEmails?.map((email, index) => ( - + {firstEmail ? ( + - {email.emailAddress} + {firstEmail.emailAddress} - ))):(NA)} + ) : ( + NA + )}
- {contact.contactPhones?.length > 0 ? ( - contact.contactPhones?.map((phone, index) => ( - + {firstPhone ? ( + - {phone.phoneNumber} + {firstPhone.phoneNumber} - )) - ):(NA)} + ) : ( + NA + )}
@@ -88,12 +94,6 @@ const ListViewDirectory = ({ {contact.organization} - {/* - - {contact?.contactCategory?.name || "Other"} - - */} - {contact?.contactCategory?.name || "Other"} @@ -118,9 +118,10 @@ const ListViewDirectory = ({ )} {!IsActive && ( {