@@ -204,13 +204,18 @@ const Days: React.FC<Props> = ({
204
204
) ;
205
205
206
206
const buttonClass = useCallback (
207
- ( day : number , type : "current" | "previous " | "next " ) => {
207
+ ( day : number , type : "current" | "next " | "previous " ) => {
208
208
const baseClass = "flex items-center justify-center w-12 h-12 lg:w-10 lg:h-10" ;
209
- return cn (
210
- baseClass ,
211
- ! activeDateData ( day ) . active ? hoverClassByDay ( day ) : activeDateData ( day ) . className ,
212
- isDateDisabled ( day , type ) && "line-through"
213
- ) ;
209
+ if ( type === "current" ) {
210
+ return cn (
211
+ baseClass ,
212
+ ! activeDateData ( day ) . active
213
+ ? hoverClassByDay ( day )
214
+ : activeDateData ( day ) . className ,
215
+ isDateDisabled ( day , type ) && "line-through"
216
+ ) ;
217
+ }
218
+ return cn ( baseClass , isDateDisabled ( day , type ) && "line-through" , "text-gray-400" ) ;
214
219
} ,
215
220
[ activeDateData , hoverClassByDay , isDateDisabled ]
216
221
) ;
@@ -345,7 +350,7 @@ const Days: React.FC<Props> = ({
345
350
type = "button"
346
351
key = { index }
347
352
disabled = { isDateDisabled ( item , "previous" ) }
348
- className = "flex items-center justify-center text-gray-400 h-12 w-12 lg:w-10 lg:h-10"
353
+ className = { ` ${ buttonClass ( item , "previous" ) } ` }
349
354
onClick = { ( ) => handleClickDay ( item , "previous" ) }
350
355
onMouseOver = { ( ) => {
351
356
hoverDay ( item , "previous" ) ;
@@ -375,7 +380,7 @@ const Days: React.FC<Props> = ({
375
380
type = "button"
376
381
key = { index }
377
382
disabled = { isDateDisabled ( item , "next" ) }
378
- className = "flex items-center justify-center text-gray-400 h-12 w-12 lg:w-10 lg:h-10"
383
+ className = { ` ${ buttonClass ( item , "next" ) } ` }
379
384
onClick = { ( ) => handleClickDay ( item , "next" ) }
380
385
onMouseOver = { ( ) => {
381
386
hoverDay ( item , "next" ) ;
0 commit comments