refactor: implement login state management and navigation flow in appointment components
This commit is contained in:
@@ -19,6 +19,11 @@ function AppointmentPage({ doctor, disabledDates, matchedCity }) {
|
||||
const [prevData, setPrevData] = useState(defaultData);
|
||||
const [data, setData] = useState(defaultData);
|
||||
|
||||
// Login states
|
||||
const [num, setNum] = useState("");
|
||||
const [uuid, setUuid] = useState("");
|
||||
const [isSendMsg, setIsSendMsg] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const userInfo = Cookies.get("userInfo");
|
||||
const parsedData = userInfo && JSON.parse(userInfo);
|
||||
@@ -62,7 +67,7 @@ function AppointmentPage({ doctor, disabledDates, matchedCity }) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
}, [step]); // وقتی step تغییر کرد، دوباره چک میکنه
|
||||
|
||||
return (
|
||||
<Container
|
||||
@@ -76,6 +81,12 @@ function AppointmentPage({ doctor, disabledDates, matchedCity }) {
|
||||
isForAnother={isForAnother}
|
||||
setIsForAnother={setIsForAnother}
|
||||
disabledDates={disabledDates}
|
||||
num={num}
|
||||
setNum={setNum}
|
||||
uuid={uuid}
|
||||
setUuid={setUuid}
|
||||
isSendMsg={isSendMsg}
|
||||
setIsSendMsg={setIsSendMsg}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user