aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/views/App.js
blob: e3119aa8cfbb0520bc4ee6a8e935341d0f9daeaf (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
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" children={<MainPane/>}/>
                        <Route path="/" children={<MainPane/>}/>
                    </Switch>
                    {modal}
                    <Footer/>
                </Router>

            </div>
        );
    }
}

export default App;