@@ -16,30 +16,6 @@ interface BreakProgressProps {
16
16
sharedBreakEndTime ?: number | null ;
17
17
}
18
18
19
- function TimeDisplay ( {
20
- seconds,
21
- textColor,
22
- } : {
23
- seconds : number ;
24
- textColor : string ;
25
- } ) {
26
- const minutes = Math . floor ( seconds / 60 ) ;
27
- const remainingSeconds = seconds % 60 ;
28
-
29
- return (
30
- < div
31
- className = "text-sm font-medium opacity-60 flex-shrink-0 tabular-nums flex items-center gap-0.5"
32
- style = { { color : textColor } }
33
- >
34
- < span style = { { color : textColor } } > { minutes } </ span >
35
- < span style = { { color : textColor } } > :</ span >
36
- < span style = { { color : textColor } } >
37
- { String ( remainingSeconds ) . padStart ( 2 , "0" ) }
38
- </ span >
39
- </ div >
40
- ) ;
41
- }
42
-
43
19
export function BreakProgress ( {
44
20
breakMessage,
45
21
breakTitle,
@@ -150,12 +126,6 @@ export function BreakProgress({
150
126
151
127
const progressPercentage = ( progress || 0 ) * 100 ;
152
128
153
- const elapsedSeconds =
154
- settings . breakLengthSeconds -
155
- ( timeRemaining ?. hours || 0 ) * 3600 -
156
- ( timeRemaining ?. minutes || 0 ) * 60 -
157
- Math . floor ( timeRemaining ?. seconds || 0 ) ;
158
-
159
129
return (
160
130
< motion . div
161
131
className = "flex flex-col h-full w-full z-10 relative space-y-6"
@@ -193,12 +163,21 @@ export function BreakProgress({
193
163
</ div >
194
164
195
165
< div className = "w-full" >
196
- < div className = "flex justify-between items-center mb-2" >
197
- < TimeDisplay seconds = { elapsedSeconds } textColor = { textColor } />
198
- < TimeDisplay
199
- seconds = { settings . breakLengthSeconds }
200
- textColor = { textColor }
201
- />
166
+ < div className = "flex justify-end items-center mb-2" >
167
+ < div
168
+ className = "text-sm font-medium opacity-60 flex-shrink-0 tabular-nums flex items-center gap-0.5"
169
+ style = { { color : textColor } }
170
+ >
171
+ < span style = { { color : textColor } } >
172
+ { String (
173
+ Math . floor ( timeRemaining . hours * 60 + timeRemaining . minutes ) ,
174
+ ) . padStart ( 2 , "0" ) } { " " }
175
+ </ span >
176
+ < span style = { { color : textColor } } > :</ span >
177
+ < span style = { { color : textColor } } >
178
+ { String ( Math . floor ( timeRemaining . seconds ) ) . padStart ( 2 , "0" ) }
179
+ </ span >
180
+ </ div >
202
181
</ div >
203
182
< div
204
183
className = "w-full h-2 rounded-full overflow-hidden"
0 commit comments