Skip to content

Commit

Permalink
added dropdown menu
Browse files Browse the repository at this point in the history
  • Loading branch information
RamadanCRaji committed Oct 17, 2023
1 parent 0840e41 commit caed7b5
Showing 1 changed file with 59 additions and 29 deletions.
88 changes: 59 additions & 29 deletions client/components/client/ClientCard.jsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,62 @@
import React from 'react'
import { EllipsisHorizontalIcon, PhoneIcon, EnvelopeIcon, MapPinIcon } from '@heroicons/react/24/outline'
import React, { useState } from "react";
import {
EllipsisHorizontalIcon,
PhoneIcon,
EnvelopeIcon,
MapPinIcon,
} from "@heroicons/react/24/outline";
const ClientCard = ({ client }) => {
return (
<section className="client-card">
<div>
<div className="flex justify-between">
<h3 className="">{client.businessName}</h3>
<EllipsisHorizontalIcon className="h-8 w-8 text-accent stroke-1 hover:stroke-2 cursor-pointer" />
</div>
<hr />
<span className="text-sm italic">{client.businessType}</span>
<div className="client-contact">
<div className="contact-info-group">
<PhoneIcon className="contact-icon me-4" />
<p className="text-base">{client.phone}</p>
</div>
<div className="contact-info-group">
<EnvelopeIcon className="contact-icon me-4" />
<p className="text-base">{client.email}</p>
</div>
<div className="contact-info-group">
<MapPinIcon className="contact-icon me-4" />
<p className="text-base">{client.address}</p>
</div>
</div>
const [isOpen, setisOpen] = useState(false);
return (
<section className="client-card">
<div>
<div className="relative flex justify-between">
<h3 className="">{client.name}</h3>
<EllipsisHorizontalIcon
className="h-8 w-8 cursor-pointer stroke-1 text-accent hover:stroke-2"
onClick={() => setisOpen(!isOpen)}
/>
{isOpen && (
<div className="w-40 z-[1] border-secondary rounded-lg absolute left-full mt-2 origin-top-right rounded-md bg-primary shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none shadow">
<a className="group flex items-center px-4 py-2 text-sm text-CCCFD2-700 hover:bg-[rgb(205,213,224,0.1)] hover:text-white hover:rounded-lg">
{" "}
<span>add outreach</span>
</a>
<a className="group flex items-center px-4 py-2 text-sm text-CCCFD2-700 hover:bg-[rgb(205,213,224,0.1)] hover:text-white hover:rounded-lg">
{" "}
<span>edit</span>
</a>
<a className="group flex items-center px-4 py-2 text-sm text-CCCFD2-700 hover:bg-[rgb(205,213,224,0.1)] hover:text-white hover:rounded-lg">
{" "}
<span>archive</span>
</a>
<a className="group flex items-center px-4 py-2 text-sm text-CCCFD2-700 hover:bg-[rgb(205,213,224,0.1)] hover:text-white hover:rounded-lg">
{" "}
<span>delete</span>
</a>
</div>
</section>
)
}
)}
</div>

export default ClientCard
<hr />
<span className="text-sm italic">{client.businessType}</span>
<div className="client-contact">
<div className="contact-info-group">
<PhoneIcon className="contact-icon me-4" />
<p className="text-base">{client.phone}</p>
</div>
<div className="contact-info-group">
<EnvelopeIcon className="contact-icon me-4" />
<p className="text-base">{client.email}</p>
</div>
<div className="contact-info-group">
<MapPinIcon className="contact-icon me-4" />
<p className="text-base">{client.address}</p>
</div>
</div>
</div>
</section>
);
};

export default ClientCard;

0 comments on commit caed7b5

Please sign in to comment.