Skip to content

Commit

Permalink
Refactor game and login components
Browse files Browse the repository at this point in the history
  • Loading branch information
naueramant committed May 22, 2024
1 parent ab4823c commit 16873e7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
6 changes: 4 additions & 2 deletions src/views/Game/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ const Header: FunctionComponent = () => {
},
}}
>
Round {gameMetrics.currentRound} / {game.numberOfRounds}
Round {gameMetrics.currentRound.toString().padStart(2, "0")}/
{game.numberOfRounds}
</Typography>
<Stack
sx={{
Expand Down Expand Up @@ -187,7 +188,8 @@ const Header: FunctionComponent = () => {
},
}}
>
Card {gameMetrics.numberOfCardsDrawn} / {gameMetrics.numberOfCards}
Card {gameMetrics.numberOfCardsDrawn.toString().padStart(2, "0")}/
{gameMetrics.numberOfCards}
</Typography>
</Stack>

Expand Down
44 changes: 23 additions & 21 deletions src/views/Login/New/components/PlayerItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,27 +163,29 @@ const PlayerItem: FunctionComponent<PlayerItemProps> = (props) => {
</>
)}

{disabled ? (
<Avatar
sx={{
width: 56,
height: 56,
borderRadius: 0,
}}
src={player.avatar}
>
<CircularProgress color="inherit" size={24} />
</Avatar>
) : (
<Avatar
sx={{
width: 56,
height: 56,
borderRadius: 0,
}}
src={player.avatar}
/>
)}
<Conditional value={!isOffline}>
{disabled ? (
<Avatar
sx={{
width: 56,
height: 56,
borderRadius: 0,
}}
src={player.avatar}
>
<CircularProgress color="inherit" size={24} />
</Avatar>
) : (
<Avatar
sx={{
width: 56,
height: 56,
borderRadius: 0,
}}
src={player.avatar}
/>
)}
</Conditional>
</Stack>
</Box>

Expand Down

0 comments on commit 16873e7

Please sign in to comment.