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

baesangjune's avatar
baesangjune committed
7
import { BrowserRouter as Router, Link, Switch, Route, Redirect } from 'react-router-dom';
Yoon, Daeki's avatar
Yoon, Daeki committed
8
9
10

function App() {
  return (
Jiwon Yoon's avatar
Jiwon Yoon committed
11
    <Router>
baesangjune's avatar
.    
baesangjune 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>
Jiwon Yoon's avatar
Jiwon Yoon committed
18
        <Switch>
baesangjune's avatar
baesangjune 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" />
Jiwon Yoon's avatar
Jiwon Yoon committed
28
29
30
31
        </Switch>
      </div>
    </Router>
  )
Yoon, Daeki's avatar
Yoon, Daeki committed
32
33
}

Jiwon Yoon's avatar
quiz    
Jiwon Yoon committed
34

Jiwon Yoon's avatar
Jiwon Yoon committed
35
export default App;