-
Notifications
You must be signed in to change notification settings - Fork 35
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
set max sell value on token selection (swaps) #1653
Conversation
Here's the packed extension for this build: |
Here's the packed extension for this build: |
Here's the packed extension for this build: |
Here's the packed extension for this build: |
Here's the packed extension for this build: |
Here's the packed extension for this build: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Here's the packed extension for this build: |
Here's the packed extension for this build: |
Here's the packed extension for this build: |
Here's the packed extension for this build: |
Here's the packed extension for this build: |
Here's the packed extension for this build: |
@@ -454,8 +456,12 @@ export function Swap({ bridge = false }: { bridge?: boolean }) { | |||
if (!assetToBuy) tokenToBuyInputRef.current?.openDropdown(); | |||
setAssetToSellInputValue(''); | |||
setAssetToBuyInputValue(''); | |||
if (asset) { | |||
setHasRequestedMaxValueAssetToSell(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of a flag that triggers the useEffect
can't we just put setAssetToSellMaxValue();
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i tried doing that. One problem i saw is some funky state behaviours since you need to set the asset first before calling setAssetToSellMaxValue
. Here is an example of what we do in other places https://github.com/rainbow-me/browser-extension/blob/master/src/entries/popup/pages/swap/index.tsx#L527-L531
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see 🫠 hate it but seems like only refactoring everything to do that
2b9da55
to
1e9eb55
Compare
Here's the packed extension for this build: |
Here's the packed extension for this build: |
ff19091
to
e579ace
Compare
e579ace
to
4c4ef8a
Compare
Fixes BX-1566
Figma link (if any):
What changed (plus any additional context for devs)
Once sell token has been selected we set max input value.
Screen recordings / screenshots
token-to-sell-max-value.mov
What to test
Go to swaps, select a token and make sure the input value is set to max.