Initial setup

This commit is contained in:
Senad Uka
2019-05-24 14:04:32 +02:00
parent 30f0874490
commit 84443783da
26 changed files with 13324 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
import React, { Component } from 'react';
class Home extends Component {
state = {
apiStatus: 'loading',
};
componentDidMount() {
fetch('/api')
.then(response => response.json())
.then(result => {
console.log(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 (
<div>
<h3>CRM Integration</h3>
<hr/>
<h5>Integration API Status : {apiStatus}</h5>
</div>
);
}
}
export default Home;

View File

@@ -0,0 +1,9 @@
import React from 'react';
export default function NotFound () {
return (
<div>
<h1>Page not found</h1>
</div>
);
}