App.js 814 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 LocalCodePage from './pages/LocalCodePage';
Spark's avatar
Spark committed
8
9
import PrivateRoute from './utils/PrivateRoutes';
import PageNotFound from './components/PageNotFound';
Spark's avatar
layout    
Spark committed
10
11
12


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

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

        <PrivateRoute path='/local_code'>
          <LocalCodePage />
        </PrivateRoute>

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

Spark's avatar
layout    
Spark committed
29
30
31
32
  );
}

export default App;