diff --git a/web-chat/src/Room.tsx b/web-chat/src/Room.tsx index 51fc17127f..07712b201b 100644 --- a/web-chat/src/Room.tsx +++ b/web-chat/src/Room.tsx @@ -3,7 +3,7 @@ import { Grid, List, ListItem, - ListItemText, Paper + ListItemText } from '@material-ui/core'; import React from 'react'; import MessageInput from './MessageInput'; @@ -37,12 +37,12 @@ export default class Room extends React.Component { - {this.renderLines()} + - + @@ -55,23 +55,26 @@ export default class Room extends React.Component { ); } - - // TODO: Make it own component - renderLines() { - const renderedLines = []; - - for (const line of this.props.lines) { - renderedLines.push( - - ); - } - - return ( - - {renderedLines} - - ); - } } + +interface LinesProps { + messages: string[] +} + +const Lines = (props: LinesProps) => { + const renderedLines = []; + + for (const line of props.messages) { + renderedLines.push( + + ); + } + + return ( + + {renderedLines} + + ); +};