1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

AssetSelection: add search by datatoken symbol (#482)

* add search by datatoken symbol

* case insensitive search for everything
This commit is contained in:
Matthias Kretschmann 2021-04-08 10:16:45 +02:00 committed by GitHub
parent 07bad6ead9
commit ffca6f1bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,7 @@ export default function AssetSelection({
type="search" type="search"
name="search" name="search"
size="small" size="small"
placeholder="Search by title or DID..." placeholder="Search by title, datatoken, or DID..."
value={searchValue} value={searchValue}
onChange={handleSearchInput} onChange={handleSearchInput}
className={styles.search} className={styles.search}
@ -65,8 +65,11 @@ export default function AssetSelection({
assets assets
.filter((asset: AssetSelectionAsset) => .filter((asset: AssetSelectionAsset) =>
searchValue !== '' searchValue !== ''
? asset.name.toLowerCase().includes(searchValue) || ? asset.name
asset.did.includes(searchValue) .toLowerCase()
.includes(searchValue.toLowerCase()) ||
asset.did.toLowerCase().includes(searchValue.toLowerCase()) ||
asset.symbol.toLowerCase().includes(searchValue.toLowerCase())
: asset : asset
) )
.map((asset: AssetSelectionAsset) => ( .map((asset: AssetSelectionAsset) => (