App.js 853 Bytes
Newer Older
Spark's avatar
layout    
Spark committed
1
import React from 'react';
Spark's avatar
Spark committed
2
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
Spark's avatar
layout    
Spark committed
3
4
import './App.css';
import Home from './pages/Home';
Spark's avatar
Spark committed
5
import SignupPage from './pages/SignupPage';
Spark's avatar
Spark committed
6
import LoginPage from './pages/LoginPage';
Spark's avatar
Spark committed
7
import EditPage from './pages/EditPage';
Spark's avatar
Spark committed
8
9
import PrivateRoute from './utils/PrivateRoutes';
import PageNotFound from './components/PageNotFound';
Spark's avatar
Spark committed
10
import Footer from './components/Footer';
Spark's avatar
layout    
Spark committed
11
12
13


function App() {
Spark's avatar
Spark committed
14

Spark's avatar
layout    
Spark committed
15
16
  return (
    <Router>
Spark's avatar
Spark committed
17
      <Switch>
Spark's avatar
Spark committed
18
        <Route exact path='/' component={Home} />
Spark's avatar
Spark committed
19
20
21
        <Route path='/signup' component={SignupPage} />
        <Route path='/login' component={LoginPage} />

Spark's avatar
Spark committed
22
23
        <PrivateRoute path='/edit'>
          <EditPage />
Spark's avatar
Spark committed
24
25
26
27
        </PrivateRoute>

        <Route component={PageNotFound} />
      </Switch>
Spark's avatar
Spark committed
28

Spark's avatar
Spark committed
29
      <Footer />
Spark's avatar
layout    
Spark committed
30
    </Router>
Spark's avatar
Spark committed
31

Spark's avatar
layout    
Spark committed
32
33
34
35
  );
}

export default App;