mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
basic feedback message styling, fix publishing
This commit is contained in:
parent
2656bdb515
commit
1fee0cfc66
@ -3,7 +3,7 @@
|
|||||||
.spinner {
|
.spinner {
|
||||||
position: relative;
|
position: relative;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: $spacer * 2;
|
margin-bottom: $spacer;
|
||||||
margin-top: $spacer * 2;
|
margin-top: $spacer * 2;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
|
@ -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."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ interface StepProps {
|
|||||||
tryAgain: any
|
tryAgain: any
|
||||||
toStart: any
|
toStart: any
|
||||||
publishedDid?: string
|
publishedDid?: string
|
||||||
|
content?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Step extends PureComponent<StepProps, {}> {
|
export default class Step extends PureComponent<StepProps, {}> {
|
||||||
@ -60,7 +61,8 @@ export default class Step extends PureComponent<StepProps, {}> {
|
|||||||
state,
|
state,
|
||||||
totalSteps,
|
totalSteps,
|
||||||
tryAgain,
|
tryAgain,
|
||||||
toStart
|
toStart,
|
||||||
|
content
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
if (currentStep !== index + 1) {
|
if (currentStep !== index + 1) {
|
||||||
@ -123,6 +125,7 @@ export default class Step extends PureComponent<StepProps, {}> {
|
|||||||
tryAgain={tryAgain}
|
tryAgain={tryAgain}
|
||||||
toStart={toStart}
|
toStart={toStart}
|
||||||
state={state}
|
state={state}
|
||||||
|
content={content}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
5
src/routes/Publish/StepRegisterContent.module.scss
Normal file
5
src/routes/Publish/StepRegisterContent.module.scss
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
@import '../../styles/variables';
|
||||||
|
|
||||||
|
.message {
|
||||||
|
margin-bottom: $spacer;
|
||||||
|
}
|
@ -1,11 +1,13 @@
|
|||||||
import React, { PureComponent } from 'react'
|
import React, { PureComponent } from 'react'
|
||||||
import Web3message from '../../components/Web3message'
|
import Web3message from '../../components/Web3message'
|
||||||
import Spinner from '../../components/atoms/Spinner'
|
import Spinner from '../../components/atoms/Spinner'
|
||||||
|
import styles from './StepRegisterContent.module.scss'
|
||||||
|
|
||||||
interface StepRegisterContentProps {
|
interface StepRegisterContentProps {
|
||||||
tryAgain: any
|
tryAgain: any
|
||||||
toStart: any
|
toStart: any
|
||||||
state: any
|
state: any
|
||||||
|
content?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class StepRegisterContent extends PureComponent<
|
export default class StepRegisterContent extends PureComponent<
|
||||||
@ -17,19 +19,19 @@ export default class StepRegisterContent extends PureComponent<
|
|||||||
)
|
)
|
||||||
|
|
||||||
public errorState = () => (
|
public errorState = () => (
|
||||||
<div>
|
<div className={styles.message}>
|
||||||
Something went wrong,{' '}
|
Something went wrong,{' '}
|
||||||
<a onClick={() => this.props.tryAgain()}>try again</a>
|
<a onClick={() => this.props.tryAgain()}>try again</a>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
public publishedState = () => (
|
public publishedState = () => (
|
||||||
<p>
|
<div className={styles.message}>
|
||||||
Your asset is published! See it{' '}
|
Your asset is published! See it{' '}
|
||||||
<a href={'/asset/' + this.props.state.publishedDid}>here</a>, submit
|
<a href={'/asset/' + this.props.state.publishedDid}>here</a>, submit
|
||||||
another asset by clicking{' '}
|
another asset by clicking{' '}
|
||||||
<a onClick={() => this.props.toStart()}>here</a>
|
<a onClick={() => this.props.toStart()}>here</a>
|
||||||
</p>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
@ -44,7 +46,7 @@ export default class StepRegisterContent extends PureComponent<
|
|||||||
) : this.props.state.isPublished ? (
|
) : this.props.state.isPublished ? (
|
||||||
this.publishedState()
|
this.publishedState()
|
||||||
) : (
|
) : (
|
||||||
<div>Hello</div>
|
<p>{this.props.content}</p>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
@ -3,6 +3,7 @@ import { Logger } from '@oceanprotocol/squid'
|
|||||||
import Route from '../../components/templates/Route'
|
import Route from '../../components/templates/Route'
|
||||||
import Form from '../../components/atoms/Form/Form'
|
import Form from '../../components/atoms/Form/Form'
|
||||||
import AssetModel from '../../models/AssetModel'
|
import AssetModel from '../../models/AssetModel'
|
||||||
|
import { User } from '../../context/User'
|
||||||
import Step from './Step'
|
import Step from './Step'
|
||||||
import Progress from './Progress'
|
import Progress from './Progress'
|
||||||
|
|
||||||
@ -185,6 +186,7 @@ class Publish extends Component<{}, PublishState> {
|
|||||||
totalSteps={form.steps.length}
|
totalSteps={form.steps.length}
|
||||||
tryAgain={this.tryAgain}
|
tryAgain={this.tryAgain}
|
||||||
toStart={this.toStart}
|
toStart={this.toStart}
|
||||||
|
content={step.content}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Form>
|
</Form>
|
||||||
@ -193,4 +195,5 @@ class Publish extends Component<{}, PublishState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Publish.contextType = User
|
||||||
export default Publish
|
export default Publish
|
||||||
|
Loading…
Reference in New Issue
Block a user