@@ -36,13 +36,16 @@ const Days: React.FC<Props> = ({calendarData, onClickPreviousDays, onClickDay, o
36
36
const activeDateData = useCallback ( ( day : number ) => {
37
37
const fullDay = `${ calendarData . date . year ( ) } -${ calendarData . date . month ( ) + 1 } -${ day } ` ;
38
38
let className = "" ;
39
- const bgColor = BG_COLOR [ "500" ] [ primaryColor as keyof typeof BG_COLOR [ "500" ] ] ;
39
+
40
40
if ( ( dayjs ( fullDay ) . isSame ( period . start ) && dayjs ( fullDay ) . isSame ( period . end ) ) ) {
41
- className = ` ${ bgColor } text-white font-medium rounded-full` ;
41
+ // @ts -ignore
42
+ className = ` ${ BG_COLOR [ "500" ] [ primaryColor ] } text-white font-medium rounded-full` ;
42
43
} else if ( dayjs ( fullDay ) . isSame ( period . start ) ) {
43
- className = ` ${ bgColor } text-white font-medium ${ ( dayjs ( fullDay ) . isSame ( dayHover ) && ! period . end ) ? "rounded-full" : "rounded-l-full" } ` ;
44
+ // @ts -ignore
45
+ className = ` ${ BG_COLOR [ "500" ] [ primaryColor ] } text-white font-medium ${ ( dayjs ( fullDay ) . isSame ( dayHover ) && ! period . end ) ? "rounded-full" : "rounded-l-full" } ` ;
44
46
} else if ( dayjs ( fullDay ) . isSame ( period . end ) ) {
45
- className = ` ${ bgColor } text-white font-medium ${ ( dayjs ( fullDay ) . isSame ( dayHover ) && ! period . start ) ? "rounded-full" : "rounded-r-full" } ` ;
47
+ // @ts -ignore
48
+ className = ` ${ BG_COLOR [ "500" ] [ primaryColor ] } text-white font-medium ${ ( dayjs ( fullDay ) . isSame ( dayHover ) && ! period . start ) ? "rounded-full" : "rounded-r-full" } ` ;
46
49
}
47
50
48
51
return {
@@ -54,31 +57,34 @@ const Days: React.FC<Props> = ({calendarData, onClickPreviousDays, onClickDay, o
54
57
const hoverClassByDay = useCallback ( ( day : number ) => {
55
58
let className = currentDateClass ( day ) ;
56
59
const fullDay = `${ calendarData . date . year ( ) } -${ calendarData . date . month ( ) + 1 } -${ day >= 10 ? day : "0" + day } ` ;
57
- const bgColor100 = BG_COLOR [ "100" ] [ primaryColor as keyof typeof BG_COLOR [ "100" ] ] ;
58
- const bgColor500 = BG_COLOR [ "500" ] [ primaryColor as keyof typeof BG_COLOR [ "100" ] ] ;
59
60
60
61
// @ts -ignore
61
62
if ( period . start && period . end && dayjs ( fullDay ) . isBetween ( period . start , period . end , 'day' , '[)' ) ) {
62
- return ` ${ bgColor100 } ${ currentDateClass ( day ) } dark:bg-white/10` ;
63
+ // @ts -ignore
64
+ return ` ${ BG_COLOR [ "100" ] [ primaryColor ] } ${ currentDateClass ( day ) } dark:bg-white/10` ;
63
65
}
64
66
65
67
if ( ! dayHover ) {
68
+ // @ts -ignore
66
69
return className ;
67
70
}
68
71
69
72
70
73
// @ts -ignore
71
74
if ( period . start && dayjs ( fullDay ) . isBetween ( period . start , dayHover , 'day' , '[)' ) ) {
72
- className = ` ${ bgColor100 } ${ currentDateClass ( day ) } dark:bg-white/10` ;
75
+ // @ts -ignore
76
+ className = ` ${ BG_COLOR [ "100" ] [ primaryColor ] } ${ currentDateClass ( day ) } dark:bg-white/10` ;
73
77
}
74
78
75
79
// @ts -ignore
76
80
if ( period . end && dayjs ( fullDay ) . isBetween ( dayHover , period . end , 'day' , '[)' ) ) {
77
- className = ` ${ bgColor100 } ${ currentDateClass ( day ) } dark:bg-white/10` ;
81
+ // @ts -ignore
82
+ className = ` ${ BG_COLOR [ "100" ] [ primaryColor ] } ${ currentDateClass ( day ) } dark:bg-white/10` ;
78
83
}
79
84
80
85
if ( dayHover === fullDay ) {
81
- className = ` transition-all duration-500 ${ bgColor500 } text-white font-medium ${ period . start ? 'rounded-r-full' : 'rounded-l-full' } ` ;
86
+ // @ts -ignore
87
+ className = ` transition-all duration-500 ${ BG_COLOR [ "500" ] [ primaryColor ] } text-white font-medium ${ period . start ? 'rounded-r-full' : 'rounded-l-full' } ` ;
82
88
}
83
89
84
90
return className ;
0 commit comments