ISSUE-058 - Added basic TimingTower hidden setting that simply fades the whole thing in/out.
Don't think I have the desire to animate the mounting process right now.
This commit is contained in:
1 parent
9f4e564a74
commit
061a7e0a0d
2 files changed
+11
-2
No files matched your search
@@ -3,7 +3,7 @@ import { useSelector } from "react-redux";
|
||||
|
||||
import { broadcastGraphicsSelector } from "../../../../features/broadcast/graphics/broadcastGraphicsSelector";
|
||||
import { eventSelector } from "../../../../features/event/eventSelector";
|
||||
import { CarStatus } from "../../../../types/state";
|
||||
import { BGTimingTowerDisplayMode, CarStatus } from "../../../../types/state";
|
||||
import { Fraction } from "../../../../types/style";
|
||||
|
||||
import { RowsContainer } from "./styles";
|
||||
@@ -54,6 +54,11 @@ export function TimingTower({ debugDurationMultiplier: DDM }: TimingTowerProps)
|
||||
<RowsContainer
|
||||
carsToDisplay={startingCarsCount}
|
||||
retiredCarsPresent={retiredCarsCount > 0}
|
||||
open={displayMode !== BGTimingTowerDisplayMode.Hidden}
|
||||
transitionProps={[{
|
||||
property: "opacity",
|
||||
duration: 1000,
|
||||
}]}
|
||||
>
|
||||
{rows}
|
||||
</RowsContainer>
|
||||
|
||||
@@ -12,7 +12,7 @@ import { commonDirectionalTransition } from "../../../../utils/styling";
|
||||
import fastestLapIcon from "../../../../public/images/icons/fastest-lap.svg";
|
||||
|
||||
|
||||
type RowsContainerProps = {
|
||||
type RowsContainerProps = DirectionalTransitionProps & {
|
||||
carsToDisplay: number,
|
||||
retiredCarsPresent: boolean,
|
||||
};
|
||||
@@ -26,6 +26,10 @@ export const RowsContainer = styled.div<RowsContainerProps>`
|
||||
theme.design.timingTower.rowHeightPx * carsToDisplay + (retiredCarsPresent ? 3 : 0)}px;
|
||||
|
||||
overflow-y: clip; // hidden doesn't work for some reason.
|
||||
|
||||
opacity: ${({ open }) => open ? 1 : 0};
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
RowsContainer.displayName = "RowsContainer";
|
||||
|
||||
|
||||
Reference in new issue
Block a user