diff --git a/content/pages/edit.json b/content/pages/edit.json index 13d6089c5..ac8e21e0d 100644 --- a/content/pages/edit.json +++ b/content/pages/edit.json @@ -20,6 +20,15 @@ "rows": 10, "required": true }, + { + "name": "price", + "label": "New Price", + "type": "number", + "min": "1", + "placeholder": "0", + "help": "Enter a new price.", + "required": true + }, { "name": "links", "label": "Sample file", diff --git a/src/@types/MetaData.d.ts b/src/@types/MetaData.d.ts index 7b8a85ab3..f70e69a0b 100644 --- a/src/@types/MetaData.d.ts +++ b/src/@types/MetaData.d.ts @@ -29,6 +29,7 @@ export interface MetadataEditForm { name: string description: string timeout: string + price?: number links?: string | EditableMetadataLinks[] } diff --git a/src/components/organisms/AssetActions/Edit/FormEditMetadata.tsx b/src/components/organisms/AssetActions/Edit/FormEditMetadata.tsx index cf4b5794c..348b2bb1b 100644 --- a/src/components/organisms/AssetActions/Edit/FormEditMetadata.tsx +++ b/src/components/organisms/AssetActions/Edit/FormEditMetadata.tsx @@ -47,15 +47,17 @@ export default function FormEditMetadata({ data, setShowEdit, setTimeoutStringValue, - values + values, + showPrice }: { data: FormFieldProps[] setShowEdit: (show: boolean) => void setTimeoutStringValue: (value: string) => void values: Partial + showPrice: boolean }): ReactElement { const { accountId } = useWeb3() - const { ocean } = useOcean() + const { ocean, config } = useOcean() const { isValid, validateField, @@ -79,16 +81,20 @@ export default function FormEditMetadata({ return (
- {data.map((field: FormFieldProps) => ( - ) => - handleFieldChange(e, field) - } - /> - ))} + {data.map( + (field: FormFieldProps) => + (!showPrice && field.name === 'price') || ( + ) => + handleFieldChange(e, field) + } + /> + ) + )}