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

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

10
function App() {
JeongYeonwoo's avatar
JeongYeonwoo committed
11
  return (
12
13
14
    <Router>
      <header>
        <Link to="/">
JeongYeonwoo's avatar
quiz    
JeongYeonwoo committed
15
          <button>Calculus</button>
16
17
        </Link>
      </header>
JeongYeonwoo's avatar
JeongYeonwoo committed
18
      <hr />
19
20
      <div>
        <Switch>
JeongYeonwoo's avatar
quiz    
JeongYeonwoo committed
21
22
23
24
25
26
27
28
29
          <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" />
30
        </Switch>
JeongYeonwoo's avatar
JeongYeonwoo committed
31
      </div>
32
    </Router>
JeongYeonwoo's avatar
JeongYeonwoo committed
33
34
35
  )
}

Yoon, Daeki's avatar
Yoon, Daeki committed
36

37
export default App;