FEAT - 통계 페이지 구현 및 API 연동#37
Merged
Merged
Conversation
Ji-InPark
reviewed
Aug 28, 2025
Comment on lines
+93
to
+94
| const [strengths, setStrengths] = useState<string[]>([]); | ||
| const [weaknesses, setWeaknesses] = useState<string[]>([]); |
Collaborator
There was a problem hiding this comment.
Suggested change
| const [strengths, setStrengths] = useState<string[]>([]); | |
| const [weaknesses, setWeaknesses] = useState<string[]>([]); | |
| const [strengths, setStrengths] = useState<CardCategory[]>([]); | |
| const [weaknesses, setWeaknesses] = useState<CardCategory[]>([]); |
이렇게 바꾸면 아래에서 category as CardCategory 부분에서 as CardCategory를 제거할 수 있습니다.
Comment on lines
+131
to
+151
| {!allEqual | ||
| ? [ | ||
| { data: strengths, isSurpassed: true, message: '분야에 강하시네요!' }, | ||
| { data: weaknesses, isSurpassed: false, message: '분야를 조금 더 공부해보아요!' }, | ||
| ].map( | ||
| ({ data, isSurpassed, message }) => | ||
| data.length > 0 && ( | ||
| <StatisticsTextContainer key={message} isSurpassed={isSurpassed}> | ||
| {data.map((category, index) => ( | ||
| <StatisticsCategory key={index}> | ||
| {CARD_CATEGORY_KO[category as CardCategory]} | ||
| {index < data.length - 1 ? ', ' : ''} | ||
| </StatisticsCategory> | ||
| ))} | ||
| {message} | ||
| </StatisticsTextContainer> | ||
| ), | ||
| ) | ||
| : categories[0].accuracy == 0 | ||
| ? '지금 당장 공부하러 가볼까요?' | ||
| : ''} |
Collaborator
There was a problem hiding this comment.
ternary 중첩은 진짜 지양해야 합니다...
if문으로 해결하던가 해주세요!
Ji-InPark
approved these changes
Aug 28, 2025
| <StatisticsTextContainer key={message} isSurpassed={isSurpassed}> | ||
| {data.map((category, index) => ( | ||
| <StatisticsCategory key={index}> | ||
| {CARD_CATEGORY_KO[category as CardCategory]} |
Collaborator
There was a problem hiding this comment.
Suggested change
| {CARD_CATEGORY_KO[category as CardCategory]} | |
| {CARD_CATEGORY_KO[category]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📚 개요
🕐 리뷰 예상 시간
❗❗ 중요한 변경점(Option)
리뷰가 비교적 꼼꼼히 이루어져야할 부분이나 파일을 여기다 적어주거나
해당 로직에 직접 코멘트를 달아도 좋습니다