refactor: implement login state management and navigation flow in appointment components
This commit is contained in:
@@ -7,6 +7,9 @@ import Paying from "@/components/appointment/paying";
|
||||
import Detail from "@/components/appointment/detail";
|
||||
import FailedPay from "@/components/appointment/failedPay";
|
||||
import SuccessPay from "@/components/appointment/successPay";
|
||||
import LogInPage from "@/components/register/LogInPage";
|
||||
import VerificationPage from "@/components/register/verificationPage";
|
||||
import LayoutRegister from "@/components/register/LayoutRegister";
|
||||
|
||||
function Container({
|
||||
step,
|
||||
@@ -19,11 +22,33 @@ function Container({
|
||||
isForAnother,
|
||||
setIsForAnother,
|
||||
disabledDates,
|
||||
// Login states
|
||||
num,
|
||||
setNum,
|
||||
uuid,
|
||||
setUuid,
|
||||
isSendMsg,
|
||||
setIsSendMsg,
|
||||
}) {
|
||||
const elements = [
|
||||
<Date doctor={doctor} setStep={setStep} disabledDates={disabledDates} />,
|
||||
// <LogInPage setIsSendMsg={false} setStep={setStep} />,
|
||||
// <VerificationPage setIsSendMsg={false} link={false} setStep={setStep} />,
|
||||
<LogInPage
|
||||
num={num}
|
||||
setNum={setNum}
|
||||
setUuid={setUuid}
|
||||
setStep={setStep}
|
||||
setIsSendMsg={setIsSendMsg}
|
||||
matchedCity={matchedCity}
|
||||
/>,
|
||||
<VerificationPage
|
||||
num={num}
|
||||
uuid={uuid}
|
||||
setStep={setStep}
|
||||
setUuid={setUuid}
|
||||
isSendMsg={isSendMsg}
|
||||
setIsSendMsg={setIsSendMsg}
|
||||
link={false}
|
||||
/>,
|
||||
<Detail
|
||||
data={data}
|
||||
setStep={setStep}
|
||||
@@ -39,27 +64,29 @@ function Container({
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* {step === 1 || step === 2 ? (
|
||||
<RegisterPage>{elements[step]}</RegisterPage>
|
||||
) : ( */}
|
||||
<Layout
|
||||
title="رزرو"
|
||||
name="booking"
|
||||
disableFooter={step > 2}
|
||||
matchedCity={matchedCity}
|
||||
paddingBottom="pb-[80px]"
|
||||
>
|
||||
<Content
|
||||
disableSide={step === 5 || step === 6}
|
||||
isFirst={step === 0}
|
||||
setStep={setStep}
|
||||
doctor={doctor}
|
||||
step={step}
|
||||
>
|
||||
{step === 1 || step === 2 ? (
|
||||
<LayoutRegister matchedCity={matchedCity}>
|
||||
{elements[step]}
|
||||
</Content>
|
||||
</Layout>
|
||||
{/* )} */}
|
||||
</LayoutRegister>
|
||||
) : (
|
||||
<Layout
|
||||
title="رزرو"
|
||||
name="booking"
|
||||
disableFooter={step > 4}
|
||||
matchedCity={matchedCity}
|
||||
paddingBottom="pb-[80px]"
|
||||
>
|
||||
<Content
|
||||
disableSide={step === 5 || step === 6}
|
||||
isFirst={step === 0}
|
||||
setStep={setStep}
|
||||
doctor={doctor}
|
||||
step={step}
|
||||
>
|
||||
{elements[step]}
|
||||
</Content>
|
||||
</Layout>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user