paradigmxyz / rivet

Developer Wallet & DevTools for Anvil
MIT License
844 stars 73 forks source link

Enhancement: Loading state for ERC20 token imports #63

Closed jxom closed 1 year ago

jxom commented 1 year ago

The Request

The ability to see loading feedback in the UI when a user imports an ERC20 token address.

Problem

Right now, when a user imports an ERC20 token address on the token list screen, there is no loading UI for the background async work happening for useErc20Balance/useErc20Metadata.

Solution

As a user, I would expect to see some loading indicator (ie. on the "Import" button) in the UI to tell me that an ERC20 token is being imported.

b4s36t4 commented 1 year ago
Screenshot 2023-09-15 at 1 16 33 AM

@jxom The above UI seems good for you? we can't show loader on import button since that layout is totally isolated with the layout where we shows tokens. I feel showing here is the good approach.

b4s36t4 commented 1 year ago
Screenshot 2023-09-15 at 1 19 04 AM
jxom commented 1 year ago

@b4s36t4 – looks good! It might be nice to display the loading state in the same form as a TokenRow. For the title (e.g. "USD Coin"), it can show "Importing..." with the loading spinner on the side, then we can show the address (which we already know) underneath it? Obviously we won't have the input field or trash button.

b4s36t4 commented 1 year ago

@jxom Sure, will raise the PR with your suggestions.