Skip to content

Commit

Permalink
Merge pull request #201 from TheUpperPart/Feat/#185
Browse files Browse the repository at this point in the history
Feat: 점수별로 등수 정렬
  • Loading branch information
navyjeongs authored Oct 30, 2023
2 parents fc7bf68 + 4ed92e6 commit 81007ff
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/components/Bracket/BracketContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,26 @@ const BracketContents = (props: Props) => {
{match.matchPlayerInfoList.length === 0 ? (
<MatchNoGame>아직 대진표가 생성되지 않았어요 :(</MatchNoGame>
) : (
match.matchPlayerInfoList.map((user) => {
return (
<UserContainer myself={user.gameId === data.myGameId}>
<UserImgContainer>
{user.profileSrc ? (
<UserImg src={user.profileSrc} alt='profile' width={30} height={30} />
) : (
<UserNameImg>
<UserNameImgText>{user.gameId.substring(0, 2)}</UserNameImgText>
</UserNameImg>
)}
</UserImgContainer>

<UserName>{user.gameId}</UserName>
<UserScore>{user.score}</UserScore>
</UserContainer>
);
})
match.matchPlayerInfoList
.sort((a, b) => b.score - a.score)
.map((user) => {
return (
<UserContainer myself={user.gameId === data.myGameId}>
<UserImgContainer>
{user.profileSrc ? (
<UserImg src={user.profileSrc} alt='profile' width={30} height={30} />
) : (
<UserNameImg>
<UserNameImgText>{user.gameId.substring(0, 2)}</UserNameImgText>
</UserNameImg>
)}
</UserImgContainer>

<UserName>{user.gameId}</UserName>
<UserScore>{user.score}</UserScore>
</UserContainer>
);
})
)}
</MatchContent>
</MatchContainer>
Expand Down

0 comments on commit 81007ff

Please sign in to comment.