Skip to content

chore: Add Code Connect for ButtonHero - #1467

Closed
andrewjcohen wants to merge 3 commits into
mainfrom
code-connect/button-hero
Closed

andrewjcohen wants to merge 3 commits into
mainfrom
code-connect/button-hero

Conversation

@andrewjcohen

@andrewjcohen andrewjcohen commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds Figma Code Connect mappings for ButtonHero so Dev Mode shows Storybook-style JSX on both platforms. Size, label, and icons live on the nested ButtonBase instance (not on the ButtonHero set), so mappings follow the same figma.nestedProps('ButtonBase') pattern as Button.

ButtonHero.figma.tsx

New ButtonHero.figma.tsx for React Native.

Updated ButtonHero.figma.tsx for React (retargeted from the previous Figma node to 9309-7848).

Matched props

  • nested ButtonBase.size → size (ButtonHeroSize, via figma.nestedProps('ButtonBase'))
  • nested ButtonBase.label → children (via figma.nestedProps('ButtonBase'))
  • nested startIcon (Figma Only) → startIconName (IconName.Add when true)
  • nested endIcon (Figma Only) → endIconName (IconName.Add when true)
  • _Loading Label show loadingText / loadingText → loadingText (via figma.nestedProps('_Loading Label'))
  • isLoading → isLoading
  • isDisabled → isDisabled

Intentionally omits Figma-only properties: state (Figma Only), hasAvatar (Figma Only), hasBadge (Figma Only)

Related issues

Fixes:

Manual testing steps

  • Open ButtonHero in Figma Dev Mode and confirm the React Native and React snippets appear
  • Toggle nested ButtonBase size (Sm / Md / Lg) and verify size={ButtonHeroSize.*} updates
  • Toggle startIcon (Figma Only) / endIcon (Figma Only) and confirm startIconName / endIconName appear or drop
  • Toggle isLoading and show loadingText and confirm loadingText maps correctly
  • Toggle isDisabled and confirm the snippet updates
  • Confirm the example is clean JSX (no Error badges on nested props)

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Links

Compare the preview for this pull request with the latest Storybooks from the main branch.

🔀 Pull Request Preview

🌳 Main Branch (Latest)

Omit default/optional props when off and drop spread so Figma shows Storybook-style JSX.
@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Links

Compare the preview for this pull request with the latest Storybooks from the main branch.

🔀 Pull Request Preview

🌳 Main Branch (Latest)

@andrewjcohen
andrewjcohen deleted the code-connect/button-hero branch August 28, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant