App.js 1.79 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
0111    
Jiwon Yoon committed
9
10
// import ProductRegist from './Pages/ProductRegist';
import ProductRegist2 from './Pages/ProductRegist2';
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
11
12
13
14
15
import ShoppingCart from './Pages/ShoppingCart';
import Payment from './Pages/Payment';
import Account from './Pages/Account';
import MainNav from './Components/MainNav';
import SubNav from './Components/SubNav';
이재연's avatar
이재연 committed
16

이재연's avatar
병합    
이재연 committed
17
18

function App() {
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  // const [user,setUser]=useState(null);
  // const authenticated =user !=null;
  // const login =({id, password}) => setUser(signIn({id,password}));
  // const logout=()=>setUser(null);


  return (
    <div>
      <MainNav />
      <SubNav />
      <Router>
        <Switch>
          <Route exact path="/" component={Home} />
          <Route path="/login" component={Login} />
          <Route path="/signup" component={Signup} />
          <Route path="/product" component={Product} />
          <Route path="/productslist" component={ProductsList} />
          <Route path="/admin" component={Admin} />
Jiwon Yoon's avatar
0111    
Jiwon Yoon committed
37
38
          {/* <Route path="/regist" component={ProductRegist} /> */}
          <Route path="/regist" component={ProductRegist2} />
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
39
40
41
42
43
44
45
46
47
48
          <Route path="/shoppingcart" component={ShoppingCart} />
          <Route path="/payment" component={Payment} />
          <Route path="/account" component={Account} />
          <Route path='/kakao' component={() => { window.location.href = 'https://compmath.korea.ac.kr'; return null; }} />
          <Redirect path="/" to="/" />
        </Switch>
      </Router>
    </div>

  )
이재연's avatar
이재연 committed
49
50


이재연's avatar
병합    
이재연 committed
51
52
53
}

export default App;