Conversation
There was a problem hiding this comment.
Code Review
This pull request expands the application to support basketball by introducing sport-specific types, hooks, and components, including a new basketball game page and a quarter-based scoreboard. The routing and navigation were updated to handle sport types via query parameters. Review feedback highlights the need for more robust logic in the basketball scoreboard to handle multiple overtime periods and correct team matching by ID. Suggestions were also made to improve table accessibility and ensure consistent terminology for free throws in the game timeline.
I am having trouble creating individual review comments. Click here to see my feedback.
apps/spectator/src/app/games/basketball/_components/score-board.tsx (18-28)
현재 로직은 연장전(OT)이 1회인 경우만 처리하고 있으며, scores 배열의 순서가 항상 [홈, 어웨이]라고 가정하고 있어 위험합니다. 농구는 여러 번의 연장전이 발생할 수 있으므로 quarterScores의 길이에 맞춰 동적으로 라벨을 생성하고, gameTeamId를 사용하여 정확한 팀의 점수를 매칭하는 것이 좋습니다.
const labels = quarterScores.length > 4
? quarterScores.map(qs => qs.displayName)
: BASE_LABELS;
const scores = quarterScores.reduce(
(acc, { scores: qScores }, index) => {
const homeScore = qScores.find(s => s.gameTeamId === homeTeam.gameTeamId)?.score;
const awayScore = qScores.find(s => s.gameTeamId === awayTeam.gameTeamId)?.score;
acc.home[index] = homeScore ?? null;
acc.away[index] = awayScore ?? null;
return acc;
},
{ home: Array(labels.length).fill(null), away: Array(labels.length).fill(null) },
);
apps/spectator/src/app/games/basketball/_components/score-board.tsx (31-67)
팀명 영역과 스코어 테이블이 별도의 레이아웃 요소로 분리되어 있어, 데이터 길이에 따라 행(row)의 높이가 어긋날 가능성이 있습니다. 또한 웹 접근성(A11y) 측면에서도 팀명을 테이블의 첫 번째 열(th 또는 td)로 포함하여 하나의 table 구조로 관리하는 것이 더 견고합니다.
apps/spectator/src/app/games/_components/cheer-talk/cheer-talk-timeline.tsx (67)
농구 경기에서 1점 득점은 보통 '자유투'로 표현됩니다. _utils.tsx에 정의된 로직과 일관성을 유지하기 위해 1점인 경우 '자유투'로 표시하는 것이 적절해 보입니다.
{teamName} {playerName} {scoreRecord.score === 1 ? '자유투' : `${scoreRecord.score}점슛`} 성공!
✅ 작업 내용
📝 참고 자료
♾️ 기타