eslint fixes

This commit is contained in:
Mikhail Mikheev 2019-03-20 18:39:09 +04:00
parent e63d1af47c
commit 086bc5d57c
1 changed files with 11 additions and 3 deletions

View File

@ -72,7 +72,11 @@ class GnoStepper extends React.PureComponent<Props, State> {
})) }))
} }
getPageProps = (pages: React$Node): PageProps => React.Children.toArray(pages)[this.state.page].props getPageProps = (pages: React$Node): PageProps => {
const { page } = this.state
return React.Children.toArray(pages)[page].props
}
getActivePageFrom = (pages: React$Node) => { getActivePageFrom = (pages: React$Node) => {
const activePageProps = this.getPageProps(pages) const activePageProps = this.getPageProps(pages)
@ -111,8 +115,9 @@ class GnoStepper extends React.PureComponent<Props, State> {
} }
previous = () => { previous = () => {
const firstPage = this.state.page === 0 const { page } = this.state
const firstPage = page === 0
if (firstPage) { if (firstPage) {
return history.goBack() return history.goBack()
} }
@ -133,7 +138,10 @@ class GnoStepper extends React.PureComponent<Props, State> {
return this.next(values) return this.next(values)
} }
isLastPage = page => page === this.props.steps.length - 1 isLastPage = (page) => {
const { steps } = this.props
return page === steps.length - 1
}
render() { render() {
const { const {