From 0d09bfda0411d2146c93cfb978124a0e40a0955f Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Fri, 23 May 2025 18:22:01 +0530 Subject: [PATCH] added in List view active or inactive contacts --- .../Directory/CardViewDirectory.jsx | 99 ++++++++++--------- 1 file changed, 55 insertions(+), 44 deletions(-) diff --git a/src/components/Directory/CardViewDirectory.jsx b/src/components/Directory/CardViewDirectory.jsx index 657f7353..a7fe7d32 100644 --- a/src/components/Directory/CardViewDirectory.jsx +++ b/src/components/Directory/CardViewDirectory.jsx @@ -1,13 +1,23 @@ import React from "react"; import Avatar from "../common/Avatar"; -import {getBucketNameById} from "./DirectoryUtils"; -import {useBuckets} from "../../hooks/useDirectory"; +import { getBucketNameById } from "./DirectoryUtils"; +import { useBuckets } from "../../hooks/useDirectory"; import { getPhoneIcon } from "./DirectoryUtils"; -const CardViewDirectory = ( {IsActive,contact, setSelectedContact, setIsOpenModal, setOpen_contact, setIsOpenModalNote, IsDeleted} ) => -{ - const {buckets} = useBuckets() +const CardViewDirectory = ({ + IsActive, + contact, + setSelectedContact, + setIsOpenModal, + setOpen_contact, + setIsOpenModalNote, + IsDeleted, +}) => { + const { buckets } = useBuckets(); return ( -
+
@@ -40,25 +50,23 @@ const CardViewDirectory = ( {IsActive,contact, setSelectedContact, setIsOpenModa >
    -
  • { - if (!IsActive) { - setSelectedContact(contact); - setIsOpenModal(true); - } - }} - style={{ - cursor: IsActive ? 'not-allowed' : 'pointer', - opacity: IsActive ? 0.6 : 1, - }} -> +
  • { + setSelectedContact(contact); + setIsOpenModal(true); + }} + + > Modify
  • - IsDeleted(contact.id)}> + IsDeleted(contact.id)} + > Delete @@ -69,23 +77,23 @@ const CardViewDirectory = ( {IsActive,contact, setSelectedContact, setIsOpenModa
    -
  • +
  • -
  • +
  • {contact.organization}
-
- { - if ( IsActive ) - { - - setIsOpenModalNote(true) - setOpen_contact(contact) - } - }}> +
{ + if (IsActive) { + setIsOpenModalNote(true); + setOpen_contact(contact); + } + }} + >
{contact.contactEmails[0] && (
    @@ -101,7 +109,11 @@ const CardViewDirectory = ( {IsActive,contact, setSelectedContact, setIsOpenModa {contact.contactPhones[0] && (
    • - +
    • {contact.contactPhones[0]?.phoneNumber} @@ -118,19 +130,18 @@ const CardViewDirectory = ( {IsActive,contact, setSelectedContact, setIsOpenModa
    -
      - {contact.bucketIds.map((bucketId) => ( - -
    • - -
    • -
    • - {getBucketNameById(buckets, bucketId)} -
    • -
      - ))} -
    - +
      + {contact.bucketIds.map((bucketId) => ( + +
    • + +
    • +
    • + {getBucketNameById(buckets, bucketId)} +
    • +
      + ))} +
);