1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

publish feedback tweaks, make content switching based on price type work

This commit is contained in:
Matthias Kretschmann 2022-01-12 19:24:49 +00:00
parent 25920b7763
commit 181dce9ba5
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 23 additions and 6 deletions

View File

@ -1,7 +1,7 @@
{
"1": {
"name": "Create Tokens & Pricing",
"description": "The Data NFT representing your asset, the Datatokens defining access to it, and the pricing schema are all created in one transaction.",
"description": "The Data NFT representing your asset, the Datatokens defining access to it, and the pricing schema are all created in a single transaction.",
"status": "pending",
"txCount": 1
},

View File

@ -25,6 +25,24 @@ export function Steps({
setFieldValue('feedback', feedback)
}, [feedback, setFieldValue])
// auto-switch some feedback content based on pricing type
useEffect(() => {
setFieldValue('feedback', {
...feedback,
'1': {
...feedback['1'],
txCount: values.pricing.type === 'dynamic' ? 2 : 1,
description:
values.pricing.type === 'dynamic'
? feedback['1'].description.replace(
'a single transaction',
'a single transaction, after an initial approve transaction'
)
: feedback['1'].description
}
})
}, [values.pricing.type, setFieldValue])
const { component } = wizardSteps.filter(
(stepContent) => stepContent.step === values.user.stepCurrent
)[0]

View File

@ -1,4 +1,4 @@
import React, { ReactElement, useState, useRef } from 'react'
import React, { ReactElement, useState, useRef, useEffect } from 'react'
import { Form, Formik } from 'formik'
import { initialPublishFeedback, initialValues } from './_constants'
import { useAccountPurgatory } from '@hooks/useAccountPurgatory'
@ -65,8 +65,7 @@ export default function PublishPage({
...prevState,
'1': {
...prevState['1'],
status: 'active',
txCount: values.pricing.type === 'dynamic' ? 2 : 1
status: 'active'
}
}))
@ -119,7 +118,7 @@ export default function PublishPage({
...prevState,
'2': {
...prevState['2'],
status: _datatokenAddress && _erc721Address ? 'active' : 'error'
status: 'active'
}
}))
@ -178,7 +177,7 @@ export default function PublishPage({
...prevState,
'3': {
...prevState['3'],
status: _ddo && _encryptedDdo ? 'active' : 'error'
status: 'active'
}
}))