-
Notifications
You must be signed in to change notification settings - Fork 3
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
[FE] feat#2 채점하기 #234
[FE] feat#2 채점하기 #234
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
유현님!! 너무 고생 많으셨습니다! 최고최고🥺
Last Quiz ID는 우선 이게 최선일 것 같다는 생각이 듭니다.. ㅠㅠ
그래도 최고!! 선 Approve 할게요 :)
flexCenter, | ||
} from "../../../design-system/tokens/utils.css"; | ||
|
||
const BORDER_RADIUS = 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 8이 정말 자주쓰여서 borderRadius가 8인 스타일 따로 빼고 싶은데, 어떠세요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
너무 좋습니다! 8 쓸 때마다 토큰으로 만들어야 하나 고민했어요ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 지금 뺄까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 부탁드릴게요!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
괜찮습니다! 충분히 좋아요 ㅎㅎ
]); | ||
|
||
export const strong = style([ | ||
typography.$semantic.title3Bold, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 수정해주세용🥺 title4Regular 입니다!
근데 그러면 strong 태그가 안어울릴 것 같네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗! 반영했습니다 76032cf
|
||
setTimeout(() => { | ||
copyButtonRef.current?.classList.remove("visible"); | ||
}, 2000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해봤는데 1초가 좋을 것 같습니다! 매직넘버긴 하니까 해당 모듈 상단에 상수로만 분리해둘까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋아요~! c20df65에서 작업했습니다!
import * as styles from "./SolvedModal.css"; | ||
|
||
interface SolvedModalProps { | ||
link: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 지금 slug로 수정해두는게 좋을까요?👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
페이지 단에서 link를 만들어서 전달하도록 변경했습니다! 767baed
링크에 base url도 필요해서 .env.local, .env.production 으로 주입하도록 했습니다. 배포 스크립트를 변경해야 하는데 제가 포크한 레포에서 테스트해보겠습니다!
// .env.local
NEXT_PUBLIC_BASE_URL=http://localhost:3000
// .env.production
NEXT_PUBLIC_BASE_URL=https://git-challenge.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 좋아요!! 이거 까다로울 것 같으면 내일 같이해도 좋을 것 같습니당!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cb6fb3f 성공했습니다! 설정하는 방법은 내일까지 개발 위키에 작성해 놓을게요..!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😭 고생 많으셨습니다!! 머지하셔두 돼요!
setTimeout(() => { | ||
copyButtonRef.current?.classList.remove("visible"); | ||
}, 2000); | ||
onCopy?.(link); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onCopy가 무슨 역할을 하는 메서드인가요?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
페이지 단에서 링크 복사 성공했을 때 처리할 일이 있을까봐 만들었었는데 필요가 없네요😅 삭제했습니다!
{!lastQuiz ? ( | ||
<Button full variant="primaryFill" onClick={onNextQuiz}> | ||
다음 문제 풀래요 | ||
</Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{!lastQuiz ? ( | |
<Button full variant="primaryFill" onClick={onNextQuiz}> | |
다음 문제 풀래요 | |
</Button> | |
{!lastQuiz && ( | |
<Button full variant="primaryFill" onClick={onNextQuiz}> | |
다음 문제 풀래요 | |
</Button> | |
)} |
삼항 연산자로 null을 주신 이유가 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엇 예전에 &&
로 했다가 값 자체가 렌더링되길래 이후에 삼항 연산자만 썼었는데, 테스트 해보니까 boolean이면 잘 동작하네요!! 수정하겠습니다. 감사합니다🙇♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 그런 경험 있어서 긴가민가해서 해봤어요 ㅎㅎ 감사합니다😊
|
||
const LAST_QUIZ_ID = 19; | ||
|
||
export function useSolvedModal(id: number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useSolvedModal은 개인적으로 SolvedModal 컴포넌트 안에 있는게 더 자연스러울 것 같다고 생각해요! 컴포넌트 내부로 빼는건 찬성입니다 ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SolvedModal 폴더로 이동했습니다! 9295023
); | ||
|
||
return { | ||
lastQuiz: id === LAST_QUIZ_ID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오!!! 👍🏻👍🏻👍🏻
try { | ||
const response = await quizAPI.submit(+id); | ||
if (response.solved) { | ||
solvedModal.onSolved(response.link); | ||
return; | ||
} | ||
toast.error("다시 풀어보세요!"); | ||
} catch (error) { | ||
handleResponseError(error); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에러 처리... 저희 Error Boundary에 대해서 공부해보고 도입해보는건 어떤가요? 당장 해야할 건 아니긴한데 에러 바운더리가 저희에게 필요한게 맞다면 리팩터링에 필수적일 것 같다는 생각이 듭니다.. ㅠㅠ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 좋아요👍🏻👍🏻👍🏻
d137029
to
76032cf
Compare
872d1ba
to
12e0d3e
Compare
close #2
✅ 작업 내용
📸 스크린샷
정답 모달 스타일링
정답 모달 링크 복사 / 다음 문제 풀기 / 내 답안 보러가기
마지막 문제일 때 정답 모달
![image](https://private-user-images.githubusercontent.com/96400112/287691566-5df0da81-1364-47a9-97d9-44aa6b1d6326.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA5OTM1ODUsIm5iZiI6MTcyMDk5MzI4NSwicGF0aCI6Ii85NjQwMDExMi8yODc2OTE1NjYtNWRmMGRhODEtMTM2NC00N2E5LTk3ZDktNDRhYTZiMWQ2MzI2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE0VDIxNDEyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ3MTVhNTRmZjM2MDNiMTlhYWFjYmVmNTliZDdiODY2NWE4NTI4YTkxMmRjNTVlOGNhNDBlZjAxODU1ZDY3YjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.UddXDQROf70GGu8MccBej3W_2un8FfdOI_Vjop8oLyw)
풀이가 틀렸을 경우
📌 이슈 사항
useSolvedModal
훅에 하드 코딩했습니다.🟢 완료 조건
✍ 궁금한 점
SolvedModal
컴포넌트는 "components/quiz"에,useSolvedModal
은 "hooks"에 있습니다. 훅이 컴포넌트에 결합된 로직같은데, "components/quiz"에 넣는 건 이상할까요?