diff --git a/src/components/Stepper/index.jsx b/src/components/Stepper/index.jsx index 06c56497..882028d1 100644 --- a/src/components/Stepper/index.jsx +++ b/src/components/Stepper/index.jsx @@ -129,13 +129,16 @@ class GnoStepper extends React.PureComponent { return this.next(values) } + isLastPage = page => page === this.props.steps.length - 1 + render() { const { steps, children, classes, disabledWhenValidating = false, } = this.props const { page, values } = this.state const activePage = this.getActivePageFrom(children) - const isLastPage = page === steps.length - 1 + const lastPage = this.isLastPage(page) + const penultimate = this.isLastPage(page + 1) return ( @@ -153,7 +156,8 @@ class GnoStepper extends React.PureComponent { disabled={disabled} onPrevious={this.previous} firstPage={page === 0} - lastPage={isLastPage} + lastPage={lastPage} + penultimate={penultimate} /> )