App.js 867 Bytes
Newer Older
Yoon, Daeki's avatar
Yoon, Daeki committed
1
import React from 'react';
2
3
4
import Home from './Home'
import Quiz from './Quiz'
import End from './End'
JeongYeonwoo's avatar
quiz    
JeongYeonwoo committed
5
import Admin from './Admin'
Yoon, Daeki's avatar
Yoon, Daeki committed
6

JeongYeonwoo's avatar
quiz    
JeongYeonwoo committed
7
import { BrowserRouter as Router, Link, Switch, Route, Redirect } from 'react-router-dom';
JeongYeonwoo's avatar
JeongYeonwoo committed
8

9
function App() {
JeongYeonwoo's avatar
JeongYeonwoo committed
10
  return (
11
    <Router>
JeongYeonwoo's avatar
JeongYeonwoo committed
12
13
14
15
16
17
      <div className="container-fluid vh-100 bg-light">
        <header className="border-bottom">
          <Link to="/">
            <button className="ml-3 btn btn-light btn-lg font-weight-bold text-dark">Home</button>
          </Link>
        </header>
18
        <Switch>
JeongYeonwoo's avatar
quiz    
JeongYeonwoo committed
19
20
21
22
23
24
25
26
27
          <Route exact path="/" component={Home} />

          <Route path="/quiz" component={Quiz} />

          <Route path="/end" component={End} />

          <Route path="/admin" component={Admin} />

          <Redirect path="/admin" to="/admin" />
28
        </Switch>
JeongYeonwoo's avatar
JeongYeonwoo committed
29
      </div>
30
    </Router>
JeongYeonwoo's avatar
JeongYeonwoo committed
31
32
33
  )
}

Yoon, Daeki's avatar
Yoon, Daeki committed
34

35
export default App;