Skip to content

Conversation

@jamesmockett
Copy link
Contributor

@jamesmockett jamesmockett commented Dec 15, 2025

What does this change?

Adds FootballMatchGoalAttempts component and refactors existing FootballMatchStat component to enable sharing of the base layout. (As part of this the existing layout override props have been consolidated into a single layout prop, and team details broken out into separate props.)

Why?

To allow us to show stats for goal attempts on the new match summary page (#14904)

To do

Adjust text colour so it has sufficient contrast with the background which is derived from team colours. (Currently the text colours are hardcoded to match the example team colours in Storybook.) This is captured in #14987

Screenshots

Screenshot 2025-12-22 at 15 40 35

@jamesmockett jamesmockett self-assigned this Dec 15, 2025
@jamesmockett jamesmockett added the feature Departmental tracking: work on a new feature label Dec 15, 2025
@jamesmockett jamesmockett force-pushed the jm/football-stats-dual branch from a8fbdd8 to 3c1cb7f Compare December 15, 2025 17:38
@github-actions
Copy link

github-actions bot commented Dec 15, 2025

@jamesmockett jamesmockett force-pushed the jm/football-stats-dual branch 2 times, most recently from 54d000d to fbd32a1 Compare December 22, 2025 14:37
@github-actions
Copy link

github-actions bot commented Dec 22, 2025

@jamesmockett jamesmockett marked this pull request as ready for review December 22, 2025 15:43
@github-actions
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@jamesmockett jamesmockett force-pushed the jm/football-stats-dual branch from fbd32a1 to 7e2a85c Compare December 22, 2025 15:43
background-color: var(--on-target-colour);
border-radius: 4px;
width: 80%;
min-height: 62px;
Copy link
Contributor

@SiAdcock SiAdcock Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This slightly magical number reflects the design, without seeming to conform to our layout rules – assuming they are applicable in this case, which I accept they might not be.

As a consequence on desktop, because the font for the number of attempts is larger, you don't get as much space below the text.

mobile

Screenshot 2025-12-23 at 12 33 51

desktop

Screenshot 2025-12-23 at 12 33 39

I wonder if we should think in terms of how much space we want to have below the number of attempts, rather than the size of this box? If not, we could at least specify a different number for min-height here. For instance min-height: 72px at desktop looks like:

Screenshot 2025-12-23 at 12 29 03

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of magic numbers in general, but the minimum height applied here is per design. It's meant to sit alongside the larger numbers on desktop, hence the addition of a negative margin to shift the box up slightly. I can have another look at this as I would like to have a layout that's more fluid and intrinsic, and less reliant on magic numbers.

@SiAdcock
Copy link
Contributor

A few comments / questions but looking good in general, and I like the refactor and extraction of the FootballMatchStat component.

For my own curiosity, is the process now to get a pair of design eyes on this at the component level through a Chromatic review, or do we do a design review more holistically?

@jamesmockett
Copy link
Contributor Author

jamesmockett commented Dec 23, 2025

For my own curiosity, is the process now to get a pair of design eyes on this at the component level through a Chromatic review, or do we do a design review more holistically?

We haven't done any design reviews yet as things are still in progress and there will be further tweaks as the individual components get assembled into complete pages and we see everything together. Once we're further ahead it would be good to do a design run through with Rich and send him some links to Chromatic / Storybook so he can review at his leisure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants