mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Fix/url encoding categories tags (#368)
* tag encoding issue resolved * search value encoded * log deleted Co-authored-by: claudia.holhos <claudia.holhos@hpm.ro>
This commit is contained in:
parent
1f72fd3951
commit
8946f6fa6b
@ -12,11 +12,12 @@ declare type TagsProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Tag = ({ tag, noLinks }: { tag: string; noLinks?: boolean }) => {
|
const Tag = ({ tag, noLinks }: { tag: string; noLinks?: boolean }) => {
|
||||||
|
const urlEncodedTag = encodeURIComponent(tag)
|
||||||
return noLinks ? (
|
return noLinks ? (
|
||||||
<span className={styles.tag}>{tag}</span>
|
<span className={styles.tag}>{tag}</span>
|
||||||
) : (
|
) : (
|
||||||
<Link
|
<Link
|
||||||
to={`/search?tags=${tag}&sort=created&sortOrder=desc`}
|
to={`/search?tags=${urlEncodedTag}&sort=created&sortOrder=desc`}
|
||||||
className={styles.tag}
|
className={styles.tag}
|
||||||
title={tag}
|
title={tag}
|
||||||
>
|
>
|
||||||
|
@ -26,8 +26,9 @@ export default function SearchBar({
|
|||||||
async function startSearch(e: FormEvent<HTMLButtonElement>) {
|
async function startSearch(e: FormEvent<HTMLButtonElement>) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
if (value === '') return
|
if (value === '') return
|
||||||
|
const urlEncodedValue = encodeURIComponent(value)
|
||||||
const url = await addExistingParamsToUrl(location, 'text')
|
const url = await addExistingParamsToUrl(location, 'text')
|
||||||
navigate(`${url}&text=${value}`)
|
navigate(`${url}&text=${urlEncodedValue}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user