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:
parent
07bad6ead9
commit
ffca6f1bd6
@ -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) => (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user