Provide player name in message secondary text
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
3a6a037e14
commit
81c54fba4a
@ -308,10 +308,15 @@ const Chat = ({ board, promoteGameState }) => {
|
|||||||
//const timeDelta = game.timestamp - Date.now();
|
//const timeDelta = game.timestamp - Date.now();
|
||||||
const messages = board.game.chat.map((item, index) => {
|
const messages = board.game.chat.map((item, index) => {
|
||||||
/* If the date is in the future, set it to now */
|
/* If the date is in the future, set it to now */
|
||||||
|
const name = getPlayerName(board.game.sessions, item.from),
|
||||||
|
from = name ? `${name}, ` : '';
|
||||||
return (
|
return (
|
||||||
<ListItem key={`msg-${item.date}`}>
|
<ListItem key={`msg-${item.date}`}>
|
||||||
<PlayerColor color={item.from}/>
|
<PlayerColor color={item.from}/>
|
||||||
<ListItemText primary={item.message} secondary={(<Moment fromNow date={item.date > Date.now() ? Date.now() : item.date} interval={1000}/>)} />
|
<ListItemText primary={item.message}
|
||||||
|
secondary={(<>{from}
|
||||||
|
<Moment fromNow date={item.date > Date.now() ?
|
||||||
|
Date.now() : item.date} interval={1000}/></>)} />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user