From 8a20552268ea184428a43ef95e265b28e7a72b12 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 12 Jan 2022 16:22:52 +0000 Subject: [PATCH] more styling, button disabling, hack in isContinueDisabled * closes #978 --- content/publish/feedback.json | 20 +++++++++++ src/components/Publish/Actions/index.tsx | 26 +++++++++++--- .../Publish/Submission/Feedback.module.css | 7 ++-- src/components/Publish/Submission/index.tsx | 2 -- src/components/Publish/_constants.tsx | 25 ++----------- src/components/Publish/_types.ts | 4 +-- src/components/Publish/index.tsx | 36 +++++++++---------- 7 files changed, 67 insertions(+), 53 deletions(-) create mode 100644 content/publish/feedback.json diff --git a/content/publish/feedback.json b/content/publish/feedback.json new file mode 100644 index 000000000..c0c5a7475 --- /dev/null +++ b/content/publish/feedback.json @@ -0,0 +1,20 @@ +{ + "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.", + "status": "pending", + "txCount": 1 + }, + "2": { + "name": "Construct & Encrypt DDO", + "description": "Entered metadata is transformed into a structured document (DDO) where the file URLs, and the whole DDO itself are encrypted.", + "status": "pending", + "txCount": 0 + }, + "3": { + "name": "Publish DDO", + "description": "The encrypted DDO is stored on-chain as part of the Data NFT. Indexers like Aquarius can decrypt the DDO for displaying purposes, but the file URLs can only be decrypted by exchanging the respective datatokens for this asset.", + "status": "pending", + "txCount": 1 + } +} diff --git a/src/components/Publish/Actions/index.tsx b/src/components/Publish/Actions/index.tsx index 4f2e6676d..4101ae375 100644 --- a/src/components/Publish/Actions/index.tsx +++ b/src/components/Publish/Actions/index.tsx @@ -10,8 +10,13 @@ export default function Actions({ }: { scrollToRef: RefObject }): ReactElement { - const { values, isValid, setFieldValue }: FormikContextType = - useFormikContext() + const { + values, + errors, + isValid, + isSubmitting, + setFieldValue + }: FormikContextType = useFormikContext() function handleNext(e: FormEvent) { e.preventDefault() @@ -25,21 +30,32 @@ export default function Actions({ scrollToRef.current.scrollIntoView() } + const isContinueDisabled = + (values.user.stepCurrent === 1 && errors.metadata !== undefined) || + (values.user.stepCurrent === 2 && errors.services !== undefined) || + (values.user.stepCurrent === 3 && errors.pricing !== undefined) + return (