-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: Add search to from and to fields in swap form #2532
Conversation
const filterOptions = useCallback((filterBy: string) => { | ||
const filterByLower = filterBy.toLowerCase(); | ||
return options.filter((option) => option.name.toLowerCase().includes(filterByLower) | ||
|| option.symbol.toLowerCase().includes(filterByLower) | ||
|| option.id.toLowerCase().endsWith(filterByLower)); | ||
}, [options]); | ||
|
||
const filteredOptions = !searchValue | ||
? options | ||
: filterOptions(searchValue); |
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.
Should this just be one thing in a useMemo? Otherwise it filter on every render
View your CI Pipeline Execution ↗ for commit 1e36d2c.
☁️ Nx Cloud last updated this comment at |
return options; | ||
} | ||
return filterOptions(searchValue, options); | ||
}, [options, searchValue, filterOptions]); |
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.
filterOptions doesn't need to be a dep now
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.
I wasn't sure if linter would complain or not
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.
Test?
Hi👋, please prefix this PR's title with:
breaking-change:
if you have introduced modification that necessitates immediate adjustments by this SDK's users to their applications, clients, or integrations to avert disruptions to existing features or functionalities.feat:
,fix:
,refactor:
,docs:
, orchore:
.Summary
Allows filtering tokens in from and to list in the swap form - can search by name, symbol or contract address
Screen.sharing.-.2025-02-20.1_43_13.PM.mp4