@@ -38,6 +38,7 @@ export default function Stepper({
38
38
const [ isInput , setIsInput ] = useState ( false ) ;
39
39
const animationDiv = document . getElementById ( 'loading' ) ;
40
40
const animationBackground = document . getElementById ( 'loading-background' ) ;
41
+ const [ minusBt , setMinusBt ] = useState ( { } ) ;
41
42
42
43
const handleIncrementBtProps = {
43
44
className : classnames ( baseClass , [ { disabled } , { theme } ] ) ,
@@ -133,6 +134,14 @@ export default function Stepper({
133
134
}
134
135
}
135
136
} , [ disabled , value , max , min , handleDecrementProps , handleIncrementBtProps ] ) ;
137
+ useEffect ( ( ) => {
138
+ if ( value === 0 ) {
139
+ const btStyle = { cursor : 'not-allowed' } ;
140
+ setMinusBt ( btStyle ) ;
141
+ } else {
142
+ setMinusBt ( { } ) ;
143
+ }
144
+ } , [ value ] ) ;
136
145
137
146
if ( disabled ) {
138
147
Object . assign ( handleDecrementProps , { disabled } ) ;
@@ -201,8 +210,12 @@ export default function Stepper({
201
210
onClick = { handleDecrement }
202
211
{ ...handleDecrementProps }
203
212
disabled = { isMinus }
213
+ style = { minusBt }
204
214
>
205
- < p > -</ p >
215
+ < img
216
+ src = 'https://res.cloudinary.com/dlapk94rx/image/upload/v1595307854/icons8-minus-24_y8dnmc.png'
217
+ alt = ''
218
+ /> { ' ' }
206
219
</ button >
207
220
< input
208
221
value = { value }
@@ -216,7 +229,10 @@ export default function Stepper({
216
229
{ ...handleIncrementBtProps }
217
230
disabled = { isPlus }
218
231
>
219
- < p > +</ p >
232
+ < img
233
+ src = 'https://res.cloudinary.com/dlapk94rx/image/upload/v1595307854/icons8-plus-24_wnv2uo.png'
234
+ alt = ''
235
+ />
220
236
</ button >
221
237
{ loading && (
222
238
< div id = 'loading-background' className = 'load' >
0 commit comments