-
Notifications
You must be signed in to change notification settings - Fork 2
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: 새로운 리뷰 작성 정보 API를 반영하기 위한 리뷰 작성 페이지의 카드 상태 처리 변경 #299
Conversation
- 추후에 답변 상태를 업데이트하는 방향으로 변경할 예정
…tingCard 생성 - 답변들이 유효할 경우 다음 버튼 활성화 - 이전, 다음 버튼 클릭 시 캐러셀 작동 - review-wrting-form 경로의 element를 ReviewWritingCardFormPage 으로 변경
- 카드 넘기기, 제출, 미리보기등의 버튼을 담는 CardSliderController 합성 컴포넌트 생성 및 적용
- QnABox의 객관식 문항 관련 코드는 useMultipleChoice, 서술형 관련 코드는 useTextAnswer 훅으로 분리 - upatedAnswerMap -> upatedAnswerMap 네이밍 변경
- 객관식, 서술형에서 유효한 답일 경우에난 answerMap (서버에 제출되는 답변)에 유효한 값이 업데이트 되고 그렇지 않으면 (객관식:selectedOptionIds , 서술형:text) null로 변경 - 다음 버튼 활성화 여부는 answerMap 에서 현재 보여지는 card에 속하는 해당 answer의 유효한 답변이 있는지 여부만 검사
- useSlideWidth -> useSlideWidthAndHeight로 변경 - 현재 보여주는 slide의 높이에 따라 slideContainer의 높이가 결정되게 함
-. CardSliderControllerProps를 확장해서 중복되는 타입 선언을 피할 수 있도록 함
- 기존의 ReviewWritingCardFormPage의 내용을 CardForm으로 이동
…eview-me into fe/feat/291-review_writing_from_state
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.
정말 고생 많았어요👍
🚀 어떤 기능을 구현했나요 ?
🔥 어떻게 해결했나요 ?
ReviewWritingCardFormPage 설명
구조도
컴포넌트 설명
1. ReviewWritingCardFromPage
2. CardForm
Form
과 관련됨3. CardSliderController
4. QnABox
question
과 관련됨5. ReviewWritingCard
section
과 관련됨훅 설명
1.useCurrentCardIndex
2.useMultipleChoice
3. useQuestionList
4. useReviewerAnswer
5. useSliderWidthAndHeight
6. useTextAnswer
4. 답변 관련 유의 사항
⚠️ 객관식과 서술형의 경우, 해당 형식에 대한 훅에서 유효성 검사를 진행하고 답변이 유효한 경우에만 answerMap에 업데이트 됨, 유효하지 않으면 해당 답변의 값이 null 로 변경돼요.
객관식, 서술형 답변 시 answerMap의 상태를 업데이트하면, 다음 버튼 활성화 등을 위해서 또 한번 답변의 유효성을 검증해야하는 상황이 반복돼요. 그래서 리뷰어가 작성한 답변들을 화면에 표시하되, 관련 훅 내에서 답이 유효한 답인 경우에만 answerMap에 그 값이 들어가고 유효하지 않으면 null로 변경해서, 다음 버튼 활성화를 판단하는 곳(
useReviewerAnswer
)에서는 해당 답변이 존재하는 지 여부만으로 판단할 수 있어요.📝 어떤 부분에 집중해서 리뷰해야 할까요?
📚 참고 자료, 할 말