Files
test/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx
T
Kyle Geib 4a9c124832 ISSUE-031 - Big update. AngledFlag component is born!
It's not 100% complete - I still need to add the second, slightly offset sub flag that goes beneath the main flag, creating a sort of refractive-glass/parallax effect.

Needed to add a new workspace. Thankfully it's pretty easy to add a new workspace. So, kinda nice.

Did a lot of work making 2:1 versions of each flag in vector. Was a bit of a pain in the ass.

Renamed a prop for ProgressSlider, "onBarColor" because prefixing a prop with "on" is special for React and it gets upset and spits out an error.
2022-01-24 16:15:43 -05:00

64 lines
1.6 KiB
TypeScript

import { DriverNumber } from "../../Common/DriverNumber";
import { AngledFlag } from "../../Common/AngledFlag";
import {
BaseBackground,
FirstName,
PositionNumber,
LastName,
NameContainer,
NumberContainer,
PositionFlag,
Spacer,
TeamColorBar,
TeamName,
TextContainer,
FlagContainer,
} from "./styles";
import { drivers } from "../../../../domain/data/teams";
import { theme } from "../../../../shared/theme";
export function ChyronDriver() {
// TODO - Get driver details from Redux.
const driver = drivers["hamilton"];
const baseWidth = 582;
const baseHeight = 72;
return (
<BaseBackground width={baseWidth} height={baseHeight}>
<Spacer width="6px" />
<PositionFlag containerHeight={baseHeight}>
<PositionNumber containerHeight={baseHeight}>1</PositionNumber>
</PositionFlag>
<Spacer width="8px" />
<TeamColorBar color={theme.colors.teams[driver.team.id]} />
<Spacer width="8px" />
<TextContainer>
<NameContainer>
<FirstName>{driver.firstName}</FirstName>
<LastName>{driver.lastName}</LastName>
<NumberContainer>
<DriverNumber
teamId={driver.team.id}
fontSize="29px"
number={driver.number}
/>
</NumberContainer>
</NameContainer>
<TeamName>{driver.team.shortName}</TeamName>
</TextContainer>
<FlagContainer
height={baseHeight * 0.9}
width={250}
>
<AngledFlag
flagMode="country"
flag={driver.nationality}
flagHeight={64}
/>
</FlagContainer>
</BaseBackground>
);
}