modified table column, if inactive contacts hide action column
This commit is contained in:
parent
385f08e752
commit
d9ce90e20e
@ -3,13 +3,16 @@ import Avatar from '../common/Avatar';
|
||||
import { getEmailIcon,getPhoneIcon } from './DirectoryUtils';
|
||||
|
||||
|
||||
const ListViewDirectory = ({ contact,setSelectedContact,setIsOpenModal,setOpen_contact,setIsOpenModalNote,IsDeleted}) => {
|
||||
const ListViewDirectory = ({IsActive, contact,setSelectedContact,setIsOpenModal,setOpen_contact,setIsOpenModalNote,IsDeleted}) => {
|
||||
return (
|
||||
<tr >
|
||||
<tr style={{background:`${!IsActive ? "#f8f6f6":""}`}} >
|
||||
<td className="text-start cursor-pointer" style={{width: '18%'}} colSpan={2} onClick={() =>
|
||||
{
|
||||
setIsOpenModalNote(true)
|
||||
if ( IsActive )
|
||||
{
|
||||
setIsOpenModalNote(true)
|
||||
setOpen_contact(contact)
|
||||
}
|
||||
}}>
|
||||
<div className="d-flex align-items-center">
|
||||
<Avatar
|
||||
@ -58,14 +61,16 @@ const ListViewDirectory = ({ contact,setSelectedContact,setIsOpenModal,setOpen_c
|
||||
</td>
|
||||
|
||||
{/* Actions */}
|
||||
<td className="align-middle text-center ">
|
||||
<i className='bx bx-edit bx-sm text-primary cursor-pointer' onClick={() =>
|
||||
{
|
||||
setSelectedContact( contact )
|
||||
setIsOpenModal(true)
|
||||
}}></i>
|
||||
<i className='bx bx-trash bx-sm text-danger cursor-pointer' onClick={()=> IsDeleted(contact.id)}></i>
|
||||
</td>
|
||||
{IsActive &&
|
||||
<td className="align-middle text-center ">
|
||||
<i className='bx bx-edit bx-sm text-primary cursor-pointer' onClick={() =>
|
||||
{
|
||||
setSelectedContact( contact )
|
||||
setIsOpenModal( true )
|
||||
}}></i>
|
||||
<i className='bx bx-trash bx-sm text-danger cursor-pointer' onClick={() => IsDeleted( contact.id )}></i>
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user