You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
822 B
38 lines
822 B
import React, { Component } from 'react'; |
|
import Header from './Header'; |
|
import Body from './Body'; |
|
import Info from './Info'; |
|
import './index.scss'; |
|
export default class ChatRoom extends Component { |
|
constructor(props) { |
|
super(props); |
|
window.nav = this.nav.bind(this); |
|
this.state = { |
|
page: 'chatroom', |
|
}; |
|
} |
|
nav = (url) => { |
|
this.props.history.push(url); |
|
}; |
|
setPage = (val) => { |
|
this.setState({ |
|
page: val, |
|
}); |
|
}; |
|
render() { |
|
return ( |
|
<div className="chat-room d-flex flex-column"> |
|
<Header page={this.state.page} setPage={this.setPage} /> |
|
{this.state.page === 'chatroom' ? ( |
|
<> |
|
<Body setPage={this.setPage} /> |
|
</> |
|
) : ( |
|
<> |
|
<Info /> |
|
</> |
|
)} |
|
</div> |
|
); |
|
} |
|
}
|
|
|