diff --git a/app/(auth)/login/page.tsx b/app/(auth)/login/page.tsx index d2c3226..288ef26 100644 --- a/app/(auth)/login/page.tsx +++ b/app/(auth)/login/page.tsx @@ -11,10 +11,11 @@ import DestructibleAlert from "@/components/DestructibleAlert"; import { useAuth } from "@/context/AuthContext"; import { LoginForm } from "@/types/auth"; import { CircleAlert } from "lucide-react"; +import { useAuthStore } from "@/stores/authStore"; const LoginPage = () => { const router = useRouter(); - const { setToken } = useAuth(); + const { setToken } = useAuthStore(); const [form, setForm] = useState({ identifier: "", @@ -88,7 +89,7 @@ const LoginPage = () => { } /> - {error && } + {error && }

diff --git a/app/(auth)/register/page.tsx b/app/(auth)/register/page.tsx index 2fb2245..d6a9f2a 100644 --- a/app/(auth)/register/page.tsx +++ b/app/(auth)/register/page.tsx @@ -11,6 +11,7 @@ import BackgroundWrapper from "@/components/BackgroundWrapper"; import FormField from "@/components/FormField"; import DestructibleAlert from "@/components/DestructibleAlert"; import { RegisterForm } from "@/types/auth"; +import { useAuthStore } from "@/stores/authStore"; interface ValidationErrorItem { type: string; @@ -27,7 +28,7 @@ interface CustomError extends Error { } export default function RegisterPage() { - const { setToken } = useAuth(); + const { setToken } = useAuthStore(); const router = useRouter(); const [form, setForm] = useState({ full_name: "", diff --git a/app/(tabs)/categories/mocks/page.tsx b/app/(tabs)/categories/mocks/page.tsx index f0e3ce0..af8bf4f 100644 --- a/app/(tabs)/categories/mocks/page.tsx +++ b/app/(tabs)/categories/mocks/page.tsx @@ -8,6 +8,7 @@ import BackgroundWrapper from "@/components/BackgroundWrapper"; import { API_URL, getToken } from "@/lib/auth"; import { Loader, RefreshCw } from "lucide-react"; import { useAuth } from "@/context/AuthContext"; +import { useAuthStore } from "@/stores/authStore"; type Mock = { test_id: string; @@ -22,7 +23,7 @@ type Mock = { export default function MockScreen() { const router = useRouter(); - const { user } = useAuth(); + const { user } = useAuthStore(); const [mocks, setMocks] = useState([]); const [errorMsg, setErrorMsg] = useState(null); diff --git a/app/(tabs)/categories/subjects/page.tsx b/app/(tabs)/categories/subjects/page.tsx index 802b136..d974e76 100644 --- a/app/(tabs)/categories/subjects/page.tsx +++ b/app/(tabs)/categories/subjects/page.tsx @@ -10,6 +10,7 @@ import { API_URL, getToken } from "@/lib/auth"; import { Loader, RefreshCw } from "lucide-react"; import { useAuth } from "@/context/AuthContext"; import { Question } from "@/types/exam"; +import { useAuthStore } from "@/stores/authStore"; type Subject = { subject_id: string; @@ -19,7 +20,7 @@ type Subject = { export default function PaperScreen() { const router = useRouter(); - const { user } = useAuth(); + const { user } = useAuthStore(); const [subjects, setSubjects] = useState([]); const [errorMsg, setErrorMsg] = useState(null); @@ -70,7 +71,7 @@ export default function PaperScreen() {
- +