Skip to content

Commit

Permalink
refactor: 시험 intro 까지는 인증이 필요없게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
alstn113 committed Jan 14, 2025
1 parent 5bf4b04 commit e68e609
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 0 additions & 8 deletions web/src/components/exams/ExamSummaryCard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { ExamSummaryResponse } from '@/api/examAPI';
import { Routes } from '@/constants';
import useUser from '@/hooks/useUser';
import { fromNowDate } from '@/lib/date.ts';
import { Button, Card, CardFooter, CardHeader, Chip, Divider, Image } from '@nextui-org/react';
import toast from 'react-hot-toast';
import { useNavigate } from 'react-router';
import BaseCardBody from '../common/BaseCardBody';

Expand All @@ -12,14 +10,8 @@ interface ExamSummaryCardProps {
}

const ExamSummaryCard = ({ exam }: ExamSummaryCardProps) => {
const user = useUser();
const navigate = useNavigate();
const handleExamStart = () => {
if (!user) {
toast.error('로그인이 필요합니다.');
return;
}

navigate(Routes.exam.intro(exam.id));
};

Expand Down
7 changes: 7 additions & 0 deletions web/src/pages/exams/ExamIntroPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import AsyncBoundary from '@/components/AsyncBoundary';
import { Routes } from '@/constants';
import useGetExam from '@/hooks/api/exam/useGetExam';
import useUser from '@/hooks/useUser';
import { fullDate } from '@/lib/date.ts';
import { Button, Divider } from '@nextui-org/react';
import toast from 'react-hot-toast';
import { useNavigate, useParams } from 'react-router';

const ExamIntroPage = () => {
Expand All @@ -21,10 +23,15 @@ const ExamIntroPage = () => {
};

const ExamProgressContent = ({ examId }: { examId: number }) => {
const user = useUser();
const { data } = useGetExam(examId);
const navigate = useNavigate();

const handleExamStart = () => {
if (!user) {
toast.error('로그인이 필요합니다.');
return;
}
navigate(Routes.exam.progress(examId));
};

Expand Down

0 comments on commit e68e609

Please sign in to comment.