change design and data list in doctor-item & handle component appointment in doctor-item & handle functionality date-picker & fix bug appointment page & add req get appointment list
This commit is contained in:
@@ -7,7 +7,7 @@ import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import React from "react";
|
||||
|
||||
function ItemAppointment({ turn, doctor, loading }) {
|
||||
function ItemAppointment({ turn, loading }) {
|
||||
return (
|
||||
<li
|
||||
key={turn.id}
|
||||
@@ -17,17 +17,19 @@ function ItemAppointment({ turn, doctor, loading }) {
|
||||
<span className="block w-full h-px bg-[#EFEFEF] my-4"></span>
|
||||
<div className="flex items-center justify-start gap-3">
|
||||
<CircularLoading width={56} height={56} loading={loading}>
|
||||
<Image src={doctor?.img} width={56} height={56} alt="doctor" />
|
||||
<Image src={turn?.img || ""} width={56} height={56} alt="doctor" />
|
||||
</CircularLoading>
|
||||
<div className="flex flex-col items-start justify-center gap-2">
|
||||
<TextLoading width={60} height={15} loading={loading}>
|
||||
<p className="text-[#3B3B3B] text-[14px] font-bold">
|
||||
{doctor?.name}
|
||||
</p>
|
||||
<p className="text-[#3B3B3B] text-[14px] font-bold">{turn?.name}</p>
|
||||
</TextLoading>
|
||||
<TextLoading width={65} height={15} loading={loading}>
|
||||
<p className="text-[#525252] text-[14px] font-medium">
|
||||
تخصص: {doctor?.expertise}
|
||||
تخصص:
|
||||
{turn?.expertise?.map(
|
||||
(item, idx) =>
|
||||
`${item.name} ${turn.expertise.length === idx + 1 ? "" : "|"} `
|
||||
)}
|
||||
</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
@@ -41,7 +43,7 @@ function ItemAppointment({ turn, doctor, loading }) {
|
||||
</p>
|
||||
</TextLoading>
|
||||
</div>
|
||||
<Link href={loading ? "#" : `/booking/${turn.id}`}>
|
||||
<Link href={loading ? "#" : `/appointment/${turn.id}`}>
|
||||
<Button
|
||||
variant="contained"
|
||||
className="!py-2 !px-3 xl:!px-6 gap-1"
|
||||
|
||||
@@ -1,24 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import turns from "@/data/turns.json";
|
||||
import { Button } from "@mui/material";
|
||||
import ItemAppointment from "./ItemAppointment";
|
||||
import ArrowLeftD from "@/components/icons/ArrowLeftD";
|
||||
import Link from "next/link";
|
||||
|
||||
function AppointmentList({ doctor, loading }) {
|
||||
const itemActive = turns[0];
|
||||
|
||||
function AppointmentList({ doctors, loading }) {
|
||||
return (
|
||||
<>
|
||||
<ul className="hidden sticky top-[122px] sm:top-[150px] mt:top-[178px] lg:top-[206px] lg:flex w-[38%] flex-col justify-start items-center gap-8">
|
||||
{[turns[0]].map((item) => (
|
||||
<ItemAppointment
|
||||
turn={item}
|
||||
key={item.id}
|
||||
doctor={doctor}
|
||||
loading={loading}
|
||||
/>
|
||||
{doctors?.map((item) => (
|
||||
<ItemAppointment turn={item} key={item.id} loading={loading} />
|
||||
))}
|
||||
</ul>
|
||||
<div
|
||||
@@ -26,9 +18,9 @@ function AppointmentList({ doctor, loading }) {
|
||||
border-solid bottom-0 right-0 w-full p-4 flex items-center justify-between"
|
||||
>
|
||||
<p className="text-[#05BA58] text-[11px] font-normal">
|
||||
اولین نوبت آزاد: {itemActive.first_free_turn}
|
||||
اولین نوبت آزاد: {doctors[0]?.free_turn}
|
||||
</p>
|
||||
<Link href={`/booking/${itemActive.id}`}>
|
||||
<Link href={`/appointment/${doctors[0]?.id}`}>
|
||||
<Button
|
||||
variant="contained"
|
||||
className="!py-2 !px-4 gap-1 !text-[14px] !font-medium"
|
||||
|
||||
@@ -56,7 +56,7 @@ function Share({ data }) {
|
||||
<p className="text-[#525252] text-[11px] md:text-[12px] lg:text-[14px] font-normal">
|
||||
شما می توانید این پزشک را با دیگران به اشتراک بگذارید:
|
||||
</p>
|
||||
<List data={data} hiddenRef={hiddenRef} />
|
||||
<List hiddenRef={hiddenRef} />
|
||||
</Box>
|
||||
</Modal>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@ function Title({ doctor }) {
|
||||
w-[40px] sm:w-[81px] md:w-[123px] lg:w-[164px]
|
||||
h-[40px] sm:h-[81px] md:h-[123px] lg:h-[164px]
|
||||
"
|
||||
src={doctor?.img}
|
||||
src={doctor?.img[0]?.url}
|
||||
alt="img-doctor"
|
||||
height={164}
|
||||
width={164}
|
||||
@@ -24,12 +24,16 @@ function Title({ doctor }) {
|
||||
<div className="flex flex-col items-center lg:items-start gap-[8px] lg:gap-[16px]">
|
||||
<TextLoading width={90} height={20}>
|
||||
<h1 className="text-[#3B3B3B] text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-bold">
|
||||
{doctor?.title}
|
||||
{doctor?.name}
|
||||
</h1>
|
||||
</TextLoading>
|
||||
<TextLoading width={100} height={20}>
|
||||
<h3 className="text-[#525252] text-[14px] md:text-[16px] font-medium">
|
||||
تخصص: {doctor?.expertise}
|
||||
تخصص:
|
||||
{doctor?.expertise?.map(
|
||||
(item, idx) =>
|
||||
`${item.name} ${doctor.expertise.length === idx + 1 ? "" : "|"} `
|
||||
)}
|
||||
</h3>
|
||||
</TextLoading>
|
||||
<div className="flex items-center justify-start gap-11">
|
||||
|
||||
@@ -49,7 +49,7 @@ function AboutDcotor({ doctor }) {
|
||||
<span className="w-2 h-2 bg-[#F17732] rounded-full"></span>
|
||||
<TextLoading width={70} height={18}>
|
||||
<h4 className="text-[#616161] text-[16px] font-normal text-nowrap">
|
||||
{item}
|
||||
{item.name}
|
||||
</h4>
|
||||
</TextLoading>
|
||||
</li>
|
||||
|
||||
@@ -59,7 +59,7 @@ function ModalAnswer({ doctor }) {
|
||||
multiline={true}
|
||||
title="نظر خود را بنویسید..."
|
||||
/>
|
||||
<Link href={`/booking/${doctor?.id}`} className="!mr-auto">
|
||||
<Link href={`/appointment/${doctor?.id}`} className="!mr-auto">
|
||||
<Button
|
||||
variant="contained"
|
||||
className="!py-2.5 !px-4 gap-1 !text-[14px] !font-medium !mt-[32px] !shadownon"
|
||||
|
||||
@@ -4,16 +4,19 @@ import Share from "./detailDoctor/Share";
|
||||
import CustomLoading from "@/app/component/loading/Custom";
|
||||
import Poster from "./poster";
|
||||
|
||||
function DoctorPage({ doctor }) {
|
||||
function DoctorPage({ doctor, doctors }) {
|
||||
return (
|
||||
<div className="pt-[92px] sm:pt-[120px] mt:pt-[148px] lg:pt-[176px] mt-[px] padding-responsive">
|
||||
<div className="flex items-center justify-between">
|
||||
<CustomLoading width={180} height={25}>
|
||||
<div className="flex items-center justify-start text-[14px] md:text-[16px] font-normal">
|
||||
<h2 className="text-[#9B9B9B] text-nowrap">
|
||||
متخصص {doctor?.expertise} {" >"}
|
||||
{doctor?.expertise?.map(
|
||||
(item, idx) =>
|
||||
`${item.name} ${doctor.expertise.length === idx + 1 ? ">" : "|"} `
|
||||
)}
|
||||
</h2>
|
||||
<p className="text-[#525252] text-nowrap mr-1">{doctor?.title}</p>
|
||||
<p className="text-[#525252] text-nowrap mr-1">{doctor?.name}</p>
|
||||
</div>
|
||||
</CustomLoading>
|
||||
<div className="flex lg:hidden">
|
||||
@@ -22,7 +25,7 @@ function DoctorPage({ doctor }) {
|
||||
</div>
|
||||
<div className="flex items-start justify-center gap-6 mt-[30px]">
|
||||
<DetailDoctor doctor={doctor} />
|
||||
<AppointmentList doctor={doctor} />
|
||||
<AppointmentList doctors={doctors} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ function Services({ data }) {
|
||||
{data?.specialties?.map((item, idx) => (
|
||||
<li key={idx} className="flex items-center justify-start gap-[4px]">
|
||||
<CircleOrangeSm />
|
||||
<p className="text-[16px] font-normal text-[#E7EEF6]">{item}</p>
|
||||
<p className="text-[16px] font-normal text-[#E7EEF6]">{item.name}</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
@@ -18,7 +18,11 @@ function Poster({ data }) {
|
||||
{data?.name}
|
||||
</p>
|
||||
<p className="text-[24px] mt-[20px] text-[#E7EEF6] font-bold">
|
||||
تخصص: {data?.expertise}
|
||||
تخصص:
|
||||
{data?.expertise?.map(
|
||||
(item, idx) =>
|
||||
`${item.name} ${data.expertise.length === idx + 1 ? "" : "|"} `
|
||||
)}
|
||||
</p>
|
||||
<Services data={data} />
|
||||
<Address data={data} />
|
||||
|
||||
Reference in New Issue
Block a user