From e8f6298f930af262a1370cd3f8054ca9aeabcab7 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Wed, 26 Nov 2025 12:35:21 +0530 Subject: [PATCH] =?UTF-8?q?Clicking=20on=20Contact=20Name=20in=20Notes=20S?= =?UTF-8?q?hould=20Redirect=20to=20That=20Contact=E2=80=99s=20Detail=20Pag?= =?UTF-8?q?e=20in=20Directory=20(Web)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Directory/NoteCardDirectoryEditable.jsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/Directory/NoteCardDirectoryEditable.jsx b/src/components/Directory/NoteCardDirectoryEditable.jsx index bc6ff517..49eba918 100644 --- a/src/components/Directory/NoteCardDirectoryEditable.jsx +++ b/src/components/Directory/NoteCardDirectoryEditable.jsx @@ -9,6 +9,7 @@ import ConfirmModal from "../common/ConfirmModal"; // Make sure path is correct import "../common/TextEditor/Editor.css"; import GlobalModel from "../common/GlobalModel"; import { useActiveInActiveNote, useUpdateNote } from "../../hooks/useDirectory"; +import { useDirectoryContext } from "../../pages/Directory/DirectoryPage"; const NoteCardDirectoryEditable = ({ noteItem, @@ -22,14 +23,14 @@ const NoteCardDirectoryEditable = ({ const [isDeleting, setIsDeleting] = useState(false); const [isRestoring, setIsRestoring] = useState(false); const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); - const [open_contact, setOpen_contact] = useState(null); - const [isOpenModalNote, setIsOpenModalNote] = useState(false); const { mutate: UpdateNote, isPending: isUpatingNote } = useUpdateNote(() => setEditing(false) ); const { mutate: ActiveInactive, isPending: isUpdatingStatus } = useActiveInActiveNote(() => setIsDeleteModalOpen(false)); + const { setContactOpen } = useDirectoryContext(); + const handleUpdateNote = async () => { const payload = { @@ -45,12 +46,6 @@ const NoteCardDirectoryEditable = ({ ActiveInactive({ noteId: noteItem.id, noteStatus: !noteItem.isActive }); }; - const contactProfile = (contactId) => { - DirectoryRepository.GetContactProfile(contactId).then((res) => { - setOpen_contact(res?.data); - setIsOpenModalNote(true); - }); - }; const handleRestore = async () => { try { @@ -88,7 +83,9 @@ const NoteCardDirectoryEditable = ({
contactProfile(noteItem.contactId)} + onClick={() => + setContactOpen({ contact: { id: noteItem.contactId }, Open: true }) + } > {noteItem?.contactName} {" "} @@ -97,6 +94,7 @@ const NoteCardDirectoryEditable = ({
+