Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Competition Overview Page to React #10418

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

FinnIckler
Copy link
Member

Currently wip porting the registration requirements over

There is an issue that it only does one markdown request at once, but a bunch of fields are in markdown... so not sure what to do about that.

Progress:
image

@FinnIckler
Copy link
Member Author

Migrated all information over. Now onto the styling
Screenshot 2024-12-12 at 15 47 54
Screenshot 2024-12-12 at 15 48 03

@FinnIckler
Copy link
Member Author

Moving it to the grid with the right sizes was quite easy actually. But I don't really know what the correct equivalent of a Descriptive List is in Semantic

@FinnIckler
Copy link
Member Author

I can rebuild it with another grid, maybe that looks good enough

@FinnIckler
Copy link
Member Author

Screenshot 2024-12-12 at 21 42 04 I was able to replicate it with a grid, but I did have to set the padding to 0 manually

@FinnIckler
Copy link
Member Author

Screenshot 2024-12-13 at 00 11 24 Screenshot 2024-12-13 at 00 11 08 Almost everything moved over to grid


export default function CompetitionSeriesRequirement({ competition }) {
return (
<div>
Copy link
Member

Choose a reason for hiding this comment

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

Can this be an empty <> fragment tag?

Comment on lines +12 to +18
<ul>
{competition.series_sibling_competitions.map((comp) => (
<li key={comp.id}>
<a href={`/competitions/${comp.id}`}>{comp.name}</a>
</li>
))}
</ul>
Copy link
Member

Choose a reason for hiding this comment

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

This should definitely be a SemUI <List>

competition.currency_code,
),
})}
<br />
Copy link
Member

Choose a reason for hiding this comment

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

Not a big fan of br'ing without knowing what comes next. What problem are you trying to solve?

Copy link
Member Author

@FinnIckler FinnIckler Dec 16, 2024

Choose a reason for hiding this comment

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

the <br /> are from the original file

) : competition['some_guests_allowed?'] && (
I18n.t('competitions.competition_info.guests_free.restricted')
)}
<br />
Copy link
Member

Choose a reason for hiding this comment

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

(see above about dangling br)

Comment on lines +19 to +24
{competition.competition_events.map((event) => (event['has_fee?'] ? (
<dl key={event.id}>
<dt>{event.event.name}</dt>
<dd>{isoMoneyToHumanReadable(event.fee)}</dd>
</dl>
) : null))}
Copy link
Member

Choose a reason for hiding this comment

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

As it currently stands, you're opening an entirely new list (<dl> tag) per event. Shouldn't it be an outer dl tag where one pair of "dt+dd" tags is added as list entry per event?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is just not migrated yet!

Copy link
Member

Choose a reason for hiding this comment

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

Lots of dangling br, won't comment on all of them.
Not sure what you're trying to solve, but a simple <List> (which does not have enumeration bullet points by default in SemUI!) might already do the trick in terms of line breaks.

Comment on lines +11 to +13
const updatePath = (tabSlug) => {
window.history.replaceState({}, '', `${window.location.pathname}#${tabSlug}`);
};
Copy link
Member

Choose a reason for hiding this comment

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

Do we have shared lib functions for this? I feel like one or two other parts of our frontend code use similar features already

Copy link
Member

Choose a reason for hiding this comment

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

Not happy about the repetitive Gridding in here. Have you (a) tried out SemUI List using List.Header, List.Description and perhaps even List.Icon and (b) if a didn't work, can you please move the Grid cells into an "internal" component that you can reuse at least within this page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants