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

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

function App() {
  return (
Jiwon Yoon's avatar
Jiwon Yoon committed
12
13
14
15
16
17
    <Router>
      <header>
        <Link to="/">
          <button>Calculus</button>
        </Link>
      </header>
baesangjune's avatar
baesangjune committed
18
      <hr />
Jiwon Yoon's avatar
Jiwon Yoon committed
19
20
      <div>
        <Switch>
baesangjune's avatar
baesangjune 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" />
Jiwon Yoon's avatar
Jiwon Yoon committed
30
31
32
33
        </Switch>
      </div>
    </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;