Advertisement
EntropyStarRover

App.js

Nov 17th, 2021
557
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. import './App.css';
  3. import { Switch,Route, Redirect } from 'react-router-dom';
  4. import Navigation from './components/Navigation/Navigation';
  5. import BeerDetails from './components/BeerDetails/BeerDetails';
  6. import CreateRecord from './components/CreateRecord/CreateRecord';
  7. import Login from './components/Login/Login';
  8. import Register from './components/Register/Register';
  9. import Home from './components/Home/Home';
  10. import Profile from './components/Profile/Profile';
  11.  
  12. function App() {
  13.   return (
  14.     <div className="App">
  15.    
  16.       <header className="mainHeader">
  17.         <img src="Beer-icon.png"  className="headerImg" alt="beer"></img>
  18.         <h1>Бирометър</h1>
  19.    
  20.       </header>
  21.         <Navigation/>
  22.         <main>
  23.         <Switch>
  24.                     <Route path="/" exact component={Home} />
  25.                     <Route path="/create-record" component={CreateRecord} />
  26.                     <Route path="/login" component={Login} />
  27.                     <Route path="/register" component={Register} />
  28.                     <Route path="/beers/:beerId" component={BeerDetails} />
  29.                     <Route path="/profile" exact component={Profile} />
  30.                     <Route path="/logout" render={(props) => {
  31.                         console.log('Logged Out!!!');
  32.  
  33.                         return <Redirect to="/" />
  34.                     }} />
  35.                 </Switch>
  36.         </main>
  37.        
  38.      
  39.     </div>
  40.   );
  41. }
  42.  
  43. export default App;
  44.  
Advertisement
RAW Paste Data Copied
Advertisement