Skip to content

Commit a790871

Browse files
For break progress only show time remaining
1 parent 8dd8f2f commit a790871

File tree

1 file changed

+15
-36
lines changed

1 file changed

+15
-36
lines changed

app/renderer/components/break/break-progress.tsx

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,6 @@ interface BreakProgressProps {
1616
sharedBreakEndTime?: number | null;
1717
}
1818

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-
4319
export function BreakProgress({
4420
breakMessage,
4521
breakTitle,
@@ -150,12 +126,6 @@ export function BreakProgress({
150126

151127
const progressPercentage = (progress || 0) * 100;
152128

153-
const elapsedSeconds =
154-
settings.breakLengthSeconds -
155-
(timeRemaining?.hours || 0) * 3600 -
156-
(timeRemaining?.minutes || 0) * 60 -
157-
Math.floor(timeRemaining?.seconds || 0);
158-
159129
return (
160130
<motion.div
161131
className="flex flex-col h-full w-full z-10 relative space-y-6"
@@ -193,12 +163,21 @@ export function BreakProgress({
193163
</div>
194164

195165
<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>
202181
</div>
203182
<div
204183
className="w-full h-2 rounded-full overflow-hidden"

0 commit comments

Comments
 (0)