fix(doctors): improve filter performance and resolve modal closing issues
This commit is contained in:
@@ -3,7 +3,6 @@ import { Button } from "@mui/material";
|
||||
// Icon
|
||||
import CloseModalD from "@/components/icons/CloseModalD";
|
||||
import ArrowLeftM from "@/components/icons/ArrowLeftM";
|
||||
import { useState } from "react";
|
||||
import AddressSelector from "./AddressSelector";
|
||||
import { getStateInfoClient } from "@/lib/getStateInfoClient";
|
||||
|
||||
@@ -16,14 +15,10 @@ function Content({
|
||||
setDataInURL,
|
||||
filteredCities,
|
||||
}) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const { matchedState } = getStateInfoClient();
|
||||
const handleClick = () => {
|
||||
setLoading(true);
|
||||
sendReq().finally(() => {
|
||||
setLoading(false);
|
||||
handleClose();
|
||||
});
|
||||
handleClose();
|
||||
sendReq();
|
||||
};
|
||||
|
||||
const updateData = (name, value) => {
|
||||
@@ -74,12 +69,11 @@ function Content({
|
||||
</div>
|
||||
<div className="w-full flex justify-end">
|
||||
<Button
|
||||
disabled={loading}
|
||||
disabled={!filter?.city || !filter?.state}
|
||||
className="!w-full md:!w-fit !flex !px-3 items-center justify-center gap-1 mr-auto"
|
||||
onClick={handleClick}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
disabled={!filter?.city || !filter?.state}
|
||||
>
|
||||
تایید و ادامه
|
||||
<ArrowLeftM />
|
||||
|
||||
Reference in New Issue
Block a user