feat(zustand): add zustand stores for exam, timer and auth

This commit is contained in:
shafin-r
2025-08-31 18:28:01 +06:00
parent 65e3338859
commit 7df2708db7
18 changed files with 352 additions and 106 deletions

View File

@ -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<Subject[]>([]);
const [errorMsg, setErrorMsg] = useState<string | null>(null);
@ -70,7 +71,7 @@ export default function PaperScreen() {
<Header displayTabTitle="Subjects" />
<div className="overflow-y-auto">
<div className="mt-5 px-5">
<DestructibleAlert text={errorMsg} extraStyles="" />
<DestructibleAlert text={errorMsg} />
</div>
<div className="flex justify-center mt-4">
<button