import React, { PropTypes } from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import pluralize from 'pluralize'; import { IndexLink } from 'react-router'; import { IconMenu, Menu, MenuItem } from 'react-toolbox/lib/menu'; import Avatar from 'react-toolbox/lib/avatar'; import AppBar from 'react-toolbox/lib/app_bar'; import FontIcon from 'react-toolbox/lib/font_icon'; import FindBar from '../FindBar/FindBar'; import styles from './AppHeader.css'; export default class AppHeader extends React.Component { static propTypes = { user: ImmutablePropTypes.map.isRequired, collections: ImmutablePropTypes.orderedMap.isRequired, commands: PropTypes.array.isRequired, // eslint-disable-line defaultCommands: PropTypes.array.isRequired, // eslint-disable-line runCommand: PropTypes.func.isRequired, toggleNavDrawer: PropTypes.func.isRequired, onCreateEntryClick: PropTypes.func.isRequired, onLogoutClick: PropTypes.func.isRequired, }; state = { createMenuActive: false, userMenuActive: false, }; handleCreatePostClick = (collectionName) => { const { onCreateEntryClick } = this.props; if (onCreateEntryClick) { onCreateEntryClick(collectionName); } }; handleCreateButtonClick = () => { this.setState({ createMenuActive: true, }); }; handleCreateMenuHide = () => { this.setState({ createMenuActive: false, }); }; handleRightIconClick = () => { this.setState({ userMenuActive: !this.state.userMenuActive, }); }; render() { const { user, collections, commands, defaultCommands, runCommand, toggleNavDrawer, onLogoutClick, } = this.props; const { createMenuActive, userMenuActive, } = this.state; return ( Log out } onLeftIconClick={toggleNavDrawer} onRightIconClick={this.handleRightIconClick} > { collections.valueSeq().map(collection => ) } ); } }