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

feature - Allow WalletModal wallets to be configurable as props #906

Closed
jhhb opened this issue Nov 19, 2022 · 3 comments
Closed

feature - Allow WalletModal wallets to be configurable as props #906

jhhb opened this issue Nov 19, 2022 · 3 comments
Assignees
Labels
feature New feature or request web3

Comments

@jhhb
Copy link

jhhb commented Nov 19, 2022

Hello, here's a feature request I had and would be happy to work on with some input from the team. Thanks for any help that can be provided.

Context

  • In WalletModdal/config.ts, there is a hard-coded array of elements that are used for rendering all of the Wallet-specific UI elements in the modal.
  • While I was working on an application, I wanted to be able to explicitly configure which providers were "valid" for my application; basically, I didn't want to give a user of my application the impression that Safepal was supported to the same degree that, e.g., Metamask is.

Proposal

  • Continue to use the hard-coded array by default, but allow the user to pass in a connectors prop, which overrides the hardcoded list; the connectors prop would be an array of the same type as the existing connectors variable

While this solves my issue, it creates a UX problem, which is that if a user passes in an odd number of wallet configurations, then they will get a wallet that has one "empty" grid cell. If that's enough of a problem for a consumer, there are ways to fix it, but I'd probably need some design input on how to handle that case.

For example, one way to solve it would be to make the odd element span the entire width of the container, but I think this would require changing GridStyled to be display:flex instead of display:grid, and would also require changes to its children.

Questions

  1. Does allowing wallets to be configurable by a consumer make sense?
  2. If so, how do you suggest handling the case of an odd number of wallet configs? Do nothing? My suggestion above? Something else?
@jhhb
Copy link
Author

jhhb commented Nov 19, 2022

here is an example of the UI I mention above that would happen by default with an odd number of elements:

Screen Shot 2022-11-19 at 3 06 14 PM

And here is an example of what the UI could look like with some changes to the styling:

Screen Shot 2022-11-19 at 3 08 03 PM

@BillyG83
Copy link
Contributor

Hi @jhhb thanks for taking an interest in the kit.

Sure, I think this sounds like a nice feature and we always welcome open source contributions to the kit. In and for the flex vs grid question I think the desired UI is achievable with both but whatever solution you prefer is fine with me.

Ping me when you complete the pull request and i'll glad review it for you =]

@BillyG83 BillyG83 added feature New feature or request web3 labels Nov 20, 2022
@BillyG83
Copy link
Contributor

I am closing this issue as soon this section of the repo will be depreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request web3
Projects
None yet
Development

No branches or pull requests

2 participants