2019-08-02 00:10:59 +02:00
|
|
|
import React from 'react';
|
2019-08-06 10:09:10 +02:00
|
|
|
import IndexPage from './IndexPage.js';
|
|
|
|
|
|
|
|
|
|
|
|
const targetUrl = "http://localhost:3003"
|
|
|
|
|
|
|
|
class App extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props)
|
|
|
|
|
|
|
|
this.state = {targetUrl: targetUrl, loggedIn: false}
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
fetch(this.targetUrl, {credentials: 'include'})
|
|
|
|
.then(response => response.json())
|
|
|
|
.then(data => this.setState({loggedIn: data.logged_in}));
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div id="main" className="container">
|
|
|
|
<IndexPage targetUrl={this.state.targetUrl} loggedIn={this.state.loggedIn} />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-08-02 00:10:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|