added steps to create app

4.x.x
Jayasanka 6 years ago
parent e3fcf68c3e
commit b591bede46

@ -6,4 +6,18 @@
padding: 0;
height: auto;
box-shadow: 0 2px 8px #f0f1f2;
}
.steps-content {
margin-top: 16px;
border: 1px dashed #e9e9e9;
border-radius: 6px;
background-color: #fafafa;
min-height: 200px;
text-align: center;
padding-top: 80px;
}
.steps-action {
margin-top: 24px;
}

@ -1,6 +1,6 @@
import React from "react";
import "antd/dist/antd.css";
import {PageHeader, Breadcrumb, Typography} from "antd";
import {PageHeader, Typography, Card, Steps, Button, message} from "antd";
const Paragraph = Typography;
@ -19,22 +19,47 @@ const routes = [
},
];
const Step = Steps.Step;
const steps = [{
title: 'First',
content: 'First-content',
}, {
title: 'Second',
content: 'Second-content',
}, {
title: 'Last',
content: 'Last-content',
}];
class AddNewApp extends React.Component {
routes;
constructor(props) {
super(props);
this.routes = props.routes;
this.state = {
current: 0,
};
}
next() {
const current = this.state.current + 1;
this.setState({current});
}
prev() {
const current = this.state.current - 1;
this.setState({current});
}
render() {
const { current } = this.state;
return (
<div>
<PageHeader
title="Add New App"
breadcrumb={{ routes }}
breadcrumb={{routes}}
>
<div className="wrap">
<div className="content">
@ -44,8 +69,34 @@ class AddNewApp extends React.Component {
</div>
</div>
</PageHeader>
<div style={{ background: '#f0f2f5', padding: 24, minHeight: 280 }}>
<div style={{background: '#f0f2f5', padding: 24, minHeight: 720}}>
<Card>
<div>
<Steps current={current}>
{steps.map(item => <Step key={item.title} title={item.title}/>)}
</Steps>
<div className="steps-content">{steps[current].content}</div>
<div className="steps-action">
{
current < steps.length - 1
&& <Button type="primary" onClick={() => this.next()}>Next</Button>
}
{
current === steps.length - 1
&& <Button type="primary"
onClick={() => message.success('Processing complete!')}>Done</Button>
}
{
current > 0
&& (
<Button style={{marginLeft: 8}} onClick={() => this.prev()}>
Previous
</Button>
)
}
</div>
</div>
</Card>
</div>
</div>

Loading…
Cancel
Save