App.js 869 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>
Jiwon Yoon's avatar
ha..    
Jiwon Yoon committed
12
13
14
      <div className="container-fluid vh-100 bg-light">
        <header className="border-bottom">
          <Link to="/">
Jiwon Yoon's avatar
ㅠㅠ    
Jiwon Yoon committed
15
            <button className="ml-3 btn btn-light btn-lg font-weight-bold text-info">Home</button>
Jiwon Yoon's avatar
ha..    
Jiwon Yoon committed
16
17
          </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
        </Switch>
      </div>
Jiwon Yoon's avatar
ha..    
Jiwon Yoon committed
30
31


Jiwon Yoon's avatar
Jiwon Yoon committed
32
33
    </Router>
  )
Yoon, Daeki's avatar
Yoon, Daeki committed
34
35
}

Jiwon Yoon's avatar
quiz    
Jiwon Yoon committed
36

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