Better names for methods. Fixes ESLint warnings.

This commit is contained in:
Andrey Okonetchnikov 2016-09-16 15:01:19 +02:00
parent 2fada62fff
commit 4da610a2b3

View File

@ -1,19 +1,13 @@
import React from 'react'; import React from 'react';
import pluralize from 'pluralize'; import pluralize from 'pluralize';
import { IndexLink } from 'react-router'; import { IndexLink } from 'react-router';
import { Menu, MenuItem, Button } from 'react-toolbox'; import { Menu, MenuItem, Button, IconButton } from 'react-toolbox';
import AppBar from 'react-toolbox/lib/app_bar'; import AppBar from 'react-toolbox/lib/app_bar';
import FindBar from '../FindBar/FindBar'; import FindBar from '../FindBar/FindBar';
import styles from './AppHeader.css'; import styles from './AppHeader.css';
export default class AppHeader extends React.Component { export default class AppHeader extends React.Component {
// props: {
// // collections: React.,
// // commands,
// // defaultCommands
// }
state = { state = {
createMenuActive: false createMenuActive: false
} }
@ -25,20 +19,26 @@ export default class AppHeader extends React.Component {
} }
} }
onCreateButtonClick = () => { handleCreateButtonClick = () => {
this.setState({ this.setState({
createMenuActive: true createMenuActive: true
}); });
} }
onCreateMenuHide = () => { handleCreateMenuHide = () => {
this.setState({ this.setState({
createMenuActive: false createMenuActive: false
}); });
} }
render() { render() {
const { collections, commands, defaultCommands, runCommand } = this.props; const {
collections,
commands,
defaultCommands,
runCommand,
toggleNavDrawer
} = this.props;
const { createMenuActive } = this.state; const { createMenuActive } = this.state;
return ( return (
@ -46,6 +46,11 @@ export default class AppHeader extends React.Component {
fixed fixed
theme={styles} theme={styles}
> >
<IconButton
icon="menu"
inverse
onClick={toggleNavDrawer}
/>
<IndexLink to="/"> <IndexLink to="/">
Dashboard Dashboard
</IndexLink> </IndexLink>
@ -59,12 +64,12 @@ export default class AppHeader extends React.Component {
icon='add' icon='add'
floating floating
accent accent
onClick={this.onCreateButtonClick} onClick={this.handleCreateButtonClick}
> >
<Menu <Menu
active={createMenuActive} active={createMenuActive}
position="topRight" position="topRight"
onHide={this.onCreateMenuHide} onHide={this.handleCreateMenuHide}
> >
{ {
collections.valueSeq().map(collection => collections.valueSeq().map(collection =>
@ -78,6 +83,7 @@ export default class AppHeader extends React.Component {
} }
</Menu> </Menu>
</Button> </Button>
</AppBar> </AppBar>
); );
} }