fix bug modal search location in home && send request after click on continue for update list clinics && change style on hover text of specialties and service in clinics page && add loading for list of clinics && fix bug page doctor item && link footer to clinic-pro
This commit is contained in:
@@ -7,7 +7,17 @@ import { Button } from "@mui/material";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
|
||||
function ItemClinic({ data, loading }) {
|
||||
function ItemClinic({ setFilteredClinics, data, loading }) {
|
||||
const handleLoading = () => {
|
||||
setFilteredClinics((prevClinics) =>
|
||||
prevClinics.map((item) =>
|
||||
item.id === data.id
|
||||
? { ...item, loading: true }
|
||||
: { ...item, loading: false }
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<li className="p-4 relative bg-[#FFF] border border-solid border-[#EFEFEF] rounded-[8px]">
|
||||
<div className="flex items-center justify-start gap-2">
|
||||
@@ -54,8 +64,14 @@ function ItemClinic({ data, loading }) {
|
||||
|
||||
{/* Arrow */}
|
||||
<Link href={`/clinic/${data.uuid}`}>
|
||||
<Button className="!bg-[#5559CE] !p-[14px] !absolute !left-4 !bottom-4 !rounded-full !w-fit">
|
||||
<ArrowLeftD />
|
||||
<Button
|
||||
onClick={handleLoading}
|
||||
loading={data?.loading}
|
||||
className="!bg-[#5559CE] !p-[14px] !absolute !left-4 !bottom-4 !rounded-full !w-fit"
|
||||
>
|
||||
<div className={data && data.loading ? "opacity-0" : ""}>
|
||||
<ArrowLeftD />
|
||||
</div>
|
||||
</Button>
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
@@ -40,7 +40,12 @@ function List({ limit, selected, clinics, pages, setFilteredClinics }) {
|
||||
gap-y-[16px] sm:gap-y-[24px] md:gap-y-[32px] lg:gap-y-[40px] mt-6"
|
||||
>
|
||||
{clinics.map((item) => (
|
||||
<ItemClinic loading={loading} data={item} key={item.id} />
|
||||
<ItemClinic
|
||||
data={item}
|
||||
key={item.id}
|
||||
loading={loading}
|
||||
setFilteredClinics={setFilteredClinics}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user