2016-04-29 03:02:51 +08:00
|
|
|
import React, { Component, PropTypes } from 'react';
|
2016-05-04 04:40:46 +08:00
|
|
|
import styles from './styles.scss';
|
|
|
|
import { withRouter } from 'react-router';
|
2016-05-20 21:44:27 +08:00
|
|
|
import Button from '../button/component';
|
2016-06-18 06:15:11 +08:00
|
|
|
import RecordButton from './recordbutton/component';
|
2016-04-29 03:02:51 +08:00
|
|
|
|
|
|
|
const propTypes = {
|
|
|
|
presentationTitle: PropTypes.string.isRequired,
|
|
|
|
hasUnreadMessages: PropTypes.bool.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
const defaultProps = {
|
2016-05-04 04:40:46 +08:00
|
|
|
presentationTitle: 'Default Room Title',
|
2016-04-29 03:02:51 +08:00
|
|
|
hasUnreadMessages: false,
|
|
|
|
};
|
|
|
|
|
2016-05-04 22:48:53 +08:00
|
|
|
class NavBar extends Component {
|
2016-04-29 03:02:51 +08:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
2016-05-04 04:40:46 +08:00
|
|
|
|
|
|
|
this.handleToggleUserList = this.handleToggleUserList.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
handleToggleUserList() {
|
|
|
|
/*
|
|
|
|
TODO: Find out how to get the current route here
|
|
|
|
so we can change the click behavior
|
|
|
|
*/
|
2016-05-10 03:19:52 +08:00
|
|
|
this.props.router.push('/users');
|
2016-04-29 03:02:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { presentationTitle } = this.props;
|
2016-06-18 06:15:11 +08:00
|
|
|
document.title = presentationTitle
|
|
|
|
|
2016-04-29 03:02:51 +08:00
|
|
|
return (
|
2016-05-21 00:29:55 +08:00
|
|
|
<div className={styles.navbar}>
|
|
|
|
<div className={styles.left}>
|
|
|
|
<Button
|
|
|
|
onClick={this.handleToggleUserList}
|
|
|
|
ghost={true}
|
|
|
|
circle={true}
|
2016-06-18 00:42:17 +08:00
|
|
|
hideLabel={true}
|
|
|
|
label={'Toggle User-List'}
|
2016-05-21 00:39:58 +08:00
|
|
|
icon={'user'}
|
2016-06-07 22:33:22 +08:00
|
|
|
className={styles.btn}
|
2016-05-21 00:29:55 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div className={styles.center}>
|
|
|
|
<h1 className={styles.presentationTitle}>{presentationTitle}</h1>
|
2016-06-18 06:15:11 +08:00
|
|
|
<span className={styles.divideBar}> | </span>
|
2016-06-24 22:48:09 +08:00
|
|
|
<div className={styles.record}>
|
|
|
|
<RecordButton />
|
|
|
|
</div>
|
2016-05-21 00:29:55 +08:00
|
|
|
</div>
|
|
|
|
<div className={styles.right}>
|
|
|
|
<span id="settingsButtonPlaceHolder"></span>
|
|
|
|
</div>
|
2016-04-29 03:02:51 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-04 22:48:53 +08:00
|
|
|
NavBar.propTypes = propTypes;
|
|
|
|
NavBar.defaultProps = defaultProps;
|
2016-05-04 04:40:46 +08:00
|
|
|
|
2016-05-04 22:48:53 +08:00
|
|
|
export default withRouter(NavBar);
|