add prettier formatter to all file
This commit is contained in:
@@ -1,26 +1,30 @@
|
||||
import { frequentSearches } from "@/constans"
|
||||
import { Button } from "@mui/material"
|
||||
import { frequentSearches } from "@/constans";
|
||||
import { Button } from "@mui/material";
|
||||
|
||||
function FrequentSearches() {
|
||||
return (
|
||||
<div className="flex items-center justify-center gap-[8px] sm:gap-[10px] md:gap-[13px] lg:gap-[16px] w-full lg:w-fit">
|
||||
<p className="text-[#3B3B3B] text-[16px] font-normal text-nowrap">جستجوهای پر تکرار:</p>
|
||||
<div className="overflow-auto hidden-scroll flex justify-start">
|
||||
<ul className="flex items-center justify-start gap-[14px] pl-[14px]">
|
||||
{frequentSearches.map((item, idx) => (
|
||||
<li key={idx}>
|
||||
<Button
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
className="!py-[6px] md:!py-[7px] lg:!py-[8px] !px-[12px] sm:!px-[14px] md:!px-[15px] lg:!px-[16px] !text-[12px] lg:!text-[14px]
|
||||
return (
|
||||
<div className="flex items-center justify-center gap-[8px] sm:gap-[10px] md:gap-[13px] lg:gap-[16px] w-full lg:w-fit">
|
||||
<p className="text-[#3B3B3B] text-[16px] font-normal text-nowrap">
|
||||
جستجوهای پر تکرار:
|
||||
</p>
|
||||
<div className="overflow-auto hidden-scroll flex justify-start">
|
||||
<ul className="flex items-center justify-start gap-[14px] pl-[14px]">
|
||||
{frequentSearches.map((item, idx) => (
|
||||
<li key={idx}>
|
||||
<Button
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
className="!py-[6px] md:!py-[7px] lg:!py-[8px] !px-[12px] sm:!px-[14px] md:!px-[15px] lg:!px-[16px] !text-[12px] lg:!text-[14px]
|
||||
!rounded-[4px] !shadow-none !font-normal !border !border-solid !border-[#D7D7D7] hover:!bg-[#EFEFEF]"
|
||||
>{item}</Button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
>
|
||||
{item}
|
||||
</Button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default FrequentSearches
|
||||
export default FrequentSearches;
|
||||
|
||||
@@ -4,58 +4,58 @@ import ModalSearchCity from "./modal";
|
||||
import SearchD from "@/components/icons/SearchD";
|
||||
|
||||
function SearchBar() {
|
||||
return (
|
||||
<ButtonGroup
|
||||
variant="contained"
|
||||
className="
|
||||
return (
|
||||
<ButtonGroup
|
||||
variant="contained"
|
||||
className="
|
||||
!py-[4px] sm:!py-[7px] md:!py-[10px] lg:!py-[12px] !gap-3
|
||||
!px-[4px] sm:!px-[8px] md:!px-[12px] lg:!px-[16px] !mt-[50px]
|
||||
!bg-[#FAFAFA] !transition-all !duration-500 !shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)] w-full lg:w-fit
|
||||
"
|
||||
>
|
||||
<ModalSearchCity />
|
||||
<span className="black w-px bg-[#EFEFEF]"></span>
|
||||
<TextField
|
||||
variant="standard"
|
||||
InputProps={{
|
||||
disableUnderline: true
|
||||
}}
|
||||
sx={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'center',
|
||||
'& .MuiInput-root': {
|
||||
padding: '0',
|
||||
borderBottom: 'none',
|
||||
},
|
||||
'& .MuiInputBase-input': {
|
||||
color: '#6C757D'
|
||||
}
|
||||
}}
|
||||
placeholder="جستجوی نام پزشک، تخصص، بیماری ..."
|
||||
dir='rtl'
|
||||
className={`!shadow-none !w-full lg:!w-[524px] bg-[#FAFAFA] !text-[14px] md:!text-[16px] !rounded-0 !font-normal !text-[#6C757D]`}
|
||||
/>
|
||||
<Button className="!hidden lg:!flex !rounded-[4px] !h-[40px] sm:!h-[42px] md:!h-[45px] lg:!h-[48px] !gap-2.5 !min-w-[114px]">
|
||||
<div className="min-w-[20px] min-h-[20px]">
|
||||
<Search />
|
||||
</div>
|
||||
<p>جستجو</p>
|
||||
</Button>
|
||||
<Button
|
||||
className="!flex lg:!hidden !rounded-[4px]
|
||||
>
|
||||
<ModalSearchCity />
|
||||
<span className="black w-px bg-[#EFEFEF]"></span>
|
||||
<TextField
|
||||
variant="standard"
|
||||
InputProps={{
|
||||
disableUnderline: true,
|
||||
}}
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
justifyContent: "center",
|
||||
"& .MuiInput-root": {
|
||||
padding: "0",
|
||||
borderBottom: "none",
|
||||
},
|
||||
"& .MuiInputBase-input": {
|
||||
color: "#6C757D",
|
||||
},
|
||||
}}
|
||||
placeholder="جستجوی نام پزشک، تخصص، بیماری ..."
|
||||
dir="rtl"
|
||||
className={`!shadow-none !w-full lg:!w-[524px] bg-[#FAFAFA] !text-[14px] md:!text-[16px] !rounded-0 !font-normal !text-[#6C757D]`}
|
||||
/>
|
||||
<Button className="!hidden lg:!flex !rounded-[4px] !h-[40px] sm:!h-[42px] md:!h-[45px] lg:!h-[48px] !gap-2.5 !min-w-[114px]">
|
||||
<div className="min-w-[20px] min-h-[20px]">
|
||||
<Search />
|
||||
</div>
|
||||
<p>جستجو</p>
|
||||
</Button>
|
||||
<Button
|
||||
className="!flex lg:!hidden !rounded-[4px]
|
||||
!w-[40px] sm:!w-[42px] md:!w-[45px] lg:!w-[48px]
|
||||
!h-[40px] sm:!h-[42px] md:!h-[45px] lg:!h-[48px]
|
||||
!min-w-[40px] sm:!min-w-[42px] md:!min-w-[45px] lg:!min-w-[48px]
|
||||
!min-h-[40px] sm:!min-h-[42px] md:!min-h-[45px] lg:!min-h-[48px]
|
||||
!gap-2.5 !p-2.5"
|
||||
>
|
||||
<div className="w-[24px] h-[24px] min-w-[24px] min-h-[24px]">
|
||||
<SearchD />
|
||||
</div>
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
)
|
||||
>
|
||||
<div className="w-[24px] h-[24px] min-w-[24px] min-h-[24px]">
|
||||
<SearchD />
|
||||
</div>
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
);
|
||||
}
|
||||
|
||||
export default SearchBar
|
||||
export default SearchBar;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
'use client';
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { Box, Button, Modal } from "@mui/material";
|
||||
@@ -12,100 +12,97 @@ import AutoCompleteSelect from "@/app/component/element/AutoCompleteSelect";
|
||||
import ArrowLeftM from "@/components/icons/ArrowLeftM";
|
||||
|
||||
function ModalSearchCity() {
|
||||
const states = [
|
||||
{ label: "تهران", id: 10 },
|
||||
{ label: "اصفهان", id: 20 },
|
||||
{ label: "مازندران", id: 30 },
|
||||
];
|
||||
|
||||
const states = [
|
||||
{ label: 'تهران', id: 10 },
|
||||
{ label: 'اصفهان', id: 20 },
|
||||
{ label: 'مازندران', id: 30 }
|
||||
];
|
||||
const cities = [
|
||||
{ label: "پردیس", id: 10 },
|
||||
{ label: "دماوند", id: 20 },
|
||||
{ label: "فیروزکوه", id: 30 },
|
||||
];
|
||||
|
||||
const cities = [
|
||||
{ label: 'پردیس', id: 10 },
|
||||
{ label: 'دماوند', id: 20 },
|
||||
{ label: 'فیروزکوه', id: 30 }
|
||||
];
|
||||
const [open, setOpen] = useState(false);
|
||||
const handleOpen = () => setOpen(true);
|
||||
const handleClose = () => setOpen(false);
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
const handleOpen = () => setOpen(true);
|
||||
const handleClose = () => setOpen(false);
|
||||
const [selected, setSelected] = useState({
|
||||
first: "",
|
||||
second: "",
|
||||
});
|
||||
|
||||
const [selected, setSelected] = useState({
|
||||
first: '',
|
||||
second: ''
|
||||
});
|
||||
const updateData = (event, name) =>
|
||||
setSelected({ ...selected, [name]: event.target.innerText });
|
||||
|
||||
const updateData = (event, name) =>
|
||||
setSelected({ ...selected, [name]: event.target.innerText })
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Button Modal */}
|
||||
<Button
|
||||
className="!border-none hover:!bg-transparent !py-[11.5px] !min-w-fit !px-[7px] sm:!py-3 sm:!px-[9px] md:!px-[11px] lg:!px-[12px] !rounded-3"
|
||||
onClick={handleOpen}
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
>
|
||||
<div className="min-w-[20px] min-h-[20px] hidden md:flex">
|
||||
<Location />
|
||||
</div>
|
||||
<p
|
||||
className={`text-[#616161] text-[11px] md:text-[14px] leading-[17px] sm:leading-[19px]
|
||||
return (
|
||||
<>
|
||||
{/* Button Modal */}
|
||||
<Button
|
||||
className="!border-none hover:!bg-transparent !py-[11.5px] !min-w-fit !px-[7px] sm:!py-3 sm:!px-[9px] md:!px-[11px] lg:!px-[12px] !rounded-3"
|
||||
onClick={handleOpen}
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
>
|
||||
<div className="min-w-[20px] min-h-[20px] hidden md:flex">
|
||||
<Location />
|
||||
</div>
|
||||
<p
|
||||
className={`text-[#616161] text-[11px] md:text-[14px] leading-[17px] sm:leading-[19px]
|
||||
md:leading-[22px] lg:leading-[24px] font-medium ml-1 md:mx-1
|
||||
${selected.first && selected.second ? '' : ''}`}
|
||||
>
|
||||
{selected.first && selected.second ?
|
||||
`${selected.first} | ${selected.second}` : 'انتخاب شهر'}
|
||||
</p>
|
||||
<div className="w-[16px] h-[16px] md:w-[18px] md:h-[18px] lg:w-[20px] lg:h-[20px] grid place-items-center">
|
||||
<ArrowBottomH />
|
||||
</div>
|
||||
</Button>
|
||||
{/* Content Modal */}
|
||||
<Modal
|
||||
open={open}
|
||||
onClose={handleClose}
|
||||
>
|
||||
<Box sx={styleDefault} className="!w-full !h-full md:!w-fit md:!h-fit">
|
||||
<div
|
||||
className="flex justify-end w-full"
|
||||
>
|
||||
<div className="cursor-pointer" onClick={handleClose}>
|
||||
<CloseModalD />
|
||||
</div>
|
||||
</div>
|
||||
<div className="md:p-[24px] pt-0">
|
||||
<p className="text-[#525252] mt-[38px] md:mt-4 text-[16px] font-medium text-center">شهر یا استان مورد نظر را انتخاب نمایید:</p>
|
||||
<div className="flex md:min-w-[344px] flex-col mt-[52px] md:mt-[44px] mb-14 justify-center items-center gap-10">
|
||||
<AutoCompleteSelect
|
||||
updateData={updateData}
|
||||
list={states}
|
||||
label='استان'
|
||||
name='first'
|
||||
/>
|
||||
<AutoCompleteSelect
|
||||
updateData={updateData}
|
||||
list={cities}
|
||||
name='second'
|
||||
label='شهر'
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full flex justify-end">
|
||||
<Button
|
||||
className="!w-full md:!w-fit !flex !px-3 items-center justify-center gap-1 mr-auto"
|
||||
onClick={handleClose}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
>
|
||||
تایید و ادامه
|
||||
<ArrowLeftM />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Box>
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
${selected.first && selected.second ? "" : ""}`}
|
||||
>
|
||||
{selected.first && selected.second
|
||||
? `${selected.first} | ${selected.second}`
|
||||
: "انتخاب شهر"}
|
||||
</p>
|
||||
<div className="w-[16px] h-[16px] md:w-[18px] md:h-[18px] lg:w-[20px] lg:h-[20px] grid place-items-center">
|
||||
<ArrowBottomH />
|
||||
</div>
|
||||
</Button>
|
||||
{/* Content Modal */}
|
||||
<Modal open={open} onClose={handleClose}>
|
||||
<Box sx={styleDefault} className="!w-full !h-full md:!w-fit md:!h-fit">
|
||||
<div className="flex justify-end w-full">
|
||||
<div className="cursor-pointer" onClick={handleClose}>
|
||||
<CloseModalD />
|
||||
</div>
|
||||
</div>
|
||||
<div className="md:p-[24px] pt-0">
|
||||
<p className="text-[#525252] mt-[38px] md:mt-4 text-[16px] font-medium text-center">
|
||||
شهر یا استان مورد نظر را انتخاب نمایید:
|
||||
</p>
|
||||
<div className="flex md:min-w-[344px] flex-col mt-[52px] md:mt-[44px] mb-14 justify-center items-center gap-10">
|
||||
<AutoCompleteSelect
|
||||
updateData={updateData}
|
||||
list={states}
|
||||
label="استان"
|
||||
name="first"
|
||||
/>
|
||||
<AutoCompleteSelect
|
||||
updateData={updateData}
|
||||
list={cities}
|
||||
name="second"
|
||||
label="شهر"
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full flex justify-end">
|
||||
<Button
|
||||
className="!w-full md:!w-fit !flex !px-3 items-center justify-center gap-1 mr-auto"
|
||||
onClick={handleClose}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
>
|
||||
تایید و ادامه
|
||||
<ArrowLeftM />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Box>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default ModalSearchCity
|
||||
export default ModalSearchCity;
|
||||
|
||||
Reference in New Issue
Block a user