mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
field fixes
This commit is contained in:
parent
458a7bf736
commit
4495a998d9
@ -16,6 +16,8 @@ export default function URLInput({
|
|||||||
isLoading: boolean
|
isLoading: boolean
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const [field, meta] = useField(props as FieldInputProps<any>)
|
const [field, meta] = useField(props as FieldInputProps<any>)
|
||||||
|
const isButtonDisabled =
|
||||||
|
!field.value || field.value.length === 0 || field.value === ''
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
@ -25,12 +27,11 @@ export default function URLInput({
|
|||||||
type="url"
|
type="url"
|
||||||
onBlur={(e: React.SyntheticEvent) => handleButtonClick(e, field.value)}
|
onBlur={(e: React.SyntheticEvent) => handleButtonClick(e, field.value)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
style="primary"
|
style="primary"
|
||||||
size="small"
|
size="small"
|
||||||
onClick={(e: React.SyntheticEvent) => e.preventDefault()}
|
onClick={(e: React.SyntheticEvent) => e.preventDefault()}
|
||||||
disabled={!field.value}
|
disabled={isButtonDisabled}
|
||||||
>
|
>
|
||||||
{isLoading ? <Loader /> : submitText}
|
{isLoading ? <Loader /> : submitText}
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -36,6 +36,11 @@ export default function ServicesFields(): ReactElement {
|
|||||||
component={Input}
|
component={Input}
|
||||||
name="services[0].dataTokenOptions"
|
name="services[0].dataTokenOptions"
|
||||||
/>
|
/>
|
||||||
|
<Field
|
||||||
|
{...getFieldContent('providerUri', content.services.fields)}
|
||||||
|
component={Input}
|
||||||
|
name="services[0].providerUri"
|
||||||
|
/>
|
||||||
<Field
|
<Field
|
||||||
{...getFieldContent('files', content.services.fields)}
|
{...getFieldContent('files', content.services.fields)}
|
||||||
component={Input}
|
component={Input}
|
||||||
@ -57,11 +62,6 @@ export default function ServicesFields(): ReactElement {
|
|||||||
component={Input}
|
component={Input}
|
||||||
name="services[0].timeout"
|
name="services[0].timeout"
|
||||||
/>
|
/>
|
||||||
<Field
|
|
||||||
{...getFieldContent('providerUri', content.services.fields)}
|
|
||||||
component={Input}
|
|
||||||
name="services[0].providerUri"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* {content.services.fields.map(
|
{/* {content.services.fields.map(
|
||||||
(field: FormFieldContent) =>
|
(field: FormFieldContent) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user