MainNav.js 1.16 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';
Kim, Subin's avatar
Kim, Subin committed
3
4

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

    return (
Kim, Subin's avatar
Kim, Subin committed
11
12
        <Navbar sticky="top" style={{ background: "#CDC5C2" }}>
            <Navbar.Brand href="/home" className="text-light">
kusang96's avatar
dd    
kusang96 committed
13
                <img src="icon/footprint.svg" width="24" height="24" />
Kim, Subin's avatar
Kim, Subin committed
14
15
16
                {' '}KU#
            </Navbar.Brand>
            <Nav className="justify-content-end">
Kim, Subin's avatar
Kim, Subin committed
17
18
                <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
19
                <Nav.Link href="/shoppingcart">
kusang96's avatar
dd    
kusang96 committed
20
                    <img src="icon/cart.svg" width="30" height="30" />
Kim, Subin's avatar
Kim, Subin committed
21
                </Nav.Link>
Kim, Subin's avatar
Kim, Subin committed
22
23
                <Nav.Link className="text-light" onClick={() => handleClick()}>Logout</Nav.Link>
                <Nav.Link href="/admin">
kusang96's avatar
dd    
kusang96 committed
24
                    <img src="icon/option.svg" width="30" height="30" />
Kim, Subin's avatar
Kim, Subin committed
25
26
27
                </Nav.Link>
            </Nav>
        </Navbar>
Kim, Subin's avatar
Kim, Subin committed
28
29
30
31
    )
}

export default MainNav