Skip to content

Commit

Permalink
better format for player chat (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
danbastin authored Feb 28, 2025
1 parent 94311bc commit ce5e099
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/app/_components/_sharedcomponents/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ const Chat: React.FC<IChatProps> = ({
</Typography>
)
} else if (message[0].type === 'playerChat') {
const stringMessage = message.map((item: IChatObject | string) => typeof item === 'object' ? item.name : item).join('');
return (
<Typography key={index} sx={styles.messageText}>
<Typography component="span" sx={{ color: connectedPlayer === message[0].id ? 'var(--initiative-blue)' : 'var(--initiative-red)' }}>
{stringMessage}
{message[0].name}
</Typography>:
{message.slice(1).join('')}
</Typography>
Expand Down

0 comments on commit ce5e099

Please sign in to comment.