Skip to content

Conversation

@Joshcho426
Copy link
Collaborator

📚 개요

  • 통계 페이지 구현 및 API 연동 완료했습니다!
image image

🕐 리뷰 예상 시간

5m

❗❗ 중요한 변경점(Option)

리뷰가 비교적 꼼꼼히 이루어져야할 부분이나 파일을 여기다 적어주거나
해당 로직에 직접 코멘트를 달아도 좋습니다

Comment on lines 93 to 94
const [strengths, setStrengths] = useState<string[]>([]);
const [weaknesses, setWeaknesses] = useState<string[]>([]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

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
? '지금 당장 공부하러 가볼까요?'
: ''}
Copy link
Collaborator

Choose a reason for hiding this comment

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

ternary 중첩은 진짜 지양해야 합니다...
if문으로 해결하던가 해주세요!

Copy link
Collaborator

@Ji-InPark Ji-InPark left a comment

Choose a reason for hiding this comment

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

이거만 반영하고 머지해주세요~

<StatisticsTextContainer key={message} isSurpassed={isSurpassed}>
{data.map((category, index) => (
<StatisticsCategory key={index}>
{CARD_CATEGORY_KO[category as CardCategory]}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{CARD_CATEGORY_KO[category as CardCategory]}
{CARD_CATEGORY_KO[category]}

@Joshcho426 Joshcho426 merged commit 3569241 into main Aug 28, 2025
1 check passed
@Joshcho426 Joshcho426 deleted the feature/statistics branch August 28, 2025 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants