add first open time for appo item and change component data, remove work time in location, add loading on links in page doctor list, fix bug search city and state in clinics page
This commit is contained in:
@@ -11,10 +11,22 @@ import CustomLoading from "./loading/Custom";
|
||||
import TextLoading from "./loading/Text";
|
||||
import CircularLoading from "./loading/Circular";
|
||||
import moment from "moment-jalaali";
|
||||
import { useState } from "react";
|
||||
|
||||
moment.loadPersian({ dialect: "persian-modern" });
|
||||
|
||||
function ItemDoctor({ doctor }) {
|
||||
function ItemDoctor({ doctor, doctors, setDoctors }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const handleLoading = () => {
|
||||
setDoctors((prevDoctors) =>
|
||||
prevDoctors.map((item) =>
|
||||
item.id === doctor.id
|
||||
? { ...item, loading: true }
|
||||
: { ...item, loading: false }
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<li className="p-4 relative rounded-lg bg-[#FFF] border border-[#EFEFEF]">
|
||||
{/* Detail Doctor */}
|
||||
@@ -93,9 +105,13 @@ function ItemDoctor({ doctor }) {
|
||||
<Link href={`/doctor/${doctor?.uuid}`}>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={handleLoading}
|
||||
loading={doctor?.loading}
|
||||
className="!p-[14px] !absolute !left-4 !bottom-4 !rounded-full !w-fit"
|
||||
>
|
||||
<ArrowLeftD />
|
||||
<div className={doctor && doctor.loading ? "opacity-0" : ""}>
|
||||
<ArrowLeftD />
|
||||
</div>
|
||||
</Button>
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user