mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Fix mapping in search component and ux improvements (#1092)
* clear search input after submit
* fix mapping on sorting by tag (search query)
* fix property of undefined errors
* Revert "clear search input after submit"
This reverts commit 93dd57ae0b
.
This commit is contained in:
parent
942ead1b4c
commit
c438ba0a04
@ -15,7 +15,9 @@ const Tag = ({ tag, noLinks }: { tag: string; noLinks?: boolean }) => {
|
|||||||
return noLinks ? (
|
return noLinks ? (
|
||||||
<span className={styles.tag}>{tag}</span>
|
<span className={styles.tag}>{tag}</span>
|
||||||
) : (
|
) : (
|
||||||
<Link href={`/search?tags=${urlEncodedTag}&sort=created&sortOrder=desc`}>
|
<Link
|
||||||
|
href={`/search?tags=${urlEncodedTag}&sort=metadata.created&sortOrder=desc`}
|
||||||
|
>
|
||||||
<a className={styles.tag} title={tag}>
|
<a className={styles.tag} title={tag}>
|
||||||
{tag}
|
{tag}
|
||||||
</a>
|
</a>
|
||||||
|
@ -61,8 +61,9 @@ export default function SearchPage({
|
|||||||
setTotalResults(undefined)
|
setTotalResults(undefined)
|
||||||
const queryResult = await getResults(parsed, chainIds, newCancelToken())
|
const queryResult = await getResults(parsed, chainIds, newCancelToken())
|
||||||
setQueryResult(queryResult)
|
setQueryResult(queryResult)
|
||||||
setTotalResults(queryResult.totalResults)
|
|
||||||
setTotalPagesNumber(queryResult.totalPages)
|
setTotalResults(queryResult?.totalResults || 0)
|
||||||
|
setTotalPagesNumber(queryResult?.totalPages || 0)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
},
|
},
|
||||||
[newCancelToken, setTotalPagesNumber, setTotalResults]
|
[newCancelToken, setTotalPagesNumber, setTotalResults]
|
||||||
|
Loading…
Reference in New Issue
Block a user