seperate upload and report screens

This commit is contained in:
Bilal Catic
2019-05-28 13:04:33 +02:00
parent 90b6d7b7e5
commit 19c08195b4
11 changed files with 96 additions and 132 deletions

View File

@@ -1,37 +1,34 @@
import React, { Component } from 'react';
import { Container } from 'semantic-ui-react';
import { Container, Form } from "semantic-ui-react";
import MainMenu from '../../components/MainMenu';
class Home extends Component {
state = {
apiStatus: 'loading',
};
componentDidMount() {
fetch('/api')
.then(response => response.json())
.then(result => {
if (result.status === 1) {
this.setState({apiStatus: 'working'});
} else {
this.setState({apiStatus: 'NOT WORKING !'});
}
})
.catch(err => {
this.setState({apiStatus: `ERROR : ${err}`});
})
}
render () {
const {apiStatus} = this.state;
return (
<Container>
<MainMenu/>
<h3>CRM Integration</h3>
<h3>Report</h3>
<hr/>
<h5>Integration API Status : {apiStatus}</h5>
<Form>
<Form.Group widths="equal">
<Form.Input
fluid
required
label="Start date"
type="date"
/>
<Form.Input
fluid
required
label="End date"
type="date"
/>
</Form.Group>
<Form.Button>Generate Report</Form.Button>
</Form>
</Container>
);
}