add prettier formatter to all file

This commit is contained in:
Ehsan
2024-09-25 11:03:44 +03:30
parent fa38ee2b21
commit eda896e917
410 changed files with 47636 additions and 43842 deletions
+37 -32
View File
@@ -1,36 +1,41 @@
import Field from '@/app/component/element/Field'
import { Button } from '@mui/material'
import Link from 'next/link'
import Field from "@/app/component/element/Field";
import { Button } from "@mui/material";
import Link from "next/link";
function LogInPage({ setIsSendMsg, setStep }) {
return (
<div className='rounded-[16px] mt-[64px] sm:mt-[53px] md:mt-[43px] lg:mt-[32px] border border-solid sm:border-[#EFEFEF] bg-transparent sm:bg-[#FFF]
p-0 border-transparent sm:p-[40px] sm:pb-[48px] w-full sm:w-fit sm:min-w-[425px]'>
<p className='text-[#525252] text-[18px] font-bold'>ورود یا ثبت نام در نوبت 724</p>
<p className='text-[#616161] text-[14px] mt-[40px] sm:mt-[43px] md:mt-[46px] lg:mt-[48px] font-normal'>شماره همراه خود را وارد نمایید.</p>
<div className='mt-[16px] sm:mt-[19px] md:mt-[22px] lg:mt-[24px] mb-[40px] sm:mb-[37px] md:mb-[36px] lg:mb-[32px]'>
<Field
type='number'
title='شماره همراه'
/>
</div>
<Button
fullWidth
variant='contained'
onClick={() => {
setIsSendMsg && setIsSendMsg(true);
setStep && setStep(prev => prev + 1);
}}
className='!rounded-[8px] !bg-[#5559CE] !py-[7.5px] md:!py-[8.5px] lg:!py-[10px]'
>ورود</Button>
<p className='text-[#525252] text-[14px] font-normal text-center mt-[49px] sm:mt-[58px] md:mt-[67px] lg:mt-[76px]'>
<Link href='/'>
<span className='text-[#F17732] underline'>قوانین استفاده</span>
</Link>{' '}
از نوبت 724 را می پذیرم.
</p>
</div>
)
return (
<div
className="rounded-[16px] mt-[64px] sm:mt-[53px] md:mt-[43px] lg:mt-[32px] border border-solid sm:border-[#EFEFEF] bg-transparent sm:bg-[#FFF]
p-0 border-transparent sm:p-[40px] sm:pb-[48px] w-full sm:w-fit sm:min-w-[425px]"
>
<p className="text-[#525252] text-[18px] font-bold">
ورود یا ثبت نام در نوبت 724
</p>
<p className="text-[#616161] text-[14px] mt-[40px] sm:mt-[43px] md:mt-[46px] lg:mt-[48px] font-normal">
شماره همراه خود را وارد نمایید.
</p>
<div className="mt-[16px] sm:mt-[19px] md:mt-[22px] lg:mt-[24px] mb-[40px] sm:mb-[37px] md:mb-[36px] lg:mb-[32px]">
<Field type="number" title="شماره همراه" />
</div>
<Button
fullWidth
variant="contained"
onClick={() => {
setIsSendMsg && setIsSendMsg(true);
setStep && setStep((prev) => prev + 1);
}}
className="!rounded-[8px] !bg-[#5559CE] !py-[7.5px] md:!py-[8.5px] lg:!py-[10px]"
>
ورود
</Button>
<p className="text-[#525252] text-[14px] font-normal text-center mt-[49px] sm:mt-[58px] md:mt-[67px] lg:mt-[76px]">
<Link href="/">
<span className="text-[#F17732] underline">قوانین استفاده</span>
</Link>{" "}
از نوبت 724 را می پذیرم.
</p>
</div>
);
}
export default LogInPage
export default LogInPage;
+111 -103
View File
@@ -1,4 +1,4 @@
import { useRef, useState } from "react"
import { useRef, useState } from "react";
import Link from "next/link";
import { Button } from "@mui/material";
@@ -10,120 +10,128 @@ import ArrowRightS from "../icons/ArrowRightS";
const time_resend_code = 120;
function SetCodePage({ setIsSendMsg, link, setStep }) {
const retryIcon = useRef();
const retryIcon = useRef();
const [timer, setTimer] = useState(0);
const [timer, setTimer] = useState(0);
const handleTimer = () => {
setTimer("loading");
setTimeout(() => {
setTimer(time_resend_code);
let timePresent = time_resend_code;
const timerInterval = setInterval(() => {
timePresent--;
setTimer(timePresent);
const handleTimer = () => {
setTimer('loading');
setTimeout(() => {
setTimer(time_resend_code);
let timePresent = time_resend_code;
const timerInterval = setInterval(() => {
timePresent--;
setTimer(timePresent);
!timePresent && clearInterval(timerInterval);
}, 1000);
}, 1000);
};
!timePresent && clearInterval(timerInterval)
}, 1000);
}, 1000);
}
const handleOTP = (e) => {
e.target.nextElementSibling && e.target.nextElementSibling.focus();
};
const handleOTP = (e) => {
e.target.nextElementSibling &&
e.target.nextElementSibling.focus()
}
return (
<div className='rounded-[16px] mt-[51px] sm:mt-[45px] md:mt-[39px] lg:mt-[32px] border border-solid sm:border-[#EFEFEF] bg-transparent sm:bg-[#FFF]
p-0 border-transparent sm:p-[40px] sm:pb-[48px] w-full sm:w-fit sm:min-w-[425px]'>
<div
className="cursor-pointer"
onClick={() => {
setStep && setStep(prev => prev - 1)
setIsSendMsg && setIsSendMsg(false)
}}
>
<ArrowRightS />
</div>
<p className='text-[#525252] mt-[10px] sm:mt-[12px] md:mt-[14px] lg:mt-[16px] text-[18px] font-bold'>کد تایید را وارد نمایید</p>
<p className='text-[#616161] mt-[16px] sm:mt-[19px] md:mt-[22px] lg:mt-[24px] text-[14px] font-normal text-right'>
کد تایید برای شماره 09013261200 ارسال شد.
</p>
<div className='mt-[26px] sm:mt-[28px] md:mt-[30px] lg:mt-[32px] mb-[56px] sm:mb-[47px] md:mb-[38px] lg:mb-[30px]'>
<div className="w-full mb-[27px] flex items-center justify-center gap-2 sm:gap-6" dir='ltr'>
<OTPForm handleOTP={handleOTP} />
<OTPForm handleOTP={handleOTP} />
<OTPForm handleOTP={handleOTP} />
<OTPForm handleOTP={handleOTP} />
<OTPForm handleOTP={handleOTP} />
</div>
{/* <Button className="flex items-center justify-start gap-1">
return (
<div
className="rounded-[16px] mt-[51px] sm:mt-[45px] md:mt-[39px] lg:mt-[32px] border border-solid sm:border-[#EFEFEF] bg-transparent sm:bg-[#FFF]
p-0 border-transparent sm:p-[40px] sm:pb-[48px] w-full sm:w-fit sm:min-w-[425px]"
>
<div
className="cursor-pointer"
onClick={() => {
setStep && setStep((prev) => prev - 1);
setIsSendMsg && setIsSendMsg(false);
}}
>
<ArrowRightS />
</div>
<p className="text-[#525252] mt-[10px] sm:mt-[12px] md:mt-[14px] lg:mt-[16px] text-[18px] font-bold">
کد تایید را وارد نمایید
</p>
<p className="text-[#616161] mt-[16px] sm:mt-[19px] md:mt-[22px] lg:mt-[24px] text-[14px] font-normal text-right">
کد تایید برای شماره 09013261200 ارسال شد.
</p>
<div className="mt-[26px] sm:mt-[28px] md:mt-[30px] lg:mt-[32px] mb-[56px] sm:mb-[47px] md:mb-[38px] lg:mb-[30px]">
<div
className="w-full mb-[27px] flex items-center justify-center gap-2 sm:gap-6"
dir="ltr"
>
<OTPForm handleOTP={handleOTP} />
<OTPForm handleOTP={handleOTP} />
<OTPForm handleOTP={handleOTP} />
<OTPForm handleOTP={handleOTP} />
<OTPForm handleOTP={handleOTP} />
</div>
{/* <Button className="flex items-center justify-start gap-1">
<p className="text-[#F17732] text-[14px] font-medium">دریافت مجدد کد تایید</p>
<ArrowLeftOrangeS />
</Button> */}
<div className='flex w-full items-center justify-between flex-wrap gap-y-5'>
<div className="flex w-full items-center justify-between flex-wrap gap-y-5">
<Button
className="flex !p-1 items-center justify-start gap-1 cursor-pointer"
onClick={() => {
setStep && setStep((prev) => prev - 1);
setIsSendMsg && setIsSendMsg(false);
}}
>
<EditLogin />
<p className="text-[#F17732] text-[14px] font-normal select-none">
ویرایش شماره موبایل
</p>
</Button>
<Button
className='flex !p-1 items-center justify-start gap-1 cursor-pointer'
onClick={() => {
setStep && setStep(prev => prev - 1)
setIsSendMsg && setIsSendMsg(false)
<Button
className="flex !p-1 items-center justify-start gap-1 hover-rotate-90 cursor-pointer"
// sx={{ '&.MuiButton-root:hover': { bgcolor: 'transparent' } }}
disabled={typeof timer === "number" && timer !== 0}
onClick={() => {
if (!timer && timer !== "loading") {
handleTimer();
}}
>
<EditLogin />
<p className='text-[#F17732] text-[14px] font-normal select-none'>ویرایش شماره موبایل</p>
</Button>
// Rotate Retry Icon
retryIcon.current.classList.add("retry-icon");
<Button
className='flex !p-1 items-center justify-start gap-1 hover-rotate-90 cursor-pointer'
// sx={{ '&.MuiButton-root:hover': { bgcolor: 'transparent' } }}
disabled={typeof timer === 'number' && timer !== 0}
onClick={() => {
if (!timer && timer !== 'loading') {
handleTimer();
// Rotate Retry Icon
retryIcon.current.classList.add('retry-icon');
// Remove Style Rotate Icon
setTimeout(() => {
retryIcon.current &&
retryIcon.current.classList.remove('retry-icon');
}, 1000);
}
}}
>
{timer && (timer !== 'loading') ? (
<p className='text-[#F17732] text-[14px] font-normal select-none'>{timer} ثانیه</p>
) : (
<>
<div ref={retryIcon}>
<RetryLogin />
</div>
<p className='text-[#F17732] text-[14px] font-normal select-none'>دریافت مجدد کد</p>
</>
)}
</Button>
// Remove Style Rotate Icon
setTimeout(() => {
retryIcon.current &&
retryIcon.current.classList.remove("retry-icon");
}, 1000);
}
}}
>
{timer && timer !== "loading" ? (
<p className="text-[#F17732] text-[14px] font-normal select-none">
{timer} ثانیه
</p>
) : (
<>
<div ref={retryIcon}>
<RetryLogin />
</div>
</div>
<Link
href={link || ''}
onClick={e => !link && e.preventDefault()}
>
<Button
fullWidth
variant='contained'
onClick={() => {
setIsSendMsg && setIsSendMsg(true)
setStep && setStep(prev => prev + 1)
}}
className='!rounded-[8px] !bg-[#5559CE]'
>تایید</Button>
</Link>
<p className="text-[#F17732] text-[14px] font-normal select-none">
دریافت مجدد کد
</p>
</>
)}
</Button>
</div>
)
</div>
<Link href={link || ""} onClick={(e) => !link && e.preventDefault()}>
<Button
fullWidth
variant="contained"
onClick={() => {
setIsSendMsg && setIsSendMsg(true);
setStep && setStep((prev) => prev + 1);
}}
className="!rounded-[8px] !bg-[#5559CE]"
>
تایید
</Button>
</Link>
</div>
);
}
export default SetCodePage
export default SetCodePage;
+20 -21
View File
@@ -1,31 +1,30 @@
import { useState } from "react"
import { useState } from "react";
function OTPForm({ handleOTP }) {
const [code, setCode] = useState("");
const [code, setCode] = useState('');
return (
<input
value={code}
onChange={(e) => {
const value = e.target.value;
return (
<input
value={code}
onChange={e => {
const value = e.target.value
if (/^\d+$/.test(value) && value.length < 2) {
setCode(value)
handleOTP(e)
} else {
setCode('')
e.target.value = ''
}
}}
className={`border border-solid border-[#ADB5BD] rounded-[6px] text-center transition-all duration-500 ease-out
if (/^\d+$/.test(value) && value.length < 2) {
setCode(value);
handleOTP(e);
} else {
setCode("");
e.target.value = "";
}
}}
className={`border border-solid border-[#ADB5BD] rounded-[6px] text-center transition-all duration-500 ease-out
outline-none focus:!border-[1px] focus:!border-solid focus:!border-[#5559CE]
focus:!outline-[1px] focus:!outline-solid focus:!outline-[#5559CE]
w-[43px] h-[43px] sm:w-[45px] sm:h-[45px] md:w-[47px] md:h-[47px] lg:w-[48px] lg:h-[48px]
${code && '!border-[1px] !border-solid !border-[#5559CE]'}
${code && "!border-[1px] !border-solid !border-[#5559CE]"}
`}
/>
)
/>
);
}
export default OTPForm
export default OTPForm;
+35 -33
View File
@@ -1,42 +1,44 @@
import Image from "next/image"
import Image from "next/image";
import Link from "next/link";
const about = ['سوالات متداول', 'تماس با ما', 'درباره ما'];
const about = ["سوالات متداول", "تماس با ما", "درباره ما"];
function RegisterPage({ children }) {
return (
<div
className="flex padding-responsive items-center justify-start sm:justify-start pt-[32px] sm:pt-[48px]
return (
<div
className="flex padding-responsive items-center justify-start sm:justify-start pt-[32px] sm:pt-[48px]
md:pt-[64px] lg:pt-[80px] overflow-auto flex-col h-screen w-full bg-banner-stroke !bg-bottom !bg-no-repeat !bg-cover
!pb-[calc(108px_+_50px)] md:!pb-[calc(111px_+_50px)]"
>
<Link href='/'>
<div className="flex items-center justify-center gap-[5px] sm:mt-0">
<Image
src='/assets/images/logo.png'
width={40}
height={40}
alt="logo"
/>
<p className="text-[#5559CE] text-[20px] font-bold">نوبت ۷۲۴</p>
</div>
</Link>
{children}
<div className="fixed bottom-0 left-0 bg-[#FAFAFA] w-full pb-[50px] px-[18px] sm:px-[67px] md:px[117px] lg:px-[166px]">
<div className="bg-border-t-gradient-sign h-px w-full"></div>
<div className="flex items-center justify-center gap-[32px] sm:gap-[40px] md:gap-[48px] lg:gap-[56px] mt-[36px]">
{about.map((item, idx) => (
<Link
href='/'
key={idx}
>
<p className="text-[#494CB3] text-[14px] md:text-[16px] font-normal" key={idx}>{item}</p>
</Link>
))}
</div>
</div>
>
<Link href="/">
<div className="flex items-center justify-center gap-[5px] sm:mt-0">
<Image
src="/assets/images/logo.png"
width={40}
height={40}
alt="logo"
/>
<p className="text-[#5559CE] text-[20px] font-bold">نوبت ۷۲۴</p>
</div>
)
</Link>
{children}
<div className="fixed bottom-0 left-0 bg-[#FAFAFA] w-full pb-[50px] px-[18px] sm:px-[67px] md:px[117px] lg:px-[166px]">
<div className="bg-border-t-gradient-sign h-px w-full"></div>
<div className="flex items-center justify-center gap-[32px] sm:gap-[40px] md:gap-[48px] lg:gap-[56px] mt-[36px]">
{about.map((item, idx) => (
<Link href="/" key={idx}>
<p
className="text-[#494CB3] text-[14px] md:text-[16px] font-normal"
key={idx}
>
{item}
</p>
</Link>
))}
</div>
</div>
</div>
);
}
export default RegisterPage
export default RegisterPage;