From 1fee0cfc66f83a0ac5033e2f7c2672eeba7f1084 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 20 Feb 2019 14:35:41 +0100 Subject: [PATCH] basic feedback message styling, fix publishing --- src/components/atoms/Spinner.module.scss | 2 +- src/data/form-publish.json | 4 +++- src/routes/Publish/Step.tsx | 5 ++++- src/routes/Publish/StepRegisterContent.module.scss | 5 +++++ src/routes/Publish/StepRegisterContent.tsx | 10 ++++++---- src/routes/Publish/index.tsx | 3 +++ 6 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 src/routes/Publish/StepRegisterContent.module.scss diff --git a/src/components/atoms/Spinner.module.scss b/src/components/atoms/Spinner.module.scss index f89de59..c5705f6 100644 --- a/src/components/atoms/Spinner.module.scss +++ b/src/components/atoms/Spinner.module.scss @@ -3,7 +3,7 @@ .spinner { position: relative; text-align: center; - margin-bottom: $spacer * 2; + margin-bottom: $spacer; margin-top: $spacer * 2; &:before { diff --git a/src/data/form-publish.json b/src/data/form-publish.json index 6b9aba8..a8bc3e4 100644 --- a/src/data/form-publish.json +++ b/src/data/form-publish.json @@ -105,7 +105,9 @@ } }, { - "title": "Register" + "title": "Register", + "description": "We got all the data, now let's register your data set.", + "content": "After clicking the button below you will be asked by your wallet to sign this request." } ] } diff --git a/src/routes/Publish/Step.tsx b/src/routes/Publish/Step.tsx index 899b767..90fc1fa 100644 --- a/src/routes/Publish/Step.tsx +++ b/src/routes/Publish/Step.tsx @@ -23,6 +23,7 @@ interface StepProps { tryAgain: any toStart: any publishedDid?: string + content?: string } export default class Step extends PureComponent { @@ -60,7 +61,8 @@ export default class Step extends PureComponent { state, totalSteps, tryAgain, - toStart + toStart, + content } = this.props if (currentStep !== index + 1) { @@ -123,6 +125,7 @@ export default class Step extends PureComponent { tryAgain={tryAgain} toStart={toStart} state={state} + content={content} /> )} diff --git a/src/routes/Publish/StepRegisterContent.module.scss b/src/routes/Publish/StepRegisterContent.module.scss new file mode 100644 index 0000000..60a5936 --- /dev/null +++ b/src/routes/Publish/StepRegisterContent.module.scss @@ -0,0 +1,5 @@ +@import '../../styles/variables'; + +.message { + margin-bottom: $spacer; +} diff --git a/src/routes/Publish/StepRegisterContent.tsx b/src/routes/Publish/StepRegisterContent.tsx index c3e4f2b..ea1a718 100644 --- a/src/routes/Publish/StepRegisterContent.tsx +++ b/src/routes/Publish/StepRegisterContent.tsx @@ -1,11 +1,13 @@ import React, { PureComponent } from 'react' import Web3message from '../../components/Web3message' import Spinner from '../../components/atoms/Spinner' +import styles from './StepRegisterContent.module.scss' interface StepRegisterContentProps { tryAgain: any toStart: any state: any + content?: string } export default class StepRegisterContent extends PureComponent< @@ -17,19 +19,19 @@ export default class StepRegisterContent extends PureComponent< ) public errorState = () => ( -
+
Something went wrong,{' '} this.props.tryAgain()}>try again
) public publishedState = () => ( -

+

Your asset is published! See it{' '} here, submit another asset by clicking{' '} this.props.toStart()}>here -

+
) public render() { @@ -44,7 +46,7 @@ export default class StepRegisterContent extends PureComponent< ) : this.props.state.isPublished ? ( this.publishedState() ) : ( -
Hello
+

{this.props.content}

)} ) diff --git a/src/routes/Publish/index.tsx b/src/routes/Publish/index.tsx index bd8e30d..efcf0fa 100644 --- a/src/routes/Publish/index.tsx +++ b/src/routes/Publish/index.tsx @@ -3,6 +3,7 @@ import { Logger } from '@oceanprotocol/squid' import Route from '../../components/templates/Route' import Form from '../../components/atoms/Form/Form' import AssetModel from '../../models/AssetModel' +import { User } from '../../context/User' import Step from './Step' import Progress from './Progress' @@ -185,6 +186,7 @@ class Publish extends Component<{}, PublishState> { totalSteps={form.steps.length} tryAgain={this.tryAgain} toStart={this.toStart} + content={step.content} /> ))} @@ -193,4 +195,5 @@ class Publish extends Component<{}, PublishState> { } } +Publish.contextType = User export default Publish