diff --git a/src/client/components/App.js b/src/client/components/App.js index 2f9b7fe..955f003 100644 --- a/src/client/components/App.js +++ b/src/client/components/App.js @@ -1,10 +1,10 @@ -import Alerts, { AlertPropType } from './Alerts.js' import * as constants from '../constants.js' -import Toolbar from './Toolbar.js' -import Notifications, { NotificationPropTypes } from './Notifications.js' +import Alerts, { AlertPropType } from './Alerts.js' import Chat, { MessagePropTypes } from './Chat.js' +import Notifications, { NotificationPropTypes } from './Notifications.js' import PropTypes from 'prop-types' import React from 'react' +import Toolbar from './Toolbar.js' import Video, { StreamPropType } from './Video.js' import _ from 'underscore' @@ -25,10 +25,24 @@ export default class App extends React.PureComponent { constructor () { super() this.state = { - videos: {} + videos: {}, + chatVisible: false } - this.chatRef = React.createRef() - this.toolbarRef = React.createRef() + } + handleShowChat = () => { + this.setState({ + chatVisible: true + }) + } + handleHideChat = () => { + this.setState({ + chatVisible: false + }) + } + handleToggleChat = () => { + return this.state.chatVisible + ? this.handleHideChat() + : this.handleShowChat() } componentDidMount () { const { init } = this.props @@ -53,22 +67,21 @@ export default class App extends React.PureComponent { return (