mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
added interface to FormEditMetadata
This commit is contained in:
parent
3ec3d8545b
commit
321ab28c19
@ -15,6 +15,16 @@ export function checkIfTimeoutInPredefinedValues(
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface FormEditMetadataValues {
|
||||||
|
author: string
|
||||||
|
description: string
|
||||||
|
files: string
|
||||||
|
links: string
|
||||||
|
name: string
|
||||||
|
price: string
|
||||||
|
timeout: string
|
||||||
|
}
|
||||||
|
|
||||||
export default function FormEditMetadata({
|
export default function FormEditMetadata({
|
||||||
data,
|
data,
|
||||||
showPrice,
|
showPrice,
|
||||||
@ -25,8 +35,8 @@ export default function FormEditMetadata({
|
|||||||
data: InputProps[]
|
data: InputProps[]
|
||||||
showPrice: boolean
|
showPrice: boolean
|
||||||
isComputeDataset: boolean
|
isComputeDataset: boolean
|
||||||
initialValues: any
|
initialValues: FormEditMetadataValues
|
||||||
currentValues: any
|
currentValues: FormEditMetadataValues
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const { oceanConfig } = useAsset()
|
const { oceanConfig } = useAsset()
|
||||||
|
|
||||||
@ -34,7 +44,7 @@ export default function FormEditMetadata({
|
|||||||
// we'll add an outline when an input has changed
|
// we'll add an outline when an input has changed
|
||||||
const getDifference = (a: any, b: any) =>
|
const getDifference = (a: any, b: any) =>
|
||||||
Object.entries(a).reduce(
|
Object.entries(a).reduce(
|
||||||
(ac, [k, v]) => (b[k] && b[k] !== v ? ((ac[k] = b[k]), ac) : ac),
|
(ac: any, [k, v]) => (b[k] && b[k] !== v ? ((ac[k] = b[k]), ac) : ac),
|
||||||
{}
|
{}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user