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(Trilemma): update Chakra implementations #10490

Merged

Conversation

TylerAPfledderer
Copy link
Contributor

@TylerAPfledderer TylerAPfledderer commented Jun 19, 2023

Description

Updates usage of Chakra UI for the Trilemma component.

  • Replace an instance of Flex with Stack
    • This is minor. Stack should be the preferred choice over Flex if the default flexDirection should be column if there is no expectation in changing to row at a breakpoint.
  • Apply forwardRef to the CircleSelect component for passing event props.
  • Remove children type signature from svg Text component as it is already present in HTMLChakraProps
  • Move spacing props higher up to a parent or ancestor for more streamlined control.
  • Remove unneeded props from DrawerContent and the child Card
  • Use string values for hideBelow and hideFrom as the compiled lg breakpoint values renders correctly.
  • For the Stack component wrapping the text content, remove the base flex prop value as it does not need to be declared for the breakpoint object syntax to compile correctly.

Preview link

Related Issue

N/A

@gatsby-cloud
Copy link

gatsby-cloud bot commented Jun 19, 2023

✅ ethereum-org-website-dev deploy preview ready

@github-actions github-actions bot added content 🖋️ This involves copy additions or edits dependencies 📦 Changes related to project dependencies documentation 📖 event 📅 This issue or pull request is related to an event listing tooling 🔧 Changes related to tooling of the project translation 🌍 This is related to our Translation Program labels Oct 21, 2023
Copy link

netlify bot commented Nov 3, 2023

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 048ce66
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/6603118e643ec00008021c12
😎 Deploy Preview https://deploy-preview-10490--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@TylerAPfledderer TylerAPfledderer force-pushed the refactor/trilemma-chakra-updates branch from 9d5d0ae to 6cfa88e Compare November 3, 2023 04:54
Copy link
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

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

Hey @TylerAPfledderer, solid work here... gave it a run through and looks good, just a couple notes. From the PR description didn't quite sound like layout changes were part of this, so just left a couple notes of where it looked off compared to production and how I think we can get it closer.

With those few adjustments I think we can get this in... I'll circle back on this and if you're too busy I'm happy to patch it up

src/components/Trilemma/index.tsx Show resolved Hide resolved
Comment on lines 41 to 42
pl={{ lg: 12 }}
pr={{ lg: 32 }}
Copy link
Member

Choose a reason for hiding this comment

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

If we're adding this here, we'll need to also remove the margins on <chakra.svg inside Triangle.tsx (L115-117).. we shouldn't need mt since we're aligning center, and we shouldn't need me since we handle this here. I think we still need my with how it's set up to keep the height within reason on mobile.

We should make these RTL-friendly though:

Suggested change
pl={{ lg: 12 }}
pr={{ lg: 32 }}
ps={{ lg: 12 }}
pe={{ lg: 32 }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied RTL-aware props.

At the very least, top margin should be considered, as even with larger screens, there are certain points where the text wrapping expands there container height be too close to the bounds of the section container compared to how much spacing there is consistently through the breakpoints. center alignment primary helps the triangle svg though.

Example is at 996px without top margin:
image

src/components/Trilemma/index.tsx Outdated Show resolved Hide resolved
@TylerAPfledderer TylerAPfledderer force-pushed the refactor/trilemma-chakra-updates branch from d1dacb9 to 6343bfa Compare February 15, 2024 05:22
Copy link
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

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

Nice job @TylerAPfledderer! Approving this from a dev perspective but would like to have a designer approval before finally pulling this in. cc: @nloureiro @konopkja

Not positive we can use "2xl" for a borderTopRadius but I'm fairly certain we can... if you agree, feel free to commit that suggestion, but not a blocker.


TODO:

  • Designer approval

src/components/Trilemma/index.tsx Outdated Show resolved Hide resolved
src/components/Trilemma/index.tsx Outdated Show resolved Hide resolved
lg: "0 1 500px",
}}
>
<OldHeading fontSize="2rem" mt={0}>
<Heading fontSize="2rem">
Copy link
Member

Choose a reason for hiding this comment

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

@nloureiro Brought this up elsewhere, but more use of a non-standard font size

image

^ These are the sizes we have assigned to tokens right now... not requesting anything for this PR, just noting... card here

@wackerow wackerow added refactor ♻️ Changes which don't affect functionality needs design approval 🧑‍🎨 Approval from a designer is needed before merging and removed translation 🌍 This is related to our Translation Program dependencies 📦 Changes related to project dependencies tooling 🔧 Changes related to tooling of the project internal 🏠 event 📅 This issue or pull request is related to an event listing content 🖋️ This involves copy additions or edits labels Mar 22, 2024
TylerAPfledderer and others added 2 commits March 25, 2024 19:49
update `borderTopRadius` value on `DrawerContent` usage

Co-authored-by: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
it's better with the spacing

Co-authored-by: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
@wackerow wackerow merged commit 64f0e3c into ethereum:dev Mar 26, 2024
7 of 10 checks passed
@wackerow
Copy link
Member

Thanks again @TylerAPfledderer!!

@TylerAPfledderer TylerAPfledderer deleted the refactor/trilemma-chakra-updates branch March 26, 2024 22:13
This was referenced Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs design approval 🧑‍🎨 Approval from a designer is needed before merging refactor ♻️ Changes which don't affect functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants