Messages start at bottom and flow upwards

This commit is contained in:
Logan Allen 2019-06-25 11:14:30 -07:00
parent d581c20fa1
commit cbf4a17573

View File

@ -201,7 +201,7 @@ export class ChatScreen extends Component {
.slice(messages.length - (50 * state.numPages), messages.length);
}
let chatMessages = messages.map(this.buildMessage);
let chatMessages = messages.reverse().map(this.buildMessage);
let peers = props.peers[state.station] || [window.ship];
return (
@ -214,7 +214,7 @@ export class ChatScreen extends Component {
numPeers={peers.length} />
</div>
<div
className="overflow-y-scroll pt3"
className="overflow-y-scroll pt3 flex flex-column-reverse"
style={{ height: 'calc(100% - 157px)' }}
onScroll={this.onScroll}>
{chatMessages}