ISSUE-062 - Expanding status indicator in place.

Moved some dimensions data to the themes object for re-use between components.
This commit is contained in:
Kyle Geib committed 2022-03-08 17:03:09 -05:00
1 parent 28e0e7f3d4
commit d2e4afb975
7 files changed
+79 -69

No files matched your search

@@ -1,22 +1,17 @@
import styled, { css } from "styled-components";
import styled from "styled-components";
import { BGStatusIndicatorModes } from "../../../../types/state";
import { DirectionalTransitionProps } from "../../../../types/style";
import { commonDirectionalTransition } from "../../../../utils/styling";
type StatusIndicatorBaseProps = {
mode: BGStatusIndicatorModes,
};
export const StatusIndicatorBase = styled.div<StatusIndicatorBaseProps>`
export const StatusIndicatorBase = styled.div<DirectionalTransitionProps>`
background-color: black;
border-top-right-radius: ${p => p.theme.design.statusIndicator.roundedCornerRadiusPx}px;
height: ${p => p.theme.design.statusIndicator.heightNormalPx}px;
width: ${({ theme: { design: { timingTower } }, mode }) => {
if (mode === BGStatusIndicatorModes.LapNarrow) {
return timingTower.rowLeftHalfWidthPx;
}
if (mode === BGStatusIndicatorModes.LapWide) {
return timingTower.rowLeftHalfWidthPx + timingTower.rowRightHalfWidthPx;
}
return 10;
}}px;
width: ${({ theme: { design: { timingTower: ttTheme } }, open }) => open
? ttTheme.rowLeftHalfWidthPx + ttTheme.rowRightHalfWidthPx
: ttTheme.rowLeftHalfWidthPx}px;
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
`;
StatusIndicatorBase.displayName = "StatusIndicatorBase";