Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quiz기능 완성 #59

Merged
merged 24 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4aad668
✨ Feature(#46): 정답 상태관리 완성
rhehfl Oct 13, 2024
2f80ad1
✨ Feature(#46): 조합형 빼고 보여주기 완성
rhehfl Oct 16, 2024
ac72165
✨ Feature(#46): 정답 맞추기 기능 완성
rhehfl Oct 16, 2024
727e7e8
Merge branch 'develop' of https://github.com/modern-agile-team/8term-…
rhehfl Oct 16, 2024
b0ad200
✨ Feature(#46): 퀴즈 결과 기능
rhehfl Oct 17, 2024
e70366a
✨ Feature(#46): develop 충돌해결
rhehfl Oct 17, 2024
68fc39c
✨ Feature(#46): 문제풀이 기능 구현 완료
rhehfl Oct 18, 2024
348b847
✨ Feature(#46): 가독성 향상을 위한 코드 정리
rhehfl Oct 20, 2024
750ac3e
✨ Feature(#46):함수 주석 추가
rhehfl Oct 21, 2024
7c5320b
✨ Feature(#46):조합형 칸넣기, dnd 구현
rhehfl Oct 23, 2024
3819884
✨ Feature(#46):dopurify로 xss공격 방어, 폴더이름 소문자로 수정, package.json 안쓰는 라이브…
rhehfl Oct 27, 2024
dbcb565
Merge branch 'develop' of https://github.com/modern-agile-team/8term-…
rhehfl Oct 28, 2024
aae87bb
✨ Feature(#46): 미사용 컴포넌트 제거
rhehfl Oct 28, 2024
ff23610
✨ Feature(#46): Quiz 타입 수정
rhehfl Oct 30, 2024
e65d20e
Merge branch 'develop' of https://github.com/modern-agile-team/8term-…
rhehfl Oct 30, 2024
1b30b58
✨ Feature(#46): interface로 props 타입 통일
rhehfl Nov 1, 2024
3de7f3a
✨ Feature(#46): 진행도 추가, api, query폴더 분리
rhehfl Nov 3, 2024
a1b0955
✨ Feature(#46): store 타입분리,조합형 id수정
rhehfl Nov 3, 2024
fa1c0ac
✨ Feature(#46): 모달 hooks로 분리
rhehfl Nov 3, 2024
bc8f74d
✨ Feature(#46): 미사용 util함수 제거 useModal 주석추가
rhehfl Nov 3, 2024
3645489
✨ Feature(#46): 폴더명 오타 수정
rhehfl Nov 3, 2024
9ab243f
✨ Feature(#46): PR 수정사항 적용
rhehfl Nov 4, 2024
cd77c94
✨ Feature(#46): 유틸 함수, 훅 로직 수정
rhehfl Nov 4, 2024
358dd0a
✨ Feature(#46): 배열 비교 함수 수정
rhehfl Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</head>
<body>
<div id="root"></div>
<div id="modal-root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
203 changes: 203 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
"dependencies": {
"@tanstack/react-query": "^5.59.0",
"@tanstack/react-query-devtools": "^5.59.0",
"@types/dompurify": "^3.0.5",
"axios": "^1.7.7",
"dompurify": "^3.1.7",
"html-react-parser": "^5.1.18",
"query-string": "^9.1.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.2",
Expand Down
9 changes: 8 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import Router from './route/Router';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
function App() {
const queryClient = new QueryClient();
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: Infinity,
gcTime: Infinity,
},
},
});
Comment on lines +5 to +12
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quiz 기능과는 조금 엇나가는 부분이지만 저희 페이지 특정상 항상 최신화된 데이터가 필요하다고는 생각되지 않아서
항상 캐시된 데이터를 가져올 수 있도록 Provider의 기본 설정을 변경해봤습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bluetree7878 혹시 이부분에 대해서 어떻게 생각하시나요?

return (
<>
<QueryClientProvider client={queryClient}>
Expand Down
6 changes: 6 additions & 0 deletions src/ModalPortal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { PropsWithChildren } from 'react';
import ReactDom from 'react-dom';
export default function ModalPortal({ children }: PropsWithChildren) {
const modalRoot = document.getElementById('modal-root') as HTMLElement;
return ReactDom.createPortal(children, modalRoot);
}
8 changes: 8 additions & 0 deletions src/apis/axios/instance.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import axios from 'axios';
import queryString from 'query-string';

const api = axios.create({
baseURL: import.meta.env.VITE_BASE_URL,
timeout: 5000,
paramsSerializer: params => {
return queryString.stringify(params, {
skipEmptyString: true,
skipNull: true,
});
},
});
export default api;
1 change: 0 additions & 1 deletion src/apis/axios/intercepter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ axiosConfig.interceptors.request.use(config => {
//요청 성공 직전 호출
//헤더에 인가 토큰 부착
//로컬스토리지에 저장한다고 가정한다면
console.log('asdasd');
const accessToken: string | null = localStorage.getItem('Token');
if (accessToken !== null) {
config.headers.Authorization = `Bearer ${accessToken}`;
Expand Down
17 changes: 0 additions & 17 deletions src/apis/quiz.ts

This file was deleted.

13 changes: 13 additions & 0 deletions src/apis/quizzesApis.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Quiz from '../types/Quiz';
import api from './axios/instance';

const quizzesApis = {
getquizzes: async (params?: {
sectionId?: number;
partId: number;
}): Promise<Quiz[]> => {
const response = await api.get('/quizzes', { params });
return response.data;
},
};
export default quizzesApis;
Loading