Skip to content

Commit

Permalink
feat(table): improve player name visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermebkel authored Mar 24, 2024
1 parent 3ed3e48 commit 6de9ab9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/unoenty/src/pages/Table/CardDeck/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const CardDeck: React.FC<CardDeckProps> = (props) => {
const socket = useSocket()
const classes = useStyles()
const customClasses = useCustomStyles({
limitedNameWidth: 70,
limitedNameWidth: 120,
avatarTimerRemainingPercentage: buildPercentage(
socketStore.gameRoundRemainingTimeInSeconds as number,
socketStore.game?.maxRoundDurationInSeconds as number,
Expand Down Expand Up @@ -330,7 +330,7 @@ const CardDeck: React.FC<CardDeckProps> = (props) => {
<Grid item>
<Typography
variant="h3"
className={`${classes.title} ${customClasses.limitedName}`}
className={`${classes.playerName} ${customClasses.limitedName}`}
>
{player?.name}
</Typography>
Expand Down
3 changes: 2 additions & 1 deletion packages/unoenty/src/pages/Table/CardDeck/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ const useStyles = makeStyles((theme) => ({
color: colors.grayScale[12],
fontWeight: "lighter",
},
title: {
playerName: {
fontSize: 16,
fontWeight: "bold",
color: colors.grayScale[13],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const CardDeckPlaceholder: React.FC<CardDeckPlaceholderProps> = (props) => {
const positionStyles = cardDeckPlaceholderPositionStylesMap[position]

const customClasses = useCustomStyles({
limitedNameWidth: 50,
limitedNameWidth: 80,
avatarTimerRemainingPercentage: buildPercentage(
socketStore.gameRoundRemainingTimeInSeconds as number,
socketStore.game?.maxRoundDurationInSeconds as number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const useStyles = makeStyles((theme) => ({
opacity: (props: UseStylesProps) => `${props.isCurrentRoundPlayer ? 1 : 0.5}`,
},
playerName: {
fontSize: 14,
fontWeight: "bold",
color: (props: UseStylesProps) => `${props.isCurrentRoundPlayer ? colors.palette.yellow1 : colors.grayScale[12]}`,
marginBottom: theme.spacing(1),
Expand Down

0 comments on commit 6de9ab9

Please sign in to comment.