|
|
|
@ -6,6 +6,7 @@ import ButtonBetween from "../../../components/ButtonBetween"; |
|
|
|
|
|
|
|
|
|
function TransportDate({ transportDate, isMobile }) { |
|
|
|
|
const [activeDate, setActiveDate] = useState(transportDate?.times[0]); |
|
|
|
|
|
|
|
|
|
const Time = ({ time }) => { |
|
|
|
|
return isMobile ? ( |
|
|
|
|
<ButtonBetween |
|
|
|
@ -17,13 +18,24 @@ function TransportDate({ transportDate, isMobile }) { |
|
|
|
|
toggle={true} |
|
|
|
|
/> |
|
|
|
|
) : ( |
|
|
|
|
// <ButtonBetween
|
|
|
|
|
// item={time.time}
|
|
|
|
|
// status={"تکمیل ظرفیت"}
|
|
|
|
|
// width="100%"
|
|
|
|
|
// onClick={() => setActiveDate(time)}
|
|
|
|
|
// active={activeDate === time}
|
|
|
|
|
// toggle={true}
|
|
|
|
|
// />
|
|
|
|
|
<button |
|
|
|
|
className={`flex flex-col border border-solid items-center mx-1 px-3 py-4 rounded-md mt-4 relative transition-all duration-500 w-1/5 cursor-not-allowed ${ |
|
|
|
|
className={`flex flex-col border border-solid items-center mx-1 px-3 py-4 rounded-md mt-4 relative transition-all duration-500 w-1/5 ${ |
|
|
|
|
activeDate === time |
|
|
|
|
? "bg-blueC0 bg-opacity-5 border-blueC0 dark:bg-opacity-5" |
|
|
|
|
: "bg-grayF9 border-grayDB dark:bg-opacity-5" |
|
|
|
|
}`}
|
|
|
|
|
onClick={() => {}} |
|
|
|
|
onClick={() => setActiveDate(time)} |
|
|
|
|
active={activeDate === time} |
|
|
|
|
toggle={true} |
|
|
|
|
status={"تکمیل ظرفیت"} |
|
|
|
|
> |
|
|
|
|
<strong |
|
|
|
|
className={`text-tiny transition-all duration-500 dark:text-white ${ |
|
|
|
@ -44,27 +56,28 @@ function TransportDate({ transportDate, isMobile }) { |
|
|
|
|
</button> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return isMobile ? ( |
|
|
|
|
<section className="mt-0 w-full"> |
|
|
|
|
<strong className="font-bold text-green7B dark:text-white lg:text-tiny"> |
|
|
|
|
{/* <strong className="font-bold text-green7B dark:text-white lg:text-tiny"> |
|
|
|
|
زمان ارسال را انتخاب کنید |
|
|
|
|
</strong> |
|
|
|
|
<ul className="list-none p-0 m-0 flex flex-row justify-between flex-wrap w-full gap-4 mt-4"> |
|
|
|
|
{transportDate.times.map((time, index) => ( |
|
|
|
|
<Time time={time} key={index} /> |
|
|
|
|
))} |
|
|
|
|
</ul> |
|
|
|
|
</ul> */} |
|
|
|
|
</section> |
|
|
|
|
) : ( |
|
|
|
|
<section className="mt-1 w-full"> |
|
|
|
|
<strong className="font-medium dark:text-white"> |
|
|
|
|
{/* <strong className="font-medium dark:text-white"> |
|
|
|
|
زمان ارسال را انتخاب کنید |
|
|
|
|
</strong> |
|
|
|
|
<ul className="list-none p-0 m-0 flex flex-row flex-wrap w-full gap-2"> |
|
|
|
|
{transportDate.times.map((time, index) => ( |
|
|
|
|
<Time time={time} key={index} /> |
|
|
|
|
))} |
|
|
|
|
</ul> |
|
|
|
|
</ul> */} |
|
|
|
|
</section> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|