-
Notifications
You must be signed in to change notification settings - Fork 50
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
Use showcase on splash #901
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool to see!
It makes me think that visual indicators to distinguish {core,groups,community} and {dataset,narrative} will be really useful¹. Similar in spirit to Nextclade's badges. (All of which are out of scope for this PR -- without one of us taking on the role of a UI designer these interfaces will have to develop naturally over time.)
¹ The card styles partially convey this, but not in an understandable way to users.
644ea28
to
0dc321a
Compare
0dc321a
to
98f4616
Compare
98f4616
to
7b99c6a
Compare
7b99c6a
to
eefb79e
Compare
This allows the text to be customized for non-filter showcases.
eefb79e
to
66b395f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Design thinking
With this PR, the Showcase component is used in 2 places:
- Splash (
/
) - ListResources (
/pathogens
)
There are two features proposed for usage on Splash:
These are great ideas and I see them as in-scope of #849's completion.
From an implementation perspective, it's helpful to consider which of these features also apply to ListResources. (1) maybe, but most likely not (2).
Given the existing and upcoming divergence in features, I decided to make the entire individual card component customizable by the context, implemented as 25b545d + 7c2d301:
nextstrain.org/static-site/src/components/ListResources/index.tsx
Lines 78 to 80 in 66b395f
<SetSelectedFilterOptions.Provider value={setSelectedFilterOptions}> | |
<Showcase cards={showcaseCards} CardComponent={FilterShowcaseTile} /> | |
</SetSelectedFilterOptions.Provider> |
<Showcase cards={cards} CardComponent={UrlShowcaseTile} /> |
This is a larger refactor, but it should make those design ideas easier to implement.
66b395f
to
e6fa8aa
Compare
This allows the showcase to be used in other contexts. The most notable change is the separation of the filtering card component (specific to ListResources) from the reusable parts of the Showcase component.
Start by copying the current featured listings from the different sections on Splash.
These are shown in the newly added showcase.
Reflects changes from the previous two commits.
Making some of these dataset URLs explicit somewhat goes against the slack discussion linked in 3edcf03 but now it's easy to change the cards - something we'll hopefully do frequently - that explicit links, and the more detailed titles they allow, are preferable. Co-authored-by: James Hadfield <[email protected]>
e6fa8aa
to
a19026e
Compare
Here I went through to try to surface non-core datasets. I also tried to temper down the language. It's more approachable to just say "H5N1 cattle outbreak" instead of "Avian influenza (cattle flu genome)" or "Ebola in the DRC" rather than "DRC Ebola (2018-19)". I also switched to capitalization consistent with mid-sentence usage, eg "mpox" rather than "Mpox" as per our capitalization on the /pathogens page.
I updated tiles further mainly to include more examples and to simplify text. I also did a small update to the styling to make text fit better. Here's before 4bc2acc: And here's after: |
Nice work here @victorlin! With the small tweaks above, I'm happy for this to be merged into |
Not all were copied, resulting in a mix of imports from Showcase and Cards. Copy the rest to allow further Showcase-specific customization.
This pushes the black text box up and to the left to leave more space for text.
4bc2acc
to
52e964e
Compare
Thanks for pushing the tweaks @trvrb. I've replaced 4bc2acc with 9f72478...52e964e so that the styling adjustments don't affect the cards on |
I'll plan to merge this tomorrow, leaving another day for reviews. In terms of implementation, I'm confident in most changes except 1414985 may prompt some feedback. After some thinking in #849 (comment) and some design drafting today, I've a sense that we'll eventually want enough deviation where it doesn't make sense to re-use the same Showcase component between splash and |
The arrow should be the same size across all usages, not inferred by parent font size.
preview
Description of proposed changes
Moving cards from individual sections to a shared showcase defined by a single YAML file.
For later
Related issue(s)
#849
Checklist
Check if changes affect the resource index JSON revision