Skip to content

Commit

Permalink
Merge pull request #23 from intern0t/join-rooms
Browse files Browse the repository at this point in the history
Join room works, yet to clean up & make the join process smooth.
  • Loading branch information
intern0t committed Jan 12, 2019
2 parents f46056d + 87dd756 commit e3d325c
Show file tree
Hide file tree
Showing 6 changed files with 281 additions and 21 deletions.
23 changes: 17 additions & 6 deletions src/components/Brightbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class Brightbar extends Component {
note: "",
key: "",
keyVisible: false
}
},
newConversationModalDisplayed: false
};

onFilterChange = e => {
Expand Down Expand Up @@ -86,6 +87,13 @@ class Brightbar extends Component {
}));
};

toggleNewConversationModal = () => {
this.setState(prevState => ({
...prevState,
newConversationModalDisplayed: !prevState.newConversationModalDisplayed
}));
};

render() {
return (
<AppConsumer>
Expand All @@ -96,8 +104,6 @@ class Brightbar extends Component {
rooms,
messages,
nickname,
toggleNewConversationModal,
newConversationModalDisplayed,
generatedRoomID,
generateRoomID,
activeRoomID
Expand All @@ -114,7 +120,10 @@ class Brightbar extends Component {
}}
>
<ConversationSearch
toggle={toggleNewConversationModal}
toggle={
this.state
.toggleNewConversationModal
}
onChange={this.onFilterChange}
clearFilter={this.clearFilter}
filterBy={this.state.filterBy}
Expand Down Expand Up @@ -142,7 +151,8 @@ class Brightbar extends Component {
</ul>
<Modal
style={{
display: newConversationModalDisplayed
display: this.state
.newConversationModalDisplayed
? "flex"
: "none"
}}
Expand All @@ -155,7 +165,8 @@ class Brightbar extends Component {
this.state.newRoomInfo.note
}
close={
toggleNewConversationModal
this.state
.toggleNewConversationModal
}
generate={generateRoomID}
generated={generatedRoomID}
Expand Down

0 comments on commit e3d325c

Please sign in to comment.