fix linting, tests

This commit is contained in:
Matthew Taylor 2017-11-08 10:13:17 -05:00
parent 533e007ac9
commit e384c07e3d
3 changed files with 7 additions and 10 deletions

View file

@ -4,8 +4,6 @@ import Popover from 'react-popover';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import Button from '../button/button.jsx';
import styles from './dropdown.css'; import styles from './dropdown.css';
import dropdownIcon from './dropdown-caret.svg'; import dropdownIcon from './dropdown-caret.svg';
@ -14,19 +12,19 @@ class Dropdown extends React.Component {
constructor (props) { constructor (props) {
super(props); super(props);
bindAll(this, [ bindAll(this, [
'closePopover', 'handleClosePopover',
'toggleOpenState' 'handleToggleOpenState'
]); ]);
this.state = { this.state = {
isOpen: false isOpen: false
}; };
} }
closePopover () { handleClosePopover () {
this.setState({ this.setState({
isOpen: false isOpen: false
}); });
} }
toggleOpenState () { handleToggleOpenState () {
this.setState({ this.setState({
isOpen: !this.state.isOpen isOpen: !this.state.isOpen
}); });
@ -37,7 +35,7 @@ class Dropdown extends React.Component {
body={this.props.popoverContent} body={this.props.popoverContent}
isOpen={this.state.isOpen} isOpen={this.state.isOpen}
preferPlace="below" preferPlace="below"
onOuterAction={this.closePopover} onOuterAction={this.handleClosePopover}
{...this.props} {...this.props}
> >
<div <div
@ -45,7 +43,7 @@ class Dropdown extends React.Component {
[styles.modOpen]: this.state.isOpen, [styles.modOpen]: this.state.isOpen,
[styles.modClosed]: !this.state.isOpen [styles.modClosed]: !this.state.isOpen
})} })}
onClick={this.toggleOpenState} onClick={this.handleToggleOpenState}
> >
{this.props.children} {this.props.children}
<img <img

View file

@ -35,7 +35,6 @@ import styles from './paint-editor.css';
import groupIcon from './icons/group.svg'; import groupIcon from './icons/group.svg';
import redoIcon from './icons/redo.svg'; import redoIcon from './icons/redo.svg';
import rotationPointIcon from './icons/rotation-point.svg';
import sendBackIcon from './icons/send-back.svg'; import sendBackIcon from './icons/send-back.svg';
import sendBackwardIcon from './icons/send-backward.svg'; import sendBackwardIcon from './icons/send-backward.svg';
import sendForwardIcon from './icons/send-forward.svg'; import sendForwardIcon from './icons/send-forward.svg';

View file

@ -1,5 +1,5 @@
/* eslint-env jest */ /* eslint-env jest */
import Modes from '../../src/modes/modes'; import Modes from '../../src/lib/modes';
import reducer from '../../src/reducers/modes'; import reducer from '../../src/reducers/modes';
import {changeMode} from '../../src/reducers/modes'; import {changeMode} from '../../src/reducers/modes';