1
0
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:
claudiaHash 2021-02-08 14:25:22 +02:00 committed by GitHub
parent 1f72fd3951
commit 8946f6fa6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -12,11 +12,12 @@ declare type TagsProps = {
}
const Tag = ({ tag, noLinks }: { tag: string; noLinks?: boolean }) => {
const urlEncodedTag = encodeURIComponent(tag)
return noLinks ? (
<span className={styles.tag}>{tag}</span>
) : (
<Link
to={`/search?tags=${tag}&sort=created&sortOrder=desc`}
to={`/search?tags=${urlEncodedTag}&sort=created&sortOrder=desc`}
className={styles.tag}
title={tag}
>

View File

@ -26,8 +26,9 @@ export default function SearchBar({
async function startSearch(e: FormEvent<HTMLButtonElement>) {
e.preventDefault()
if (value === '') return
const urlEncodedValue = encodeURIComponent(value)
const url = await addExistingParamsToUrl(location, 'text')
navigate(`${url}&text=${value}`)
navigate(`${url}&text=${urlEncodedValue}`)
}
return (