File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default function Button({
20
20
type = 'button'
21
21
className = { cn (
22
22
'rounded bg-blue-500 px-4 py-2 font-[Inter] text-2xl font-bold' ,
23
- 'text-white shadow-sm shadow-black transition-colors hover:bg-blue-600' ,
23
+ 'text-white shadow-sm shadow-black transition-all hover:bg-blue-600' ,
24
24
'hover:text-gray-100 disabled:opacity-50 disabled:hover:bg-blue-500' ,
25
25
'disabled:hover:text-white' ,
26
26
className ,
Original file line number Diff line number Diff line change @@ -32,25 +32,28 @@ export default function StartOrPauseTimerButton({
32
32
33
33
type LanguagesAbbreviations = 'en' | 'pt-BR' | 'pt'
34
34
35
- const widthMapping : { [ key in LanguagesAbbreviations ] : number } = {
36
- en : timerIsRunning ? 28 : timerCanReset ? 32 : 24 ,
37
- 'pt-BR' : timerIsRunning ? 32 : 40 ,
38
- pt : timerIsRunning ? 32 : 40 ,
35
+ const width24 = 'w-24'
36
+ const width28 = 'w-28'
37
+ const width32 = 'w-32'
38
+ const width40 = 'w-40'
39
+
40
+ const widthMapping : { [ key in LanguagesAbbreviations ] : string } = {
41
+ en : timerIsRunning ? width28 : timerCanReset ? width32 : width24 ,
42
+ 'pt-BR' : timerIsRunning ? width32 : width40 ,
43
+ pt : timerIsRunning ? width32 : width40 ,
39
44
}
40
45
41
- function getWidthClass ( ) : string {
42
- const width =
46
+ function getWidthClass ( ) : string | undefined {
47
+ return (
43
48
widthMapping [ i18n . language as LanguagesAbbreviations ] ||
44
- ( timerIsRunning ? 28 : timerCanReset ? 32 : 24 )
45
-
46
- return `w-${ width } `
49
+ ( timerIsRunning ? width28 : timerCanReset ? width32 : width24 )
50
+ )
47
51
}
48
52
49
53
return (
50
54
< Button
51
55
className = { cn (
52
- 'bg-green-500 transition-all hover:bg-green-600' ,
53
- 'disabled:hover:bg-green-500' ,
56
+ 'bg-green-500 hover:bg-green-600 disabled:hover:bg-green-500' ,
54
57
getWidthClass ( ) ,
55
58
) }
56
59
disabled = { disabled }
You can’t perform that action at this time.
0 commit comments