ISSUE-031 - Progress checkpoint.
A lot of work going on here. * Moved WorkspaceControls component to a new sub directory * Renamed overlay images * Started a static ChyronDriverBasic component (using Hamilton as an example) * Created a fancy DriverNumber rendering system * Defined DriverNumber style for Mercedes and no one else yet * A bunch of new states for the grid: cars, drivers, teams, etc * Defined a bunch of data for the drivers and teams * Created another string utility function to generate repeat strings; unit tests included
This commit is contained in:
1 parent
1c38137480
commit
db14bf902f
21 files changed
+787
-41
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import { TeamId } from "../../../../types/state";
|
||||
import { getTeamNumberStyle } from "../../../../utils/dataLookup";
|
||||
import { NumberContainer, ShadowNumber, StrokeNumber } from "./styles";
|
||||
|
||||
type DriverNumberProps = {
|
||||
number: number,
|
||||
fontSize: string,
|
||||
teamId: TeamId,
|
||||
};
|
||||
export function DriverNumber({ number, fontSize, teamId }: DriverNumberProps) {
|
||||
const style = getTeamNumberStyle(teamId);
|
||||
return (
|
||||
<NumberContainer>
|
||||
{style.rules.map((rule, i) => {
|
||||
if (rule.type === "stroke") {
|
||||
return (
|
||||
<StrokeNumber
|
||||
key={i}
|
||||
fontFamily={style.fontFamily}
|
||||
fontSize={fontSize}
|
||||
numberColor={style.numberColor}
|
||||
strokeColor={rule.color}
|
||||
strokeWidth={`${rule.width}em`}
|
||||
>
|
||||
{number}
|
||||
</StrokeNumber>
|
||||
);
|
||||
} else if (rule.type === "shadow") {
|
||||
return (
|
||||
<ShadowNumber
|
||||
key={i}
|
||||
fontFamily={style.fontFamily}
|
||||
fontSize={fontSize}
|
||||
numberColor={style.numberColor}
|
||||
shadowProperties={rule.property}
|
||||
>
|
||||
{number}
|
||||
</ShadowNumber>
|
||||
);
|
||||
}
|
||||
})}
|
||||
</NumberContainer>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user