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

Add people-rows ArchieML component #4235

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Add people-rows ArchieML component #4235

merged 1 commit into from
Dec 2, 2024

Conversation

rakyi
Copy link
Contributor

@rakyi rakyi commented Nov 29, 2024

  • The new component allows us to have rows of people in two columns
  • Add socials to person block

Screenshot 2024-11-29 at 17-58-24 Our Team - Our World in Data

Copy link
Contributor Author

rakyi commented Nov 29, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@rakyi rakyi requested a review from ikesau November 29, 2024 16:55
@rakyi rakyi marked this pull request as ready for review November 29, 2024 16:56
@rakyi
Copy link
Contributor Author

rakyi commented Nov 29, 2024

@ikesau I tried to make use of more of the existing grid system, but I still think flex makes the most sense for switching from a two column layout on a bigger screen to a single column on a small screen, given the constraints I explained before. LMK what you think.

@owidbot
Copy link
Contributor

owidbot commented Nov 29, 2024

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-people-rows

SVG tester:

Number of differences (default views): 0 ✅
Number of differences (all views): 0 ✅

Edited: 2024-11-29 17:30:53 UTC
Execution time: 1.29 seconds

Copy link
Member

@ikesau ikesau left a comment

Choose a reason for hiding this comment

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

nice and easy 👍

the css grid saga continues 😂

db/model/Gdoc/rawToEnriched.ts Outdated Show resolved Hide resolved
className={cx(
"people",
{
"people-cols-2": columns === "2",
Copy link
Member

Choose a reason for hiding this comment

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

If I'm understanding the requirements correctly based on what it's currently doing when i test the article on staging, when columns: 2 is set, we want:

lg - 1 column
md - 2 coumns
sm - 1 column

if so, could you do something like:

const columnClassNames = {
1: "grid-cols-1",
2: "grid-sm-cols-1 grid-md-cols-2 grid-lg-cols-1"
}
<div className={cx("people grid", columnClassNames[columns])}>
  ...children
</div>

And then you don't have to worry about flex or that calc statement or anything. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, you are totally right. I somehow got the wrong impression about how ordering of elements changes in a grid when you change from two columns to a single column. Also, it should be just lg-up instead of lg-only. Thanks for being persistent. 🙂 Fortunately it's a small change and didn't cost us too much time.

* The new component allows us to have rows of people in two columns
* Add socials to person block
@rakyi rakyi merged commit 7cb2d4f into master Dec 2, 2024
11 of 14 checks passed
@rakyi rakyi deleted the people-rows branch December 2, 2024 10:18
@rakyi rakyi linked an issue Dec 12, 2024 that may be closed by this pull request
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.

Add new archie block for a person's bio
3 participants