MainNav.js 1.27 KB
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
import React, { useState, useEffect, useRef } from 'react';
Kim, Subin's avatar
Kim, Subin committed
2
import { Navbar, Nav } from 'react-bootstrap';
3
import logo from '../footprint.svg';
Kim, Subin's avatar
Kim, Subin committed
4
5
import cart from '../cart.svg';
import option from '../option.svg';
Kim, Subin's avatar
Kim, Subin committed
6
7

function MainNav() {
Kim, Subin's avatar
Kim, Subin committed
8
9
    function handleClick() {
        alert('로그아웃이 완료되었습니다.')
이재연's avatar
이재연 committed
10
        window.location.href="/home"
Kim, Subin's avatar
Kim, Subin committed
11
    }
Kim, Subin's avatar
Kim, Subin committed
12
13

    return (
Kim, Subin's avatar
Kim, Subin committed
14
15
        <Navbar sticky="top" style={{ background: "#CDC5C2" }}>
            <Navbar.Brand href="/home" className="text-light">
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
16
                <img alt="로고" src={logo} width="24" height="24" />
Kim, Subin's avatar
Kim, Subin committed
17
18
                {' '}KU#
            </Navbar.Brand>
19
            <Nav className="float-right">
Kim, Subin's avatar
Kim, Subin committed
20
21
                <Nav.Link className="text-light" href="/login">Login</Nav.Link>
                <Nav.Link className="text-light" href="/signup">Signup</Nav.Link>
Kim, Subin's avatar
Kim, Subin committed
22
                <Nav.Link href="/shoppingcart">
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
23
                    <img alt="카트" src={cart} width="30" height="30" />
Kim, Subin's avatar
Kim, Subin committed
24
                </Nav.Link>
Kim, Subin's avatar
Kim, Subin committed
25
26
                <Nav.Link className="text-light" onClick={() => handleClick()}>Logout</Nav.Link>
                <Nav.Link href="/admin">
Jiwon Yoon's avatar
22    
Jiwon Yoon committed
27
                    <img alt="관리자" src={option} width="30" height="30" />
Kim, Subin's avatar
Kim, Subin committed
28
29
30
                </Nav.Link>
            </Nav>
        </Navbar>
Kim, Subin's avatar
Kim, Subin committed
31
32
33
34
    )
}

export default MainNav