1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-30 05:41:41 +02:00

field fixes

This commit is contained in:
Matthias Kretschmann 2021-11-01 17:35:50 +01:00
parent 458a7bf736
commit 4495a998d9
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 8 additions and 7 deletions

View File

@ -16,6 +16,8 @@ export default function URLInput({
isLoading: boolean
}): ReactElement {
const [field, meta] = useField(props as FieldInputProps<any>)
const isButtonDisabled =
!field.value || field.value.length === 0 || field.value === ''
return (
<InputGroup>
@ -25,12 +27,11 @@ export default function URLInput({
type="url"
onBlur={(e: React.SyntheticEvent) => handleButtonClick(e, field.value)}
/>
<Button
style="primary"
size="small"
onClick={(e: React.SyntheticEvent) => e.preventDefault()}
disabled={!field.value}
disabled={isButtonDisabled}
>
{isLoading ? <Loader /> : submitText}
</Button>

View File

@ -36,6 +36,11 @@ export default function ServicesFields(): ReactElement {
component={Input}
name="services[0].dataTokenOptions"
/>
<Field
{...getFieldContent('providerUri', content.services.fields)}
component={Input}
name="services[0].providerUri"
/>
<Field
{...getFieldContent('files', content.services.fields)}
component={Input}
@ -57,11 +62,6 @@ export default function ServicesFields(): ReactElement {
component={Input}
name="services[0].timeout"
/>
<Field
{...getFieldContent('providerUri', content.services.fields)}
component={Input}
name="services[0].providerUri"
/>
{/* {content.services.fields.map(
(field: FormFieldContent) =>