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:
commit
a103240592
@ -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>
|
||||
|
@ -492,7 +492,9 @@ export default function Compute({
|
||||
action={<SuccessAction />}
|
||||
/>
|
||||
)}
|
||||
{type !== 'algorithm' && (
|
||||
<Web3Feedback isBalanceSufficient={isBalanceSufficient} />
|
||||
)}
|
||||
</footer>
|
||||
</>
|
||||
)
|
||||
|
@ -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 +
|
||||
|
Loading…
x
Reference in New Issue
Block a user