refactor: implement login state management and navigation flow in appointment components

This commit is contained in:
hamed
2025-11-17 15:00:40 +03:30
parent 6c787fe5fa
commit 5a58c13a4e
5 changed files with 78 additions and 27 deletions
+12 -1
View File
@@ -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}
/>
);
}