SHARE
TWEET

Untitled

a guest May 24th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, {Component} from 'react';
  2. import { BrowserRouter as Router, Route, Link} from "react-router-dom";
  3. import './App.css';
  4. import './Header.css'
  5. import SideDrawer from "./SideDrawer";
  6. import Header from './Header'
  7. import Backdrop from './Backdrop'
  8. import Home from "./Home";
  9. import LoginPage from "./LoginPage";
  10. import SignupPage from "./SignupPage";
  11. import RegisterEventPage from "./RegisterEventPage";
  12.  
  13.  
  14.  
  15. class App extends Component {
  16.     state = {
  17.         sideDrawerOpen: false
  18.     };
  19.  
  20.     drawerToggleClickHandler = () => {
  21.         this.setState((prevState) => {
  22.             return {sideDrawerOpen: !prevState.sideDrawerOpen};
  23.         });
  24.     };
  25.  
  26.  
  27.     backDropClickHandler = () => {
  28.         this.setState({sideDrawerOpen: false});
  29.     };
  30.  
  31.     render() {
  32.         let sideDrawer;
  33.         let backdrop;
  34.  
  35.         if (this.state.sideDrawerOpen) {
  36.             sideDrawer = <SideDrawer/>;
  37.             backdrop = <Backdrop click={this.backDropClickHandler}/>;
  38.         }
  39.  
  40.         return (
  41.             <div style={{height: '100%'}}>
  42.                 <Header drawerClickHandler={this.drawerToggleClickHandler}/>
  43.                 {sideDrawer}
  44.                 {backdrop}
  45.                 <Router>
  46.                     <Route exact path="/" component={Home}/>
  47.                     <Route path="/loginPage" component={LoginPage}/>
  48.                     <Route path="/SignupPage" component={SignupPage}/>
  49.                     <Route path="/RegisterEventPage" component={RegisterEventPage}/>
  50.                 </Router>
  51.             </div>
  52.  
  53.  
  54.         );
  55.     }
  56. }
  57.  
  58. export default App;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top