import React from 'react'; import { Typography } from '@material-ui/core'; import './Thread.css'; const Thread = (props) => props.messages.map((m, midx) => { const userUid = window.localStorage.getItem('watchPartyUserUid'); if (m.uid === '') { return ( {m.text} ); } else if (m.uid === userUid) { return (
0 ? (props.messages[midx - 1].uid !== m.uid ? '' : 'no-space') : '' }`} key={m.id} > {m.type === 'giphy' ? ( giphy gif ) : ( {m.text} )} {new Date(m.time).toLocaleTimeString()}
); } else { return (
0 ? (props.messages[midx - 1].uid !== m.uid ? '' : 'no-space') : '' }`} key={m.id} > {midx > 0 ? (props.messages[midx - 1].uid !== m.uid ? m.name : '') : m.name} {m.type === 'giphy' ? ( giphy gif ) : ( {m.text} )} {new Date(m.time).toLocaleTimeString()}
); } }); export default Thread;