diff --git a/src/components/MessageList.jsx b/src/components/MessageList.jsx index 6eac1acdf..eddffa754 100644 --- a/src/components/MessageList.jsx +++ b/src/components/MessageList.jsx @@ -11,15 +11,32 @@ const styles = { fontSize: '13px', fontStyle: 'italic' }, - sent: { + bubble: { + color: 'white', + padding: '10px', + borderRadius: '5px', + marginBottom: '10px', fontSize: '13px', - textAlign: 'right', - marginLeft: '24px' + fontWeight: 'normal', + }, + sentBubble: { + marginRight: '10px', + marginLeft: '20%', + backgroundColor: 'rgb(33, 150, 243)', + // Mobile + '@media(max-width: 450px)': { + marginLeft: '30px' + }, + }, + receivedBubble: { + marginLeft: '10px', + marginRight: '20%', + backgroundColor: '#AAAAAA', + // Mobile + '@media(max-width: 450px)': { + marginRight: '30px' + }, }, - received: { - fontSize: '13px', - marginRight: '24px' - } } const MessageList = function MessageList(props) { @@ -41,15 +58,19 @@ const MessageList = function MessageList(props) { return ( - {messages.map(message => ( - - ))} + {messages.map(message => { + const specialStyle = message.isFromContact ? styles.receivedBubble : styles.sentBubble + const style = Object.assign({}, styles.bubble, specialStyle) + return ( + + ) + })} {optOutItem} )