ISSUE-062 - Lap indicator now looking good and animating well.
New scheduled lap event state. New alternative white color that matches what's seen in reality. New overlay for wide lap indicator.
This commit is contained in:
1 parent
d2e4afb975
commit
1af134b9a4
9 files changed
+179
-17
No files matched your search
@@ -1,14 +1,18 @@
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
import { broadcastGraphicsSelector } from "../../../../features/broadcast/graphics/broadcastGraphicsSelector";
|
||||
import { eventSelector } from "../../../../features/event/eventSelector";
|
||||
import { theme } from "../../../../shared/theme";
|
||||
import { BGStatusIndicatorModes } from "../../../../types/state";
|
||||
import { DebugDurationProps } from "../../../../types/style";
|
||||
import { DebugDurationProps, TransitionArgs } from "../../../../types/style";
|
||||
import { orMatch } from "../../../../utils/common";
|
||||
|
||||
import { StatusIndicatorBase } from "./styles";
|
||||
import { LapCount, LapLabel, LapLine, StatusIndicatorBase, StatusIndicatorLayout } from "./styles";
|
||||
|
||||
type StatusIndicatorProps = DebugDurationProps;
|
||||
|
||||
|
||||
|
||||
export function StatusIndicator({
|
||||
debugDurationMultiplier: DDM = 1.0,
|
||||
}: StatusIndicatorProps) {
|
||||
@@ -16,19 +20,56 @@ export function StatusIndicator({
|
||||
|
||||
const { timingBoard: { statusIndicator: { mode } } } =
|
||||
useSelector(broadcastGraphicsSelector);
|
||||
const { progress: { scheduledLaps, lapCount } } = useSelector(eventSelector);
|
||||
|
||||
const toWideTransition: TransitionArgs[] = [{
|
||||
property: "all",
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
}];
|
||||
const toNarrowTransition: TransitionArgs[] = [{
|
||||
property: "all",
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
delay: ttTheme.fullWidthCloseDelayMs * DDM,
|
||||
}];
|
||||
|
||||
return (
|
||||
<StatusIndicatorBase
|
||||
open={mode !== BGStatusIndicatorModes.LapNarrow}
|
||||
transitionOpeningProps={[{
|
||||
property: "width",
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
}]}
|
||||
transitionClosingProps={[{
|
||||
property: "width",
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
delay: ttTheme.fullWidthCloseDelayMs * DDM,
|
||||
}]}
|
||||
/>
|
||||
transitionOpeningProps={toWideTransition}
|
||||
transitionClosingProps={toNarrowTransition}
|
||||
>
|
||||
<StatusIndicatorLayout>
|
||||
{orMatch(mode, BGStatusIndicatorModes.LapNarrow, BGStatusIndicatorModes.LapWide) && (
|
||||
<>
|
||||
<LapLine
|
||||
mode={BGStatusIndicatorModes.LapNarrow}
|
||||
open={mode === BGStatusIndicatorModes.LapNarrow}
|
||||
transitionOpeningProps={toNarrowTransition}
|
||||
transitionClosingProps={toWideTransition}
|
||||
/>
|
||||
<LapLine
|
||||
mode={BGStatusIndicatorModes.LapWide}
|
||||
open={mode === BGStatusIndicatorModes.LapWide}
|
||||
transitionOpeningProps={toWideTransition}
|
||||
transitionClosingProps={toNarrowTransition}
|
||||
/>
|
||||
<LapLabel
|
||||
mode={mode}
|
||||
open={mode === BGStatusIndicatorModes.LapWide}
|
||||
transitionOpeningProps={toWideTransition}
|
||||
transitionClosingProps={toNarrowTransition}
|
||||
>LAP</LapLabel>
|
||||
<LapCount
|
||||
mode={mode}
|
||||
open={mode === BGStatusIndicatorModes.LapWide}
|
||||
transitionOpeningProps={toWideTransition}
|
||||
transitionClosingProps={toNarrowTransition}
|
||||
>
|
||||
<span>{lapCount} / {scheduledLaps}</span>
|
||||
</LapCount>
|
||||
</>
|
||||
)}
|
||||
</StatusIndicatorLayout>
|
||||
</StatusIndicatorBase>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user