MainNav.js 1.23 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
16
        <Navbar sticky="top" style={{ background: "#CDC5C2" }}>
            <Navbar.Brand href="/home" className="text-light">
                <img src={logo} width="24" height="24" />
Kim, Subin's avatar
Kim, Subin committed
17
18
19
                {' '}KU#
            </Navbar.Brand>
            <Nav className="justify-content-end">
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
23
24
                <Nav.Link href="/shoppingcart">
                    <img src={cart} width="30" height="30" />
                </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">
Kim, Subin's avatar
Kim, Subin committed
27
28
29
30
                    <img src={option} width="30" height="30" />
                </Nav.Link>
            </Nav>
        </Navbar>
Kim, Subin's avatar
Kim, Subin committed
31
32
33
34
    )
}

export default MainNav