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

refactor(ContentHero): update and apply component usage #12639

Conversation

TylerAPfledderer
Copy link
Contributor

@TylerAPfledderer TylerAPfledderer commented Apr 3, 2024

Description

This PR add modifications to the ContentHero component and applies it to the Upgrade layout.

  • The description section of the hero can accept either a string or components
    • In prod for the Upgrade layout, a list of descriptions render with a "last updated" timestamp
  • The Image component has new styling with predefined dimensions
  • Update types to allow for the heroImg prop to accept either a string or the static image data object, depending on the hero component to be used.
  • Affects the /merge and beacon-chain pages

Additional Information

This relieves a bug in the roadmap merge page where the alignment of the image and content in not centered and the image is clipped.

Copy link

netlify bot commented Apr 3, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 9e46d04
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/664cad19204af700085b5fea
😎 Deploy Preview https://deploy-preview-12639--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 46 (🔴 down 10 from production)
Accessibility: 92 (no change from production)
Best Practices: 89 (🔴 down 9 from production)
SEO: 93 (🔴 down 2 from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added review needed 👀 tooling 🔧 Changes related to tooling of the project labels Apr 3, 2024
@TylerAPfledderer TylerAPfledderer force-pushed the refactor/ContentHero-content-adjustments branch from 8d31fcb to 4479689 Compare April 3, 2024 04:24
@github-actions github-actions bot added the content 🖋️ This involves copy additions or edits label Apr 3, 2024
@TylerAPfledderer TylerAPfledderer marked this pull request as ready for review April 3, 2024 23:05
@TylerAPfledderer
Copy link
Contributor Author

Hey @nloureiro ! Would like a review from you on these updates.

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

Great job @TylerAPfledderer looks good!

Noting the same issue you mentioned
image

Wondering if this is something we should try to tackle @nloureiro. @TylerAPfledderer if so, we might need to accept imageProps so that the consumer can tweak the image as necessary.

src/components/Hero/ContentHero/index.tsx Outdated Show resolved Hide resolved
@TylerAPfledderer
Copy link
Contributor Author

we might need to accept imageProps so that the consumer can tweak the image as necessary.

It's not clear to me how that would be possible if this hero is being applied in a layout component. Unless you would be thinking of setting up some conditional at the layout level to set overrides based on the image file path provided by front matter. Is that what you are thinking of?

@pettinarip
Copy link
Member

@TylerAPfledderer
True. Perhaps its not going to be useful here.

I was basically thinking about overriding the defaults to try to recreate the same styles we had before in the Upgrade layout image.

// Roadmap layout
<ContentHero heroImg={frontmatter.image}>

// Upgrade layout
<ContentHero heroImg={frontmatter.image} imageProps={{ objectFit: "cover", ... }}>

@TylerAPfledderer
Copy link
Contributor Author

@TylerAPfledderer
True. Perhaps its not going to be useful here.

I was basically thinking about overriding the defaults to try to recreate the same styles we had before in the Upgrade layout image.

// Roadmap layout
<ContentHero heroImg={frontmatter.image}>

// Upgrade layout
<ContentHero heroImg={frontmatter.image} imageProps={{ objectFit: "cover", ... }}>

Oh! I could look at this.

@wackerow wackerow added the needs design approval 🧑‍🎨 Approval from a designer is needed before merging label Apr 9, 2024
@wackerow
Copy link
Member

wackerow commented Apr 9, 2024

@pettinarip Is this something that should hold things up from a dev perspective?

cc: @nloureiro for an approval

@pettinarip
Copy link
Member

@pettinarip Is this something that should hold things up from a dev perspective?

cc: @nloureiro for an approval

No, I'd say that if designers are ok its ready to be merged

@TylerAPfledderer
Copy link
Contributor Author

Hey @nloureiro ! Would like a review from you on these updates.

@nloureiro provided the above links again for visibility with your review!

@nloureiro
Copy link
Contributor

Thank you @TylerAPfledderer

I'm not sure where to give feedback on the chromatic part. Here or on the chromatic side?

But for the dev preview link, I found some adjustments needed. let me know if this makes sense

(https://www.figma.com/file/NrNxGjBL0Yl1PrNrOT8G2B/ethereum.org-Design-System?type=design&node-id=11713%3A6568&mode=design&t=dokTXVgchl8dd6uE-1)
Screen Shot 2024-04-09 05 32 14 PM

@TylerAPfledderer
Copy link
Contributor Author

TylerAPfledderer commented Apr 9, 2024

Thank you @TylerAPfledderer

I'm not sure where to give feedback on the chromatic part. Here or on the chromatic side?

But for the dev preview link, I found some adjustments needed. let me know if this makes sense

(https://www.figma.com/file/NrNxGjBL0Yl1PrNrOT8G2B/ethereum.org-Design-System?type=design&node-id=11713%3A6568&mode=design&t=dokTXVgchl8dd6uE-1)
Screen Shot 2024-04-09 05 32 14 PM

@nloureiro sorry, here is an updated changeset with the snapshot

I think if there are changes needed that are in the scope of the PR, to deny the snapshot and add a comment in Chromatic underneath the snapshot. I think that is more streamlined for you and isolate the discussions.

The anchor bar beneath the hero is not showing as a part of the component. I think this and removing the "last updated" content are a different scope.

@nloureiro
Copy link
Contributor

Thank you @TylerAPfledderer
I'm not sure where to give feedback on the chromatic part. Here or on the chromatic side?
But for the dev preview link, I found some adjustments needed. let me know if this makes sense
(https://www.figma.com/file/NrNxGjBL0Yl1PrNrOT8G2B/ethereum.org-Design-System?type=design&node-id=11713%3A6568&mode=design&t=dokTXVgchl8dd6uE-1)
Screen Shot 2024-04-09 05 32 14 PM

@nloureiro sorry, here is an updated changeset with the snapshot

I think if there are changes needed that are in the scope of the PR, to deny the snapshot and add a comment in Chromatic underneath the snapshot. I think that is more streamlined for you and isolate the discussions.

The anchor bar beneath the hero is not showing as a part of the component. I think this and removing the "last updated" content are a different scope.

ok. I agree. I can open an issue to be worked on a different PR

What I'm afraid of is having a "Frankenstein" look in between PRs, where the new components are done but not adjusted in the specifics like content and extra inline style that might have.
I guess we need to be extra careful with this (cc @pettinarip )

@TylerAPfledderer
Copy link
Contributor Author

Updated the branch and removed the "More Content" anchor link at the bottom

@wackerow
Copy link
Member

@nloureiro https://www.chromatic.com/review?appId=63b7ea99632763723c7f4d6b&number=12639&type=linked&view=activity Currently blocking; can merge once approved

@nloureiro
Copy link
Contributor

@nloureiro https://www.chromatic.com/review?appId=63b7ea99632763723c7f4d6b&number=12639&type=linked&view=activity Currently blocking; can merge once approved

It looks good to me!

@pettinarip pettinarip merged commit 4c5efcf into ethereum:dev May 31, 2024
10 checks passed
This was referenced Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits needs design approval 🧑‍🎨 Approval from a designer is needed before merging tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants