Skip to content

Enhance ConnectButton with optional icons#500

Open
Emmanuelmelvin wants to merge 2 commits intoMystenLabs:mainfrom
Emmanuelmelvin:main
Open

Enhance ConnectButton with optional icons#500
Emmanuelmelvin wants to merge 2 commits intoMystenLabs:mainfrom
Emmanuelmelvin:main

Conversation

@Emmanuelmelvin
Copy link
Copy Markdown

Description

This PR enhances the ConnectButton component by adding two new optional props: iconBefore and iconAfter.
These allow consumers to pass custom React nodes (e.g., wallet icons, status indicators) that render before or after the connectText label.

Additionally, a new unit test was added to verify that iconBefore and iconAfter render correctly alongside the button text.

Test plan

  • Added a test using @testing-library/react to render ConnectButton with iconBefore and iconAfter props.
  • Verified that both icons appear in the DOM along with the connectText.
  • Ensured that clicking the button still opens the connect modal as expected.

…tButton

Allow consumers to pass custom React nodes to be rendered before or after
the connect button text. This enables more flexible UI designs, such as
adding wallet icons or status indicators alongside the button label.
…rectly

Adds a unit test to ensure that optional iconBefore and iconAfter props
are rendered in the ConnectButton, in addition to the connectText.
@Emmanuelmelvin Emmanuelmelvin requested a review from a team as a code owner August 15, 2025 09:14
@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sui-typescript-docs Ready Preview Comment Aug 15, 2025 9:18am

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.

1 participant