import React, {Component} from 'react'; import Header from "./Header"; import MainPane from "./MainPane"; import Footer from "./Footer"; import {BrowserRouter as Router, Route, Switch} from "react-router-dom"; import Services from "./Services"; import Filters from "./Filters"; import Rules from "./Rules"; import Config from "./Config"; class App extends Component { constructor(props) { super(props); this.state = { servicesWindowOpen: false, filterWindowOpen: false, rulesWindowOpen: false, configWindowOpen: false }; } render() { let modal; if (this.state.servicesWindowOpen) { modal = this.setState({servicesWindowOpen: false})}/>; } if (this.state.filterWindowOpen) { modal = this.setState({filterWindowOpen: false})}/>; } if (this.state.rulesWindowOpen) { modal = this.setState({rulesWindowOpen: false})}/>; } if (this.state.configWindowOpen) { modal = this.setState({configWindowOpen: false})}/>; } return (
this.setState({servicesWindowOpen: true})} onOpenFilters={() => this.setState({filterWindowOpen: true})} onOpenRules={() => this.setState({rulesWindowOpen: true})} onOpenConfig={() => this.setState({configWindowOpen: true})} /> }/> }/> {modal}
); } } export default App;