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

fix(CallToAction): update and constrain prop object type shape #12015

Merged
merged 6 commits into from
Apr 23, 2024

Conversation

TylerAPfledderer
Copy link
Contributor

@TylerAPfledderer TylerAPfledderer commented Jan 25, 2024

Description

This PR primarily addresses a React console warning from the CallToAction hero component:

Warning: CallToAction: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop.

Trying to use the key prop will only result in receiving undefined and create styling bugs when using it to render the button variant. Instead create unique prop index to access an index value for use in the props logic.

Also modifies typing related CallToAction so that:

  • Usage of the Button component props variant and isSecondary are constrained to only the logic within CallToAction to determine their values per instance
  • When creating data for the buttons in a hero component the user is not required to explicitly supply an index value when that is provided via render mapping.

Related Issue

N/A

Copy link

netlify bot commented Jan 25, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 50f63e6
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/66255b1f9d8211000820c1f9
😎 Deploy Preview https://deploy-preview-12015--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.

@github-actions github-actions bot added content 🖋️ This involves copy additions or edits review needed 👀 tooling 🔧 Changes related to tooling of the project labels Jan 25, 2024
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.

Lgtm, thanks @TylerAPfledderer!

@wackerow wackerow merged commit 816b1d8 into ethereum:dev Apr 23, 2024
8 of 10 checks passed
@TylerAPfledderer TylerAPfledderer deleted the fix/CallToAction-index-prop branch April 23, 2024 02:01
This was referenced Apr 24, 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 tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants