1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

progress component setup

This commit is contained in:
Matthias Kretschmann 2019-02-19 17:39:53 +01:00
parent 720705cb6c
commit 2597e8a63c
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,26 @@
import React from 'react'
const Progress = ({
currentStep,
totalSteps,
steps
}: {
currentStep: number
totalSteps: number
steps: any[]
}) => {
return (
<aside>
<ul>
{steps.map(({ title }, index) => (
<li key={index}>
{index + 1}
{title}
</li>
))}
</ul>
</aside>
)
}
export default Progress

View File

@ -5,6 +5,7 @@ import Form from '../../components/atoms/Form/Form'
import AssetModel from '../../models/AssetModel'
import Web3message from '../../components/Web3message'
import Step from './Step'
import Progress from './Progress'
import form from '../../data/form-publish.json'
@ -169,7 +170,11 @@ class Publish extends Component<{}, PublishState> {
this.publishedState()
) : (
<>
<p>Step {this.state.currentStep} </p>
<Progress
steps={form.steps}
currentStep={this.state.currentStep}
totalSteps={form.steps.length}
/>
<Form onSubmit={this.registerAsset}>
{form.steps.map((step: any, index: number) => (