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"; class App extends Component { constructor(props) { super(props); this.state = { servicesWindowOpen: false, filterWindowOpen: false, rulesWindowOpen: 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})}/>; } return (
this.setState({servicesWindowOpen: true})} onOpenFilters={() => this.setState({filterWindowOpen: true})} onOpenRules={() => this.setState({rulesWindowOpen: true})} /> }/> }/> {modal}
); } } export default App;