WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit f251344

Browse files
committed
Add story to show team colour examples
1 parent efa0b95 commit f251344

File tree

1 file changed

+125
-0
lines changed

1 file changed

+125
-0
lines changed

dotcom-rendering/src/components/FootballMatchStat.stories.tsx

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,99 @@ const meta = {
3131
export default meta;
3232
type Story = StoryObj<typeof meta>;
3333

34+
const teams = [
35+
{
36+
home: { name: 'Wolves', colour: '#faa01b' },
37+
away: { name: 'Man Utd', colour: '#b00101' },
38+
},
39+
{
40+
home: { name: 'Fulham', colour: '#ffffff' },
41+
away: { name: 'C Palace', colour: '#af1f17' },
42+
},
43+
{
44+
home: { name: 'Brighton', colour: '#2a449a' },
45+
away: { name: 'West Ham', colour: '#7c1e42' },
46+
},
47+
{
48+
home: { name: 'Leeds', colour: '#f5f5f5' },
49+
away: { name: 'Liverpool', colour: '#ce070c' },
50+
},
51+
{
52+
home: { name: 'AFC Bournemouth', colour: '#c80000' },
53+
away: { name: 'Chelsea', colour: '#005ca4' },
54+
},
55+
{
56+
home: { name: 'Everton', colour: '#00349a' },
57+
away: { name: 'Nottm Forest', colour: '#db1812' },
58+
},
59+
{
60+
home: { name: 'Man City', colour: '#5cbfeb' },
61+
away: { name: 'Sunderland', colour: '#d51022' },
62+
},
63+
{
64+
home: { name: 'Newcastle', colour: '#383838' },
65+
away: { name: 'Burnley', colour: '#570e30' },
66+
},
67+
{
68+
home: { name: 'Spurs', colour: '#ffffff' },
69+
away: { name: 'Brentford', colour: '#c4040f' },
70+
},
71+
{
72+
home: { name: 'Aston Villa', colour: '#720e44' },
73+
away: { name: 'Arsenal', colour: '#c40007' },
74+
},
75+
{
76+
home: { name: 'Birmingham', colour: '#01009a' },
77+
away: { name: 'Norwich', colour: '#ffe400' },
78+
},
79+
{
80+
home: { name: 'Derby', colour: '#ffffff' },
81+
away: { name: 'Watford', colour: '#fef502' },
82+
},
83+
{
84+
home: { name: 'Leicester', colour: '#4b2cd3' },
85+
away: { name: 'Stoke', colour: '#cc0617' },
86+
},
87+
{
88+
home: { name: 'Oxford Utd', colour: '#fec726' },
89+
away: { name: 'Middlesbrough', colour: '#e70101' },
90+
},
91+
{
92+
home: { name: 'Portsmouth', colour: '#0077ac' },
93+
away: { name: 'Millwall', colour: '#1a2791' },
94+
},
95+
{
96+
home: { name: 'QPR', colour: '#1f539f' },
97+
away: { name: 'Hull', colour: '#f2b100' },
98+
},
99+
{
100+
home: { name: 'Bristol City', colour: '#c70c23' },
101+
away: { name: 'Swansea', colour: '#ffffff' },
102+
},
103+
{
104+
home: { name: 'Charlton', colour: '#d4222b' },
105+
away: { name: 'Southampton', colour: '#d71921' },
106+
},
107+
{
108+
home: { name: 'Coventry', colour: '#b1d0ff' },
109+
away: { name: 'West Brom', colour: '#00246a' },
110+
},
111+
{
112+
home: { name: 'Celtic', colour: '#559861' },
113+
away: { name: 'Dundee', colour: '#000033' },
114+
},
115+
{
116+
home: { name: 'Falkirk', colour: '#002341' },
117+
away: { name: 'Motherwell', colour: '#f0c650' },
118+
},
119+
{
120+
home: { name: 'Dundee Utd', colour: '#ff6c00' },
121+
away: { name: 'Rangers', colour: '#195091' },
122+
},
123+
];
124+
125+
console.log(teams);
126+
34127
export const Default = {
35128
args: {
36129
label: 'Goal Attempts',
@@ -77,3 +170,35 @@ export const LargeNumbersOnDesktop = {
77170
largeNumbersOnDesktop: true,
78171
},
79172
} satisfies Story;
173+
174+
export const TeamColourContrastCorrection = {
175+
render: (args) => (
176+
<div
177+
css={css`
178+
display: flex;
179+
flex-direction: column;
180+
gap: ${space[2]}px;
181+
`}
182+
>
183+
{teams.map((match, index) => (
184+
<FootballMatchStat
185+
label={args.label}
186+
home={{
187+
teamName: match.home.name,
188+
teamColour: match.home.colour,
189+
value: args.home.value,
190+
}}
191+
away={{
192+
teamName: match.away.name,
193+
teamColour: match.away.colour,
194+
value: args.away.value,
195+
}}
196+
key={index}
197+
/>
198+
))}
199+
</div>
200+
),
201+
args: {
202+
...Default.args,
203+
},
204+
} satisfies Story;

0 commit comments

Comments
 (0)