bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/nav-bar/component.jsx
2016-10-11 10:36:28 -07:00

67 lines
1.8 KiB
JavaScript
Executable File

import React, { Component, PropTypes } from 'react';
import styles from './styles.scss';
import Button from '../button/component';
import RecordButton from './recordbutton/component';
import SettingsDropdown from './settings-dropdown/component';
const propTypes = {
presentationTitle: PropTypes.string.isRequired,
hasUnreadMessages: PropTypes.bool.isRequired,
beingRecorded: PropTypes.bool.isRequired,
};
const defaultProps = {
presentationTitle: 'Default Room Title',
hasUnreadMessages: false,
beingRecorded: false,
};
class NavBar extends Component {
constructor(props) {
super(props);
this.handleToggleUserList = this.handleToggleUserList.bind(this);
}
handleToggleUserList() {
this.props.toggleUserList();
}
render() {
const { presentationTitle, hasUnreadMessages, beingRecorded } = this.props;
document.title = presentationTitle;
return (
<div className={styles.navbar}>
<div className={styles.left}>
<Button
onClick={this.handleToggleUserList}
ghost={true}
circle={true}
hideLabel={true}
label={'Toggle User-List'}
icon={'user'}
className={styles.btn}
/>
</div>
{hasUnreadMessages ? <span className={styles.withdot}></span> : null}
<div className={styles.center}>
<h1 className={styles.presentationTitle}>{presentationTitle}</h1>
<span className={styles.divideBar}> | </span>
<div className={styles.record}>
<RecordButton beingRecorded={beingRecorded}/>
</div>
</div>
<div className={styles.right}>
<SettingsDropdown />
</div>
</div>
);
}
}
NavBar.propTypes = propTypes;
NavBar.defaultProps = defaultProps;
export default NavBar;