diff --git a/content/publish/feedback.json b/content/publish/feedback.json index c0c5a7475..94353f17c 100644 --- a/content/publish/feedback.json +++ b/content/publish/feedback.json @@ -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 }, diff --git a/src/components/Publish/Steps.tsx b/src/components/Publish/Steps.tsx index 6829df03b..b325b430f 100644 --- a/src/components/Publish/Steps.tsx +++ b/src/components/Publish/Steps.tsx @@ -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] diff --git a/src/components/Publish/index.tsx b/src/components/Publish/index.tsx index 2ce808e30..79e8a13cf 100644 --- a/src/components/Publish/index.tsx +++ b/src/components/Publish/index.tsx @@ -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' } }))