UI Alignment and Icon Styling Issue in Contact Card Design in Directory. #292

Closed
kartik.sharma wants to merge 65 commits from Kartik_Bug#805 into Issues_July_4W
Showing only changes of commit cb2db46e21 - Show all commits

View File

@ -22,7 +22,10 @@ const NotesDirectory = ({
setProfileContact, setProfileContact,
}) => { }) => {
const [IsActive, setIsActive] = useState(true); const [IsActive, setIsActive] = useState(true);
const { contactNotes, refetch } = useContactNotes(contactProfile?.id, IsActive); const { contactNotes, refetch } = useContactNotes(
contactProfile?.id,
IsActive
);
const [IsSubmitting, setIsSubmitting] = useState(false); const [IsSubmitting, setIsSubmitting] = useState(false);
const [showEditor, setShowEditor] = useState(false); const [showEditor, setShowEditor] = useState(false);
@ -67,7 +70,10 @@ const NotesDirectory = ({
...cached_contactProfile.data, ...cached_contactProfile.data,
notes: [...(cached_contactProfile.data.notes || []), createdNote], notes: [...(cached_contactProfile.data.notes || []), createdNote],
}; };
cacheData("Contact Profile", { contactId: contactProfile?.id, data: updatedProfile }); cacheData("Contact Profile", {
contactId: contactProfile?.id,
data: updatedProfile,
});
} }
setValue("note", ""); setValue("note", "");
@ -98,10 +104,13 @@ const NotesDirectory = ({
}; };
// Use the fullName from contactProfile, which now includes middle and last names if available // Use the fullName from contactProfile, which now includes middle and last names if available
const contactName = contactProfile?.fullName || contactProfile?.firstName || "Contact"; const contactName =
contactProfile?.fullName || contactProfile?.firstName || "Contact";
const noNotesMessage = `Be the first to share your insights! ${contactName} currently has no notes.`; const noNotesMessage = `Be the first to share your insights! ${contactName} currently has no notes.`;
const notesToDisplay = IsActive ? (contactProfile?.notes || []) : (contactNotes || []); const notesToDisplay = IsActive
? contactProfile?.notes || []
: contactNotes || [];
return ( return (
<div className="text-start mt-10"> <div className="text-start mt-10">
@ -193,31 +202,28 @@ const NotesDirectory = ({
<p>Loading...</p>{" "} <p>Loading...</p>{" "}
</div> </div>
)} )}
{!isLoading && notesToDisplay.length > 0 ? ( {!isLoading && notesToDisplay.length > 0
notesToDisplay ? notesToDisplay
.slice() .slice()
.reverse() .reverse()
.map((noteItem) => ( .map((noteItem) => (
<NoteCardDirectory <NoteCardDirectory
refetchProfile={refetchProfile} refetchProfile={refetchProfile}
refetchNotes={refetch} refetchNotes={refetch}
refetchContact={refetch} refetchContact={refetch}
noteItem={noteItem} noteItem={noteItem}
contactId={contactProfile?.id} contactId={contactProfile?.id}
setProfileContact={setProfileContact} setProfileContact={setProfileContact}
key={noteItem.id} key={noteItem.id}
/> />
)) ))
) : ( : !isLoading &&
!isLoading && !showEditor && ( !showEditor && (
<div className="text-center mt-5"> <div className="text-center mt-5">{noNotesMessage}</div>
{noNotesMessage} )}
</div>
)
)}
</div> </div>
</div> </div>
); );
}; };
export default NotesDirectory; export default NotesDirectory;