anza-xyz / wallet-adapter

Modular TypeScript wallet adapters and components for Solana applications.
https://anza-xyz.github.io/wallet-adapter/
Apache License 2.0
1.61k stars 962 forks source link

Refactor default Mobile Wallet Adapter button UI #1005

Open Michaelsulistio opened 4 months ago

Michaelsulistio commented 4 months ago

Refactor MWA option in Modal UI

This PR proposes refactoring how the Mobile Wallet Adapter option is presented in the default WalletModal UI. Very open and looking forward to feedback and discussion.

Rationale

The MWA option is an important action on mobile, one which maximizes wallet choice, since it will allow selection of any user-installed wallets which support the agnostic MWA protocol.

This change aims to provide better context clues to the user around its usage. It replaces the current icon and text “Mobile wallet adapter”, which is not self-explanatory for users not familiar with what that means. The new wording is more descriptive and helps users understand the connection with the installed wallet apps on their phone.

Changes

In WalletModal, detect the mobileWalletAdapter and, if present, render:

Next

If needed, we can additionally create a similar change in the UI for ant-design and material-ui.

Testing

Tested on a local build with the example app across these different test cases, making sure to test that non-MWA modal's are unaffected.

Test Case Platform Screenshot Video
2 Listed Wallets, 0 Collapsed Wallets Android Screenshot 2024-07-25 at 2 39 15 PM Video
2 Listed Wallets, 0 Collapsed Wallets Android Screenshot 2024-07-25 at 2 58 23 PM Video
1 Listed Wallets, 0 Collapsed Wallets iOS Screenshot 2024-07-25 at 2 56 16 PM Video
2 Listed Wallets, 1 Collapsed Wallets iOS Screenshot 2024-07-25 at 2 43 49 PM Video