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:
parent
25920b7763
commit
181dce9ba5
@ -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
|
||||
},
|
||||
|
@ -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]
|
||||
|
@ -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'
|
||||
}
|
||||
}))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user