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
+7 -1
View File
@@ -11,9 +11,15 @@ function SendAppo({ hour, setStep }) {
const sendReq = () => {
const isLogged = Cookies.get("access_token");
if (isLogged) {
setStep((step) => step + 1);
// اگر لاگین کرده، به مرحله 3 (Detail) می‌رود
setStep(3);
} else {
// اگر لاگین نکرده، به مرحله 1 (Login) می‌رود
setStep(1);
}
// setLoading(true);
// request
// .postAppointment({