add prettier formatter to all file
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
import { Button } from "@mui/material";
|
||||
|
||||
function Hours({ doctor, hour, setHour, value, nameHours }) {
|
||||
return (
|
||||
<ul
|
||||
className="grid grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-x-[16px] gap-y-[12px] sm:gap-y-[16px] md:gap-y-[20px] lg:gap-y-[24px] mt-[24px] mb-[40px]"
|
||||
>
|
||||
{doctor[nameHours[value]].map((item, idx) => (
|
||||
<li
|
||||
key={idx}
|
||||
>
|
||||
<Button
|
||||
onClick={() => setHour(idx)}
|
||||
disabled={!item.active}
|
||||
className={`
|
||||
return (
|
||||
<ul className="grid grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-x-[16px] gap-y-[12px] sm:gap-y-[16px] md:gap-y-[20px] lg:gap-y-[24px] mt-[24px] mb-[40px]">
|
||||
{doctor[nameHours[value]].map((item, idx) => (
|
||||
<li key={idx}>
|
||||
<Button
|
||||
onClick={() => setHour(idx)}
|
||||
disabled={!item.active}
|
||||
className={`
|
||||
!w-full !rounded-[8px] !bg-[#EFEFEF] !grid !place-items-center !py-[10px] !px-[14px] !h-[40px] md:!h-[42px] lg:!h-[44px]
|
||||
${idx === hour ? '!bg-[#F79463] ' : ''}
|
||||
${idx === hour ? "!bg-[#F79463] " : ""}
|
||||
`}
|
||||
>
|
||||
<p className={`
|
||||
>
|
||||
<p
|
||||
className={`
|
||||
text-[16px] font-semibold text-[#525252]
|
||||
${item.active ? 'text-[#525252]' : 'text-[#D7D7D7]'}
|
||||
${idx === hour ? '!text-[#FAFAFA] ' : ''}
|
||||
`}>{item.hour}</p>
|
||||
</Button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)
|
||||
${item.active ? "text-[#525252]" : "text-[#D7D7D7]"}
|
||||
${idx === hour ? "!text-[#FAFAFA] " : ""}
|
||||
`}
|
||||
>
|
||||
{item.hour}
|
||||
</p>
|
||||
</Button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
export default Hours;
|
||||
export default Hours;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
'use client';
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import Hours from "./Hours";
|
||||
@@ -6,11 +6,10 @@ import Tabs from "../../Tabs";
|
||||
import { Button } from "@mui/material";
|
||||
import ArrowLeftB from "@/components/icons/ArrowLeftB";
|
||||
|
||||
const listTab = ['صبح', 'بعد از ظهر'];
|
||||
const nameHours = ['hours_morning', 'hours_afternoon']
|
||||
const listTab = ["صبح", "بعد از ظهر"];
|
||||
const nameHours = ["hours_morning", "hours_afternoon"];
|
||||
|
||||
function DateTime({ doctor, setStep, setIsError, locateVisit }) {
|
||||
|
||||
const [value, setValue] = useState(0);
|
||||
const [hour, setHour] = useState(0);
|
||||
|
||||
@@ -21,21 +20,21 @@ function DateTime({ doctor, setStep, setIsError, locateVisit }) {
|
||||
<Tabs
|
||||
isSm={true}
|
||||
style={{
|
||||
'.MuiTabs-indicator': {
|
||||
height: '4px',
|
||||
borderRadius: '8px',
|
||||
background: '#F17732'
|
||||
".MuiTabs-indicator": {
|
||||
height: "4px",
|
||||
borderRadius: "8px",
|
||||
background: "#F17732",
|
||||
},
|
||||
'& .MuiTabs-flexContainer': {
|
||||
borderBottom: '2px solid #EFEFEF',
|
||||
marginBottom: '1px'
|
||||
"& .MuiTabs-flexContainer": {
|
||||
borderBottom: "2px solid #EFEFEF",
|
||||
marginBottom: "1px",
|
||||
},
|
||||
'& .mui-11pdt05-MuiButtonBase-root-MuiTab-root.Mui-selected': {
|
||||
color: '#F17732 !important'
|
||||
"& .mui-11pdt05-MuiButtonBase-root-MuiTab-root.Mui-selected": {
|
||||
color: "#F17732 !important",
|
||||
},
|
||||
"& .MuiButtonBase-root.Mui-selected": {
|
||||
color: "#F17732 !important",
|
||||
},
|
||||
'& .MuiButtonBase-root.Mui-selected': {
|
||||
color: '#F17732 !important'
|
||||
}
|
||||
}}
|
||||
value={value}
|
||||
listTab={listTab}
|
||||
@@ -53,8 +52,8 @@ function DateTime({ doctor, setStep, setIsError, locateVisit }) {
|
||||
className="!gap-[4px] !shadow-none !px-[12px] !py-[8px] md:!py-[9px] !w-full md:!w-fit !min-w-[157px]"
|
||||
onClick={() => {
|
||||
if (locateVisit) {
|
||||
localStorage.setItem('doctor-id', doctor?.id);
|
||||
setStep(prev => prev + 1);
|
||||
localStorage.setItem("doctor-id", doctor?.id);
|
||||
setStep((prev) => prev + 1);
|
||||
} else {
|
||||
setIsError(true);
|
||||
}
|
||||
@@ -66,7 +65,7 @@ function DateTime({ doctor, setStep, setIsError, locateVisit }) {
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default DateTime
|
||||
export default DateTime;
|
||||
|
||||
Reference in New Issue
Block a user