send city and state matched by domain in first request page /doctors, send data from field home page with key name, add link for name of doctor in /doctors page and active redirect linke to doctor item page
This commit is contained in:
@@ -23,16 +23,18 @@ function ItemDoctor({ doctor }) {
|
|||||||
<Image
|
<Image
|
||||||
width={72}
|
width={72}
|
||||||
height={72}
|
height={72}
|
||||||
src={doctor?.img[0]?.url}
|
|
||||||
alt="image-doctor"
|
alt="image-doctor"
|
||||||
|
src={doctor?.img[0]?.url}
|
||||||
className="object-contain w-[64px] md:w-[68px] lg:w-[72px] h-[64px] md:h-[68px] lg:h-[72px]"
|
className="object-contain w-[64px] md:w-[68px] lg:w-[72px] h-[64px] md:h-[68px] lg:h-[72px]"
|
||||||
/>
|
/>
|
||||||
</CircularLoading>
|
</CircularLoading>
|
||||||
<div className="flex flex-col items-start justify-center gap-2">
|
<div className="flex flex-col items-start justify-center gap-2">
|
||||||
<TextLoading width={90} height={15}>
|
<TextLoading width={90} height={15}>
|
||||||
<p className="text-[#3B3B3B] text-[14px] font-bold">
|
<Link href={`/doctor/${doctor?.uuid}`}>
|
||||||
{doctor?.name}
|
<p className="text-[#3B3B3B] text-[14px] font-bold">
|
||||||
</p>
|
{doctor?.name}
|
||||||
|
</p>
|
||||||
|
</Link>
|
||||||
</TextLoading>
|
</TextLoading>
|
||||||
<TextLoading width={120} height={15}>
|
<TextLoading width={120} height={15}>
|
||||||
<p className="text-[#616161] text-[14px] font-normal">
|
<p className="text-[#616161] text-[14px] font-normal">
|
||||||
@@ -89,10 +91,7 @@ function ItemDoctor({ doctor }) {
|
|||||||
<Link href={`/doctor/${doctor?.uuid}`}>
|
<Link href={`/doctor/${doctor?.uuid}`}>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
className={`!p-[14px] !absolute !left-4 !bottom-4 !rounded-full !w-fit
|
className="!p-[14px] !absolute !left-4 !bottom-4 !rounded-full !w-fit"
|
||||||
${!Number(doctor?.active)}
|
|
||||||
`}
|
|
||||||
disabled={!Number(doctor?.active)}
|
|
||||||
>
|
>
|
||||||
<ArrowLeftD />
|
<ArrowLeftD />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ async function Doctors({ searchParams }) {
|
|||||||
|
|
||||||
let doctors = null;
|
let doctors = null;
|
||||||
try {
|
try {
|
||||||
|
let newSearchParams = searchParams;
|
||||||
|
if (matchedCity) newSearchParams.city = matchedCity.name;
|
||||||
|
if (matchedState) newSearchParams.state = matchedState.name;
|
||||||
const params = buildDoctorParams(searchParams);
|
const params = buildDoctorParams(searchParams);
|
||||||
|
|
||||||
const response = await axios.get(`${API_URL}/api/v1/doctors`, {
|
const response = await axios.get(`${API_URL}/api/v1/doctors`, {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ function RedirectLink({ data }) {
|
|||||||
if (specialtyItem) {
|
if (specialtyItem) {
|
||||||
filters.specialty = specialtyItem.name;
|
filters.specialty = specialtyItem.name;
|
||||||
} else {
|
} else {
|
||||||
filters.search = data.search;
|
filters.name = data.search;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user