App.js 1.63 KB
Newer Older
이재연's avatar
병합    
이재연 committed
1
import './App.css';
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
2
3
4
5
6
7
8
import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';
import Home from './Pages/Home';
import Login from './Pages/Login';
import Signup from './Pages/Signup';
import Product from "./Pages/Product";
import ProductsList from "./Pages/ProductsList";
import Admin from './Pages/Admin';
Jiwon Yoon's avatar
Jiwon Yoon committed
9
import ProductRegist from './Pages/ProductRegist';
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
10
11
import ShoppingCart from './Pages/ShoppingCart';
import Payment from './Pages/Payment';
12
import PaymentCompleted from './Pages/PaymentCompleted';
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
13
14
15
import Account from './Pages/Account';
import MainNav from './Components/MainNav';
import SubNav from './Components/SubNav';
이재연's avatar
이재연 committed
16

이재연's avatar
병합    
이재연 committed
17
function App() {
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
18
19

  return (
20
    <Router>
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
21
22
      <MainNav />
      <SubNav />
23
24
25
26
      <Switch>
        <Route exact path="/" component={Home} />
        <Route path="/login" component={Login} />
        <Route path="/signup" component={Signup} />
kusang96's avatar
0115    
kusang96 committed
27
        <Route path="/product/:productId" component={Product} />
박상호's avatar
박상호 committed
28
        <Route path="/categories/:main/:sub" component={ProductsList} />
29
30
31
32
33
        <Route path="/categories/:main" component={ProductsList} />
        <Route path="/admin" component={Admin} />
        <Route path="/regist" component={ProductRegist} />
        <Route path="/shoppingcart" component={ShoppingCart} />
        <Route path="/payment" component={Payment} />
34
        <Route path="/paymentcompleted" component={PaymentCompleted} />
35
36
37
38
39
        <Route path="/account" component={Account} />
        <Route path='/kakao' component={() => { window.location.href = 'https://compmath.korea.ac.kr'; return null; }} />
        <Redirect path="/" to="/" />
      </Switch>
    </Router>
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
40
  )
이재연's avatar
병합    
이재연 committed
41
42
}

43
export default App;