diff --git a/src/components/UserList/index.js b/src/components/UserList/index.js index f4a2e8d..053f796 100644 --- a/src/components/UserList/index.js +++ b/src/components/UserList/index.js @@ -2,17 +2,22 @@ import React from 'react' import style from './index.module.css' export const UserList = ({ room, current, createConvo, removeUser }) => ( - +
+ + +
) diff --git a/src/index.js b/src/index.js index 4688580..aa06f97 100644 --- a/src/index.js +++ b/src/index.js @@ -54,7 +54,12 @@ class View extends React.Component { this.actions.scrollToEnd() }, - removeRoom: room => this.setState({ room: {} }), + removeRoom: room => { + this.state.user.leaveRoom({ + roomId: room.id, + }) + this.setState({ room: {} }) + }, joinRoom: room => { this.actions.setRoom(room) @@ -221,7 +226,7 @@ class View extends React.Component { sidebarOpen, userListOpen, } = this.state - const { createRoom, createConvo, removeUserFromRoom } = this.actions + const { createRoom, createConvo/*, removeUserFromRoom*/ } = this.actions return (
@@ -255,7 +260,7 @@ class View extends React.Component { room={room} current={user.id} createConvo={createConvo} - removeUser={removeUserFromRoom} + removeUser={this.actions.removeRoom} /> )}