From 2d4c62884cd88f3a4af1bdc9d472db6b578af967 Mon Sep 17 00:00:00 2001 From: yoo-jimin127 Date: Tue, 3 Oct 2023 18:53:04 +0900 Subject: [PATCH 01/10] =?UTF-8?q?feat:=20@@=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=ED=9B=85=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TERMTERM/src/hooks/useQuizExplain.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 TERMTERM/src/hooks/useQuizExplain.tsx diff --git a/TERMTERM/src/hooks/useQuizExplain.tsx b/TERMTERM/src/hooks/useQuizExplain.tsx new file mode 100644 index 0000000..ce9421c --- /dev/null +++ b/TERMTERM/src/hooks/useQuizExplain.tsx @@ -0,0 +1,11 @@ +interface HideWordResult { + hiddenExplain: string; +} + +const useQuizExplain = (explain: string): HideWordResult => { + const hiddenExplain = explain.replace(/@@(.*?)@@/g, "OO"); + + return { hiddenExplain }; +} + +export default useQuizExplain; \ No newline at end of file From 841a212409963ccfa9b440db17af7917b3e3e52d Mon Sep 17 00:00:00 2001 From: yoo-jimin127 Date: Tue, 3 Oct 2023 18:53:38 +0900 Subject: [PATCH 02/10] =?UTF-8?q?chore:=20=EB=AC=B8=EC=9E=90=20=EB=8C=80?= =?UTF-8?q?=EC=B2=B4=20=ED=9B=85=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TERMTERM/src/components/quiz/QuizCard.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TERMTERM/src/components/quiz/QuizCard.tsx b/TERMTERM/src/components/quiz/QuizCard.tsx index 7fcef22..b9e1a68 100644 --- a/TERMTERM/src/components/quiz/QuizCard.tsx +++ b/TERMTERM/src/components/quiz/QuizCard.tsx @@ -1,7 +1,8 @@ import styled from "styled-components/native"; -import { colorTheme, LIGHT_COLOR_STYLE, TYPO_STYLE } from "@style/designSystem"; +import { colorTheme, TYPO_STYLE } from "@style/designSystem"; import { useThemeStyle } from "@hooks/useThemeStyle"; import { screenWidth } from "@style/dimensions"; +import useQuizExplain from "@hooks/useQuizExplain"; interface QuizCardProps { title?: string; @@ -10,11 +11,12 @@ interface QuizCardProps { const QuizCard = (props: QuizCardProps) => { const [COLOR, mode] = useThemeStyle(); + const { hiddenExplain } = useQuizExplain(props.explain ?? "") return ( - {props.explain} + {hiddenExplain} ); From 9fa9ba15d338d48a7b19a47a53609114bef30362 Mon Sep 17 00:00:00 2001 From: yoo-jimin127 Date: Tue, 3 Oct 2023 19:10:23 +0900 Subject: [PATCH 03/10] =?UTF-8?q?feat:=20=EC=9A=A9=EC=96=B4=20@@=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20=ED=9B=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TERMTERM/src/hooks/useRemoveChar.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 TERMTERM/src/hooks/useRemoveChar.tsx diff --git a/TERMTERM/src/hooks/useRemoveChar.tsx b/TERMTERM/src/hooks/useRemoveChar.tsx new file mode 100644 index 0000000..c49e5e8 --- /dev/null +++ b/TERMTERM/src/hooks/useRemoveChar.tsx @@ -0,0 +1,11 @@ +interface ExplainResult { + filteredExplain: string; +} + +const useRemoveChar = (explain: string): ExplainResult => { + const filteredExplain = explain.replace(/@@/g, ""); + + return { filteredExplain }; +} + +export default useRemoveChar; \ No newline at end of file From be427f714caf87264d3c873e6888f284b21de81c Mon Sep 17 00:00:00 2001 From: yoo-jimin127 Date: Tue, 3 Oct 2023 19:10:39 +0900 Subject: [PATCH 04/10] =?UTF-8?q?chore:=20=EC=9A=A9=EC=96=B4=20=EC=84=A4?= =?UTF-8?q?=EB=AA=85=20=EC=A4=91=20=ED=8A=B9=EC=88=98=EB=AC=B8=EC=9E=90=20?= =?UTF-8?q?@@=20=EC=A0=9C=EA=B1=B0=20=ED=9B=85=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/curation/detail/term/TermPreviewBox.tsx | 6 ++++-- TERMTERM/src/components/home/DailyTermBox.tsx | 4 +++- TERMTERM/src/components/terms/QuizAnswerCard.tsx | 4 +++- TERMTERM/src/components/terms/WordCard.tsx | 4 +++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/TERMTERM/src/components/curation/detail/term/TermPreviewBox.tsx b/TERMTERM/src/components/curation/detail/term/TermPreviewBox.tsx index 587469e..eb1bf64 100644 --- a/TERMTERM/src/components/curation/detail/term/TermPreviewBox.tsx +++ b/TERMTERM/src/components/curation/detail/term/TermPreviewBox.tsx @@ -13,6 +13,7 @@ import { useTerm } from "@hooks/useTerm"; import { booleanConverter } from "@utils/booleanConverter"; import { useArchive } from "@hooks/useArchive"; import CustomModal from "@components/popup/modal"; +import useRemoveChar from "@hooks/useRemoveChar"; interface Props extends TouchableOpacityProps { id: number; @@ -35,6 +36,7 @@ const TermPreviewBox = ({ const [sub, main] = useWordReg(name); const navigation = useNavigation>(); const { archiveTerm, isModalOpen, goToFolderMake, closeModal } = useArchive(); + const { filteredExplain } = useRemoveChar(description); return ( - {description !== null - ? truncateString(description, 60) + {filteredExplain !== null + ? truncateString(filteredExplain, 60) : "용어 설명이 없어요."} { const [sub, main] = useWordReg(name); const navigation = useNavigation>(); const { archiveTerm, isModalOpen, goToFolderMake, closeModal } = useArchive(); + const { filteredExplain } = useRemoveChar(description); return ( { {main} - {truncateString(description, 75)} + {truncateString(filteredExplain, 75)} { const [COLOR, mode] = useThemeStyle(); const [sub, main] = useWordReg(word?.termName); + const { filteredExplain } = useRemoveChar(word?.termDescription); return ( { - {word?.termDescription} + {filteredExplain} ); diff --git a/TERMTERM/src/components/terms/WordCard.tsx b/TERMTERM/src/components/terms/WordCard.tsx index 1e1d035..8e0cdf4 100644 --- a/TERMTERM/src/components/terms/WordCard.tsx +++ b/TERMTERM/src/components/terms/WordCard.tsx @@ -1,3 +1,4 @@ +import useRemoveChar from "@hooks/useRemoveChar"; import { useThemeStyle } from "@hooks/useThemeStyle"; import { useWordReg } from "@hooks/useWordReg"; import { TEXT_STYLES, TYPO, colorTheme, TYPO_STYLE } from "@style/designSystem"; @@ -20,6 +21,7 @@ interface Props extends TouchableOpacityProps { const WordCard = ({ word, quiz, detail, ...props }: Props) => { const [COLOR, mode] = useThemeStyle(); const [sub, main] = useWordReg(word.name); + const { filteredExplain } = useRemoveChar(word.description) return ( { - {word.description} + {filteredExplain} ); From 8df442233ed55a5acb5a0be2f979940b54c7853d Mon Sep 17 00:00:00 2001 From: yoo-jimin127 Date: Tue, 3 Oct 2023 20:21:32 +0900 Subject: [PATCH 05/10] =?UTF-8?q?fix:=20=EB=B3=B5=EC=8A=B5=20=ED=80=B4?= =?UTF-8?q?=EC=A6=88=20=EC=A2=85=EB=A3=8C=20=EC=95=88=EB=90=98=EB=8A=94=20?= =?UTF-8?q?=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TERMTERM/src/components/quiz/Types/Start.tsx | 2 +- TERMTERM/src/hooks/useQuiz.tsx | 7 ++++++- TERMTERM/src/screens/ReviewQuiz.tsx | 4 ---- TERMTERM/src/screens/ReviewQuizResult.tsx | 4 +--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/TERMTERM/src/components/quiz/Types/Start.tsx b/TERMTERM/src/components/quiz/Types/Start.tsx index 4eb6649..7b71842 100644 --- a/TERMTERM/src/components/quiz/Types/Start.tsx +++ b/TERMTERM/src/components/quiz/Types/Start.tsx @@ -38,7 +38,7 @@ const Start = ({ navigate }: ChildrenProps) => { const [countdown, setCountdown] = useState(0); const navigation = useNavigation>(); const curr = useRecoilValue(quizState); - const { currIdx } = curr; + const { currIdx, totalReviewIdx } = curr; const setQuizStatus = useSetRecoilState(memberQuizSolveState); const quizStatus = useRecoilValue(memberQuizSolveState); diff --git a/TERMTERM/src/hooks/useQuiz.tsx b/TERMTERM/src/hooks/useQuiz.tsx index ce368cd..dd83494 100644 --- a/TERMTERM/src/hooks/useQuiz.tsx +++ b/TERMTERM/src/hooks/useQuiz.tsx @@ -1,4 +1,5 @@ import QuizApi from "@api/QuizApi"; +import { quizState } from "@recoil/quizState"; import { QuizDetail, QuizReviewDetail, @@ -7,6 +8,7 @@ import { QuizAnswerResult, } from "Quiz"; import { useEffect, useState } from "react"; +import { useRecoilValue } from "recoil"; /** * 퀴즈 관리 훅 @@ -19,6 +21,8 @@ export const useQuiz = () => { const [reviewQuizItem, setReviewQuizItem] = useState(); const [quizStatus, setQuizStatus] = useState(); const [quizResultData, setQuizResultData] = useState(); + const curr = useRecoilValue(quizState); + const { currIdx, currReviewIdx, totalIdx, totalReviewIdx } = curr; /** 데일리 퀴즈 */ const getDailyQuizInfo = async (): Promise => { @@ -53,7 +57,8 @@ export const useQuiz = () => { ): Promise => { try { const data = await quizApi.registerQuizResult(apiUrl, resultData); - // console.log("퀴즈 요청 성공", apiUrl, resultData, data); + //console.log("curr.currReviewIdx:", curr.currReviewIdx, "curr.totalReviewIdx: ", curr.totalReviewIdx); + //console.log("퀴즈 요청 성공", apiUrl, resultData, data); setQuizResultData(data); // console.log("quizResultData in hook : ", quizResultData); return data; diff --git a/TERMTERM/src/screens/ReviewQuiz.tsx b/TERMTERM/src/screens/ReviewQuiz.tsx index cab2f1a..c52119c 100644 --- a/TERMTERM/src/screens/ReviewQuiz.tsx +++ b/TERMTERM/src/screens/ReviewQuiz.tsx @@ -6,7 +6,6 @@ import { colorTheme, TYPO_STYLE } from "@style/designSystem"; import { SafeAreaView } from "react-native-safe-area-context"; import QuizCard from "@components/quiz/QuizCard"; import { useThemeStyle } from "@hooks/useThemeStyle"; -import useHideWord from "@hooks/useHideWord"; import { screenWidth } from "@style/dimensions"; import { useQuiz } from "@hooks/useQuiz"; import { useRecoilState, useSetRecoilState } from "recoil"; @@ -29,8 +28,6 @@ const ReviewQuiz = ({ navigation }: Props) => { const setTotalReviewIdx = useSetRecoilState(quizState); const setEachQuizAnswer = useSetRecoilState(eachQuizAnswerResult); - // TODO : DB에 @@ 포함되어 용어 설명 들어가면 다시 훅 사용 - // const { hiddenExplain } = useHideWord(dummy[idx].explain, dummy[idx].word); const handleButton = async (idx: number) => { setSelectedIdx(idx); setBorderColor(COLOR.THEME.secondary[120]); @@ -48,7 +45,6 @@ const ReviewQuiz = ({ navigation }: Props) => { if (isFinalQuestion) { apiUrl += `?final=true`; - // setCurr((prev) => ({ ...prev, currReviewIdx: prev.currReviewIdx * 0 })); } const res = await registerQuizResultInfo(apiUrl, memberQuizSelect); diff --git a/TERMTERM/src/screens/ReviewQuizResult.tsx b/TERMTERM/src/screens/ReviewQuizResult.tsx index 6273501..1d4d616 100644 --- a/TERMTERM/src/screens/ReviewQuizResult.tsx +++ b/TERMTERM/src/screens/ReviewQuizResult.tsx @@ -16,8 +16,6 @@ import { import QuizAnswerCard from "@components/terms/QuizAnswerCard"; import { eachQuizAnswerResult, quizState } from "@recoil/quizState"; import { useRecoilValue, useSetRecoilState } from "recoil"; -import { useQuiz } from "@hooks/useQuiz"; -import { QuizAnswerResult } from "Quiz"; export type Props = StackScreenProps; @@ -35,7 +33,7 @@ const ReviewQuizResult = ({ navigation, route }: Props) => { }; const handleReviewButton = () => { - setCurrReviewIdx((prev) => ({ ...prev, currReviewIdx: 1 })); + setCurrReviewIdx((prev) => ({ ...prev, currReviewIdx: curr.currReviewIdx })); navigation.navigate("ReviewQuiz"); }; From 013ac93ba8bca45a95564283fb2e4ce0844ec5a9 Mon Sep 17 00:00:00 2001 From: yoo-jimin127 Date: Tue, 3 Oct 2023 21:07:50 +0900 Subject: [PATCH 06/10] =?UTF-8?q?chore:=20=ED=83=80=EC=9D=B4=EB=A8=B8..?= =?UTF-8?q?=EB=94=94=EB=B2=84=EA=B9=85=20=ED=95=84=EC=9A=94..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TERMTERM/src/components/quiz/Types/Start.tsx | 2 +- TERMTERM/src/hooks/useQuiz.tsx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/TERMTERM/src/components/quiz/Types/Start.tsx b/TERMTERM/src/components/quiz/Types/Start.tsx index 7b71842..54b4f7c 100644 --- a/TERMTERM/src/components/quiz/Types/Start.tsx +++ b/TERMTERM/src/components/quiz/Types/Start.tsx @@ -67,7 +67,7 @@ const Start = ({ navigate }: ChildrenProps) => { return () => { clearInterval(interval); }; - }, [quizStatus]); + }, [quizStatus, countdown]); return ( <> diff --git a/TERMTERM/src/hooks/useQuiz.tsx b/TERMTERM/src/hooks/useQuiz.tsx index dd83494..57a91ac 100644 --- a/TERMTERM/src/hooks/useQuiz.tsx +++ b/TERMTERM/src/hooks/useQuiz.tsx @@ -60,7 +60,6 @@ export const useQuiz = () => { //console.log("curr.currReviewIdx:", curr.currReviewIdx, "curr.totalReviewIdx: ", curr.totalReviewIdx); //console.log("퀴즈 요청 성공", apiUrl, resultData, data); setQuizResultData(data); - // console.log("quizResultData in hook : ", quizResultData); return data; } catch (err) { console.log(err); From 0c1a944a8c62508ee46d7cf5f68c0d0edb33c2ee Mon Sep 17 00:00:00 2001 From: yoo-jimin127 Date: Tue, 3 Oct 2023 21:45:19 +0900 Subject: [PATCH 07/10] =?UTF-8?q?chore:=20statusCode=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TERMTERM/@types/Quiz.d.ts | 1 + TERMTERM/src/screens/DailyQuiz.tsx | 1 + TERMTERM/src/screens/QuizResult.tsx | 2 +- TERMTERM/src/screens/ReviewQuiz.tsx | 1 + TERMTERM/src/screens/ReviewQuizResult.tsx | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TERMTERM/@types/Quiz.d.ts b/TERMTERM/@types/Quiz.d.ts index 9db6d52..46cdc71 100644 --- a/TERMTERM/@types/Quiz.d.ts +++ b/TERMTERM/@types/Quiz.d.ts @@ -44,6 +44,7 @@ declare module "Quiz" { termDescription: string; memberSelectedTermName: string; isAnswerRight: boolean; + statusCode: number; } export type QuizStatus = { diff --git a/TERMTERM/src/screens/DailyQuiz.tsx b/TERMTERM/src/screens/DailyQuiz.tsx index b7b9c94..3af75e7 100644 --- a/TERMTERM/src/screens/DailyQuiz.tsx +++ b/TERMTERM/src/screens/DailyQuiz.tsx @@ -54,6 +54,7 @@ const DailyQuiz = ({ navigation }: Props) => { termDescription: res?.termDescription as string, memberSelectedTermName: res?.memberSelectedTermName as string, isAnswerRight: res?.isAnswerRight as boolean, + statusCode: res?.statusCode as number, }) navigation.navigate("QuizResult", { id: idx }); }; diff --git a/TERMTERM/src/screens/QuizResult.tsx b/TERMTERM/src/screens/QuizResult.tsx index 455e335..b9908ed 100644 --- a/TERMTERM/src/screens/QuizResult.tsx +++ b/TERMTERM/src/screens/QuizResult.tsx @@ -46,7 +46,7 @@ const QuizResult = ({ navigation, route }: Props) => { state={BUTTON_STATE.active} onPress={() => currIdx === 5 - ? navigation.navigate("CompleteQuiz") + ? navigation.navigate("CompleteQuiz", {id: quizResult.statusCode}) : navigation.navigate("DailyQuiz") } style={{ width: "90%", alignSelf: "center", marginTop: "7%" }} diff --git a/TERMTERM/src/screens/ReviewQuiz.tsx b/TERMTERM/src/screens/ReviewQuiz.tsx index c52119c..0e8a7bc 100644 --- a/TERMTERM/src/screens/ReviewQuiz.tsx +++ b/TERMTERM/src/screens/ReviewQuiz.tsx @@ -54,6 +54,7 @@ const ReviewQuiz = ({ navigation }: Props) => { termDescription: res?.termDescription as string, memberSelectedTermName: res?.memberSelectedTermName as string, isAnswerRight: res?.isAnswerRight as boolean, + statusCode: res?.statusCode as number, }); navigation.navigate("ReviewQuizResult", { id: idx }); }; diff --git a/TERMTERM/src/screens/ReviewQuizResult.tsx b/TERMTERM/src/screens/ReviewQuizResult.tsx index 1d4d616..0ba125f 100644 --- a/TERMTERM/src/screens/ReviewQuizResult.tsx +++ b/TERMTERM/src/screens/ReviewQuizResult.tsx @@ -29,7 +29,7 @@ const ReviewQuizResult = ({ navigation, route }: Props) => { const handleCompleteButton = () => { setCurrReviewIdx((prev) => ({ ...prev, currReviewIdx: 0 })); - navigation.navigate("CompleteQuiz"); + navigation.navigate("CompleteQuiz", {id: quizResult.statusCode}); }; const handleReviewButton = () => { From 02d74e1265669611a8cb3f119edc6d66fa5f4054 Mon Sep 17 00:00:00 2001 From: yoo-jimin127 Date: Tue, 3 Oct 2023 21:45:37 +0900 Subject: [PATCH 08/10] =?UTF-8?q?chore:=20CompleteQuiz=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A6=B0=20status=20=EB=B0=98=EC=98=81=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TERMTERM/src/screens/CompleteQuiz.tsx | 69 ++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 7 deletions(-) diff --git a/TERMTERM/src/screens/CompleteQuiz.tsx b/TERMTERM/src/screens/CompleteQuiz.tsx index 9537345..0ae8a2c 100644 --- a/TERMTERM/src/screens/CompleteQuiz.tsx +++ b/TERMTERM/src/screens/CompleteQuiz.tsx @@ -12,15 +12,17 @@ import { Fontisto } from "@expo/vector-icons"; import QuizApi from "@api/QuizApi"; import { useRecoilState } from "recoil"; import { memberQuizSolveState } from "@recoil/quizState"; +import { useQuiz } from "@hooks/useQuiz"; export type Props = StackScreenProps; -const CompleteQuiz = ({ navigation }: Props) => { +const CompleteQuiz = ({ navigation, route }: Props) => { const [COLOR, mode] = useThemeStyle(); const [width, setWidth] = useState(112); const [score, setScore] = useState(200); const quizApi = new QuizApi(); const [quizSolve, setQuizSolve] = useRecoilState(memberQuizSolveState); + const { quizStatus } = useQuiz(); /** 아이콘 너비 계산 함수 */ const calcWidth = () => { @@ -53,10 +55,63 @@ const CompleteQuiz = ({ navigation }: Props) => { calcWidth(); }, []); + let assetPath = "@assets/complete-quiz.png"; + let titleText = "Daily 용어 퀴즈 완료 🎉"; + let subTitleText1 = "Daily 용어 퀴즈를 모두 맞춰"; + let subTitleText2 = `200포인트`; + let subTitleText3 = "를 얻었어요!"; + let subTitleText4 = "내일도 Daily 용어 퀴즈를 응시해보세요"; + + if (route.params.id == 2202) { + // 데일리 퀴즈 결과 제출 성공 (200) + titleText = "Daily 용어 퀴즈 완료 🎉"; + subTitleText1 = "Daily 용어 퀴즈를 모두 맞춰"; + subTitleText2 = `200포인트`; + subTitleText3 = "를 얻었어요!"; + subTitleText4 = "내일도 Daily 용어 퀴즈를 응시해보세요"; + } + if (route.params.id == 2212) { + // 복습 퀴즈 첫 번째 시도에 모두 정답 + titleText = "용어 복습 퀴즈 완료 🎉"; + subTitleText1 = "용어 복습 퀴즈를 모두 맞춰"; + subTitleText2 = `50포인트`; + subTitleText3 = "를 얻었어요!"; + subTitleText4 = "내일도 Daily 용어 퀴즈를 응시해보세요"; + } + if (route.params.id == 2213) { + // 복습 퀴즈 첫 번째 시도에 한 개 이상 오답 + titleText = "용어 복습 퀴즈 완료 🎉"; + subTitleText1 = "용어 복습 퀴즈 응시로"; + subTitleText2 = `10포인트`; + subTitleText3 = "를 얻었어요!"; + subTitleText4 = "3분 후 용어 복습 퀴즈로 학습해보세요"; + } + if (route.params.id == 2214) { + // 복습 퀴즈 두 번 이상째 시도에 모두 정답 + titleText = "용어 복습 퀴즈 완료 🎉"; + subTitleText1 = "용어 복습 퀴즈를 모두 맞췄어요!"; + subTitleText2 = ``; + subTitleText3 = "내일도 Daily 용어 퀴즈를 응시해보세요"; + subTitleText4 = ""; + } + if (route.params.id == 2215) { + // 복습 퀴즈 두 번 이상째 시도에 한 개 이상 오답 + titleText = "용어 복습 퀴즈 완료 🎉"; + subTitleText1 = "용어 복습 퀴즈를 재응시했어요!"; + subTitleText2 = ``; + subTitleText3 = "3분 후 용어 복습 퀴즈로 학습해보세요"; + subTitleText4 = ""; + } + return ( - navigation.pop()} /> + navigation.pop()} + /> { /> - Daily 용어 퀴즈 완료 🎉 + {titleText} - Daily 용어 퀴즈를 모두 맞춰 + {subTitleText1} - {score}포인트 + {subTitleText2} - 를 얻었어요! + {subTitleText3} - 내일도 Daily 용어 퀴즈를 응시해보세요. + {subTitleText4} Date: Tue, 3 Oct 2023 21:45:58 +0900 Subject: [PATCH 09/10] =?UTF-8?q?chore:=20QuizResult=20=EB=B6=80=EB=B6=84?= =?UTF-8?q?=20=EB=84=A4=EB=B9=84=EA=B2=8C=EC=9D=B4=ED=84=B0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TERMTERM/Container.tsx | 8 ++------ TERMTERM/src/interfaces/RootStackParamList.ts | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/TERMTERM/Container.tsx b/TERMTERM/Container.tsx index 8bb6dac..93dc632 100644 --- a/TERMTERM/Container.tsx +++ b/TERMTERM/Container.tsx @@ -486,11 +486,9 @@ const Container = () => { headerShown: true, header: (props) => { return ( - props.navigation.pop()} - onBookmark={() => null} - bookmarked={false} /> ); }, @@ -575,11 +573,9 @@ const Container = () => { headerShown: true, header: (props) => { return ( - props.navigation.pop()} - onBookmark={() => null} - bookmarked={false} /> ); }, diff --git a/TERMTERM/src/interfaces/RootStackParamList.ts b/TERMTERM/src/interfaces/RootStackParamList.ts index 1167a31..ee6a4dc 100644 --- a/TERMTERM/src/interfaces/RootStackParamList.ts +++ b/TERMTERM/src/interfaces/RootStackParamList.ts @@ -15,7 +15,7 @@ export type RootStackParamList = { My: undefined; ArchiveBookmark: undefined; DailyQuiz: undefined; - CompleteQuiz: undefined; + CompleteQuiz: {id: number}; CurationDetail: { id: number }; MakeFolder: undefined; FolderDetailGlance: { id: number }; From 90d85d36578c14f80eebc14d2ac8378fac01dbc3 Mon Sep 17 00:00:00 2001 From: yoo-jimin127 Date: Tue, 3 Oct 2023 22:07:31 +0900 Subject: [PATCH 10/10] =?UTF-8?q?fix:=20=EC=9A=A9=EC=96=B4=20=ED=80=B4?= =?UTF-8?q?=EC=A6=88=20=EB=A6=AC=EB=B7=B0=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EA=B0=92=20=EB=A0=8C=EB=8D=94=20=EC=98=A4=EB=A5=98=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TERMTERM/src/screens/QuizReview.tsx | 23 +++-------------- TERMTERM/src/screens/QuizReviewDetail.tsx | 31 ++++++++++++++++++----- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/TERMTERM/src/screens/QuizReview.tsx b/TERMTERM/src/screens/QuizReview.tsx index 3fc37dd..301820d 100644 --- a/TERMTERM/src/screens/QuizReview.tsx +++ b/TERMTERM/src/screens/QuizReview.tsx @@ -3,9 +3,8 @@ import QuizReviewRouter from "@components/quiz/QuizReviewRouter"; import { useThemeStyle } from "@hooks/useThemeStyle"; import { RootStackParamList } from "@interfaces/RootStackParamList"; import { StackScreenProps } from "@react-navigation/stack"; -import { eachQuizAnswerResult, quizReviewList } from "@recoil/quizState"; -import { QuizReviewDetail } from "Quiz"; -import { useEffect, useState } from "react"; +import { quizReviewList } from "@recoil/quizState"; +import { useEffect } from "react"; import { SafeAreaView } from "react-native-safe-area-context"; import { useRecoilValue, useSetRecoilState } from "recoil"; import styled from "styled-components/native"; @@ -15,8 +14,6 @@ export type Props = StackScreenProps; const QuizReview = ({ navigation }: Props) => { const quizApi = new QuizApi(); const [COLOR, mode] = useThemeStyle(); - // const [quizReviewList, setQuizReviewList] = useState([]); - const setEachQuizAnswer = useSetRecoilState(eachQuizAnswerResult); const setQuizReviewList = useSetRecoilState(quizReviewList); const quizReviewLocalList = useRecoilValue(quizReviewList); @@ -24,20 +21,6 @@ const QuizReview = ({ navigation }: Props) => { try { const res = await quizApi.getFinalQuizReview(); - const updatedQuizReviewList: QuizReviewDetail[] = res.map((item) => ({ - termId: item.termId as number, - termName: item.termName as string, - termDescription: item.termDescription as string, - isAnswerRight: item.isAnswerRight as boolean, - bookmarked: "NO", - termSource: "", - wrongChoices: [], - })); - - setQuizReviewList(updatedQuizReviewList); - console.log("res : ", res); - console.log("quizReviewLocalList : ", quizReviewLocalList); - console.log("updatedQuizReviewList", updatedQuizReviewList); const termNameArr = res.map((item) => { return getMainTermName(item.termName); }); @@ -78,7 +61,7 @@ const QuizReview = ({ navigation }: Props) => { wordAnswer={item.termName} userAnswer={item.wrongChoices[0]} onPress={() => - navigation.navigate("QuizReviewDetail", { id: item.termId }) + navigation.navigate("QuizReviewDetail", { id: item.termId, item }) } /> ))} diff --git a/TERMTERM/src/screens/QuizReviewDetail.tsx b/TERMTERM/src/screens/QuizReviewDetail.tsx index ab37564..8719c35 100644 --- a/TERMTERM/src/screens/QuizReviewDetail.tsx +++ b/TERMTERM/src/screens/QuizReviewDetail.tsx @@ -1,6 +1,6 @@ import styled from "styled-components/native"; import { useEffect, useState } from "react"; -import { StackScreenProps } from "@react-navigation/stack"; +import { StackNavigationProp, StackScreenProps } from "@react-navigation/stack"; import { RootStackParamList } from "@interfaces/RootStackParamList"; import { colorTheme } from "@style/designSystem"; import { SafeAreaView } from "react-native-safe-area-context"; @@ -15,26 +15,45 @@ import { import QuizAnswerCard from "@components/terms/QuizAnswerCard"; import { eachQuizAnswerResult, quizState } from "@recoil/quizState"; import { useRecoilValue, useSetRecoilState } from "recoil"; +import { useNavigation } from "@react-navigation/native"; +import { QuizAnswerResult, QuizReviewDetail } from "Quiz"; -export type Props = StackScreenProps; +// export type Props = StackScreenProps; +export type Props = { + route: { + params: { + id: number; + item: QuizReviewDetail; + }; + }; +}; -const QuizReViewDetail = ({ navigation, route }: Props) => { +const QuizReViewDetail = ({ route }: Props) => { + const navigation = useNavigation>() const [COLOR, mode] = useThemeStyle(); const [answer, setAnswer] = useState(); const curr = useRecoilValue(quizState); const { currIdx } = curr; const quizResult = useRecoilValue(eachQuizAnswerResult); + const answerCardWord: QuizAnswerResult = { + termId: route.params.item.termId, + termName: route.params.item.termName, + termDescription: route.params.item.termDescription, + memberSelectedTermName: route.params.item.wrongChoices[0], + isAnswerRight: route.params.item.isAnswerRight, + statusCode: 200 + } return (