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

set max sell value on token selection (swaps) #1653

Merged
merged 4 commits into from
Aug 10, 2024

Conversation

magiziz
Copy link
Contributor

@magiziz magiziz commented Aug 5, 2024

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.

Copy link

linear bot commented Aug 5, 2024

@magiziz magiziz marked this pull request as ready for review August 5, 2024 15:56
Copy link

github-actions bot commented Aug 5, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-33d6f26d49242cf34ff04e0eeaf839ad4f01a228
screenshots

Copy link

github-actions bot commented Aug 5, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-fd79319542e2784dd585efe3903a4e8a01089b52
screenshots

Copy link

github-actions bot commented Aug 5, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-cda4b6ef88fa184ffc515be1e9626f747f57ca59
screenshots

Copy link

github-actions bot commented Aug 5, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-cda4b6ef88fa184ffc515be1e9626f747f57ca59
screenshots

Copy link

github-actions bot commented Aug 7, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-cda4b6ef88fa184ffc515be1e9626f747f57ca59
screenshots

Copy link

github-actions bot commented Aug 7, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-cda4b6ef88fa184ffc515be1e9626f747f57ca59
screenshots

Copy link
Collaborator

@DanielSinclair DanielSinclair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link

github-actions bot commented Aug 8, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-ce9f5bc8d1cec1a7b8626c636aa435fc2caf068f
screenshots

Copy link

github-actions bot commented Aug 8, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-fd30a1ba00c771a80ed8bc868beb5edda6ee7bf9
screenshots

Copy link

github-actions bot commented Aug 8, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-fd30a1ba00c771a80ed8bc868beb5edda6ee7bf9
screenshots

Copy link

github-actions bot commented Aug 8, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-a9ab51894784d4fd9555f8f7f476ef45638dfa2b
screenshots

Copy link

github-actions bot commented Aug 8, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-a9ab51894784d4fd9555f8f7f476ef45638dfa2b
screenshots

@DanielSinclair DanielSinclair changed the title chore: set max sell value on token selection (swaps) set max sell value on token selection (swaps) Aug 8, 2024
Copy link

github-actions bot commented Aug 8, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-a9ab51894784d4fd9555f8f7f476ef45638dfa2b
screenshots

@@ -454,8 +456,12 @@ export function Swap({ bridge = false }: { bridge?: boolean }) {
if (!assetToBuy) tokenToBuyInputRef.current?.openDropdown();
setAssetToSellInputValue('');
setAssetToBuyInputValue('');
if (asset) {
setHasRequestedMaxValueAssetToSell(true);
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link

github-actions bot commented Aug 8, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-738b90ba470c75a9cb19702e675c621f75f62aac

Copy link

github-actions bot commented Aug 8, 2024

Here's the packed extension for this build:
node_modules.tar.gz
rainbowbx-738b90ba470c75a9cb19702e675c621f75f62aac
screenshots

@magiziz
Copy link
Contributor Author

magiziz commented Aug 8, 2024

Chrome swap e2e test seems to fail, but works locally. Going to see what's going on.

image

@DanielSinclair DanielSinclair added this pull request to the merge queue Aug 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 10, 2024
@magiziz magiziz added this pull request to the merge queue Aug 10, 2024
Merged via the queue into master with commit 2febf4c Aug 10, 2024
15 checks passed
@magiziz magiziz deleted the @mago/token-sell-max-input branch August 10, 2024 19:06
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.

4 participants