11import React , { useState , useEffect , cloneElement } from 'react'
22import { css , styled , setup } from 'goober'
3-
4- setup ( React . createElement )
3+ import { prefix } from 'goober/prefixer'
4+ setup ( React . createElement , prefix )
55
66const Ol = styled ( 'ol' ) `
77 margin: 0;
@@ -96,17 +96,17 @@ const getTopNavStyles = (indx, length) => {
9696const getButtonsState = ( indx , length ) => {
9797 if ( indx > 0 && indx < length - 1 ) {
9898 return {
99- showPreviousBtn : true ,
100- showNextBtn : true
99+ showPrevious : true ,
100+ showNext : true
101101 }
102102 } else if ( indx === 0 ) {
103103 return {
104- showPreviousBtn : false ,
105- showNextBtn : true
104+ showPrevious : false ,
105+ showNext : true
106106 }
107107 } else {
108108 return {
109- showPreviousBtn : true ,
109+ showPrevious : true ,
110110 showNextBtn : false
111111 }
112112 }
@@ -122,8 +122,7 @@ export default function MultiStep(props) {
122122 // const stepCustomStyle = typeof props.stepCustomStyle === 'undefined' ? {} : props.stepCustomStyle
123123 const showTitles = typeof props . showTitles === 'undefined' ? false : true
124124 const showButtonNav = typeof props . showButtonNav === 'undefined' ? false : true
125- // todo: navButtonStyle needs to be incorporated in goober styles
126- // const navButtonStyle = typeof props.navButtonStyle === 'undefined' ? { background: 'white', color: 'red' } : props.prevStyle
125+ const navButtonStyle = typeof props . navButtonStyle === 'undefined' ? { background : 'white' , color : 'red' } : props . prevStyle
127126
128127 const [ activeStep , _ ] = useState ( getStep ( props . activeStep , props . steps . length ) ) ;
129128 const [ stylesState , setStyles ] = useState ( getTopNavStyles ( activeStep , props . steps . length ) )
@@ -176,14 +175,14 @@ export default function MultiStep(props) {
176175 show && (
177176 < div >
178177 < button
179- className = { buttonsState . showPreviousBtn ? NavButton : NavButtonDisabled }
178+ className = { buttonsState . showPrevious ? NavButton : NavButtonDisabled }
180179 onClick = { previous }
181180 >
182181 Prev
183182 </ button >
184183
185184 < button
186- className = { buttonsState . showNextBtn ? NavButton : NavButtonDisabled }
185+ className = { buttonsState . showNext ? NavButton : NavButtonDisabled }
187186 onClick = { next }
188187 >
189188 Next
0 commit comments