blob: 34e980e92cefc8a71215f5d9a25a7a70c464162e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
import React, {Component} from 'react';
import Header from "./Header";
import './App.scss';
import MainPane from "./MainPane";
import Footer from "./Footer";
import {BrowserRouter as Router, Route, Switch} from "react-router-dom";
import Services from "./Services";
class App extends Component {
constructor(props) {
super(props);
this.state = {
servicesShow: false
};
}
render() {
let modal = "";
if (this.state.servicesShow) {
modal = <Services onHide={() => this.setState({servicesShow: false})}/>;
}
return (
<div className="app">
<Router>
<Header onOpenServices={() => this.setState({servicesShow: true})}/>
<Switch>
<Route path="/connections/:id/:format" children={<MainPane/>}/>
<Route path="/connections/:id" children={<MainPane/>}/>
<Route path="/" children={<MainPane/>}/>
</Switch>
{modal}
<Footer/>
</Router>
</div>
);
}
}
export default App;
|