generated from muhtadeetaron/nextjs-template
feat(zustand): add zustand stores for exam, timer and auth
This commit is contained in:
@ -9,6 +9,9 @@ import { useExam } from "@/context/ExamContext";
|
||||
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
||||
import { useModal } from "@/context/ModalContext";
|
||||
import { useAuth } from "@/context/AuthContext";
|
||||
import { useAuthStore } from "@/stores/authStore";
|
||||
import { useTimerStore } from "@/stores/timerStore";
|
||||
import { useExamStore } from "@/stores/examStore";
|
||||
|
||||
interface HeaderProps {
|
||||
displayUser?: boolean;
|
||||
@ -23,9 +26,9 @@ const Header = ({
|
||||
}: HeaderProps) => {
|
||||
const router = useRouter();
|
||||
const { open } = useModal();
|
||||
const { cancelExam } = useExam();
|
||||
const { stopTimer, timeRemaining } = useTimer();
|
||||
const { user } = useAuth();
|
||||
const { cancelExam } = useExamStore();
|
||||
const { stopTimer, timeRemaining } = useTimerStore();
|
||||
const { user } = useAuthStore();
|
||||
|
||||
const showExitDialog = () => {
|
||||
const confirmed = window.confirm("Are you sure you want to quit the exam?");
|
||||
|
||||
Reference in New Issue
Block a user