-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
perf: Use index lookup for warning & unspported tokens #11262
base: develop
Are you sure you want to change the base?
perf: Use index lookup for warning & unspported tokens #11262
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
7 Skipped Deployments
|
@@ -284,92 +284,88 @@ export function UniversalAddLiquidity({ | |||
}, [preferredFeeAmount, feeAmountFromUrl, handleFeePoolSelect, selectorType]) | |||
|
|||
return ( | |||
<> |
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.
Just removing the redundant outer div, rest is format changes
@@ -241,10 +241,10 @@ export function useIsTransactionUnsupported(currencyIn?: Currency | null, curren | |||
|
|||
// if unsupported list loaded & either token on list, mark as unsupported | |||
if (unsupportedTokens) { | |||
if (tokenIn && Object.keys(unsupportedTokens).includes(tokenIn.address)) { |
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.
Index lookup approach is better performant (especially mobile) instead of creating keys on each render
PR-Codex overview
This PR focuses on optimizing the handling of unsupported and warning tokens in the
useIsTransactionWarning
function and refactoring the JSX structure in theAddLiquidityV3
component for better readability and maintainability.Detailed summary
unsupportedTokens
andwarningTokens
to directly access the token address.AddLiquidityV3
component to improve readability by removing unnecessary fragments and restructuring the layout.