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

Merge branch 'main' into fix/issue583-start-second-job

This commit is contained in:
Bogdan Fazakas 2021-05-10 15:39:01 +03:00
commit a103240592
3 changed files with 20 additions and 8 deletions

View File

@ -17,20 +17,30 @@ export default function SearchBar({
filters?: boolean
size?: 'small' | 'large'
}): ReactElement {
const [value, setValue] = useState(initialValue || '')
function handleChange(e: ChangeEvent<HTMLInputElement>) {
setValue(e.target.value)
}
let [value, setValue] = useState(initialValue || '')
async function startSearch(e: FormEvent<HTMLButtonElement>) {
e.preventDefault()
if (value === '') return
if (value === '') value = ' '
const urlEncodedValue = encodeURIComponent(value)
const url = await addExistingParamsToUrl(location, 'text')
navigate(`${url}&text=${urlEncodedValue}`)
}
async function emptySearch() {
const searchParams = new URLSearchParams(window.location.href)
const text = searchParams.get('text')
if (text !== ('' || undefined || null)) {
const url = await addExistingParamsToUrl(location, 'text')
navigate(`${url}&text=%20`)
}
}
function handleChange(e: ChangeEvent<HTMLInputElement>) {
setValue(e.target.value)
e.target.value === '' && emptySearch()
}
return (
<form className={styles.form}>
<InputGroup>

View File

@ -492,7 +492,9 @@ export default function Compute({
action={<SuccessAction />}
/>
)}
{type !== 'algorithm' && (
<Web3Feedback isBalanceSufficient={isBalanceSufficient} />
)}
</footer>
</>
)

View File

@ -20,7 +20,7 @@ export default function PageGatsbySearch(props: PageProps): ReactElement {
? `Published by ${accountTruncate(owner as string)}`
: `${
totalResults !== undefined
? searchValue
? searchValue && searchValue !== ' '
? totalResults === 0
? 'No results'
: totalResults +