ISSUE-035 - Styled the Team flags individually.
Went through a lot of trouble to style the team flags to be wider than the country flags. This called for a troubling amount of ternary statements in the angled flag components. I'm content with the results.
This commit is contained in:
1 parent
bd1892ab17
commit
b39d005e23
8 files changed
+168
-79
No files matched your search
@@ -13,7 +13,7 @@ export function AngledFlagWorkSpace({ flagMode }: AngledFlagWorkSpaceProps) {
|
||||
const { prototypeState } = useSelector(workspaceSelector);
|
||||
if (flagMode === "none") return null;
|
||||
|
||||
const defaultTeam: TeamId = "alpine";
|
||||
const defaultTeam: TeamId = "alfaRomeo";
|
||||
|
||||
return (
|
||||
<BasicBlock width={750} height={450} color="rgba(30, 30, 30, .7)">
|
||||
|
||||
+16
-5
@@ -13,10 +13,13 @@ const countries = [
|
||||
"CAN", "RUS", "RAF", "AUS", "ESP", "ITA",
|
||||
];
|
||||
const teams: Array<TeamId> = [
|
||||
"alpine", "alfaRomeo", "alphaTauri", "astonMartin", "haas", "ferrari",
|
||||
"alfaRomeo", "alphaTauri", "alpine", "astonMartin", "ferrari", "haas",
|
||||
"mclaren", "mercedes", "redBull", "williams",
|
||||
];
|
||||
|
||||
const DEFAULT_COUNTRY = "GBR";
|
||||
const DEFAULT_TEAM: TeamId = "alfaRomeo";
|
||||
|
||||
type AngledFlagPrototypeControlsProps = {
|
||||
flagMode: FlagMode,
|
||||
};
|
||||
@@ -29,15 +32,23 @@ export function AngledFlagPrototypeControls({ flagMode }: AngledFlagPrototypeCon
|
||||
if (flagMode === "country") {
|
||||
dispatch(setPrototypeState({
|
||||
angledFlagCountry: {
|
||||
flagA: flag === "flagA" ? countries[index] : prototypeState?.angledFlagCountry?.flagA ?? "GBR",
|
||||
flagB: flag === "flagB" ? countries[index] : prototypeState?.angledFlagCountry?.flagB ?? "GBR",
|
||||
flagA: flag === "flagA"
|
||||
? countries[index]
|
||||
: prototypeState?.angledFlagCountry?.flagA ?? DEFAULT_COUNTRY,
|
||||
flagB: flag === "flagB"
|
||||
? countries[index]
|
||||
: prototypeState?.angledFlagCountry?.flagB ?? DEFAULT_COUNTRY,
|
||||
},
|
||||
}));
|
||||
} else if (flagMode === "team") {
|
||||
dispatch(setPrototypeState({
|
||||
angledFlagTeam: {
|
||||
flagA: flag === "flagA" ? teams[index] : prototypeState?.angledFlagTeam?.flagA ?? "alpine",
|
||||
flagB: flag === "flagB" ? teams[index] : prototypeState?.angledFlagTeam?.flagB ?? "alpine",
|
||||
flagA: flag === "flagA"
|
||||
? teams[index]
|
||||
: prototypeState?.angledFlagTeam?.flagA ?? DEFAULT_TEAM,
|
||||
flagB: flag === "flagB"
|
||||
? teams[index]
|
||||
: prototypeState?.angledFlagTeam?.flagB ?? DEFAULT_TEAM,
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
Reference in new issue
Block a user