-
Notifications
You must be signed in to change notification settings - Fork 4
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
Rewrite AddLiquidityActionCard #134
Conversation
✅ Deploy Preview for aloe-blend-staging canceled.
|
✅ Deploy Preview for aloe-prime ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for aloe-earn canceled.
|
8283399
to
8f4c310
Compare
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.
Left a few suggestions and comments but overall, LGTM
Great work!
amount1Str: fields?.at(1) ?? '', | ||
lowerStr: fields?.at(2) ?? '', | ||
upperStr: fields?.at(3) ?? '', | ||
isToken0Selected: fields?.at(4) === '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.
not a huge fan of using strings for this but understand the reasoning and the tradeoff
prime/src/components/borrow/actions/UniswapAddLiquidityActionCard.tsx
Outdated
Show resolved
Hide resolved
setLocalToken0Amount(previousActionCardState.textFields[0]); | ||
setLocalToken1Amount(previousActionCardState.textFields[1]); | ||
if (lower != null && upper != null && currentTick != null) { | ||
if (shouldAmount0InputBeDisabled(lower, upper, currentTick)) { |
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.
This is on me as I did this, but I think shouldAmount0InputBeDisabled and shouldAmount1InputBeDisabled should be in this file above this component as they aren't relevant to other actions and don't make sense to have for general Uniswap purposes. You don't need to move them, just pointing it out.
With the live version, it's possible to make the tokenInputs spike to infinity and write "OUT OF BOUNDS" errors to the console. This rewrite fixes those issues (whatever they were) and substantially simplifies the code. Again, this is part of the broader refactor I'm working on.
When reviewing, there's really no point to looking at the diff. Better off seeing if it works in the deploy preview, and then just reading the new code in isolation.