feat: add time type none

This commit is contained in:
Carlos Valente
2024-10-31 17:31:26 +01:00
committed by Carlos Valente
parent 7ccd41eeee
commit 0d8c186c77
7 changed files with 17 additions and 2 deletions
@@ -23,6 +23,8 @@ export function getTimerByType(freezeEnd: boolean, timerObject?: TimerTypeParams
return Math.abs(timerObject.elapsed ?? 0);
case TimerType.Clock:
return timerObject.clock;
case TimerType.None:
return null;
default: {
const exhaustiveCheck: never = timerObject.timerType;
return exhaustiveCheck;
@@ -160,6 +160,7 @@ export default function Timer(props: TimerProps) {
const defaultFormat = getDefaultFormat(settings?.timeFormat);
const timerOptions = getTimerOptions(defaultFormat, customFields);
const disableProgress = timerIsTimeOfDay || time.timerType === TimerType.None;
return (
<div className={showFinished ? `${baseClasses} stage-timer--finished` : baseClasses} data-testid='timer-view'>
@@ -205,7 +206,7 @@ export default function Timer(props: TimerProps) {
{!userOptions.hideProgress && (
<MultiPartProgressBar
className={isPlaying ? 'progress-container' : 'progress-container progress-container--paused'}
now={timerIsTimeOfDay ? null : time.current}
now={disableProgress ? null : time.current}
complete={totalTime}
normalColor={viewSettings.normalColor}
warning={eventNow?.timeWarning}