Menu.js 810 Bytes
Newer Older
Choi Ga Young's avatar
Choi Ga Young committed
1
2
import React from 'react'
import { Navbar, Nav, Button } from 'react-bootstrap';
우지원's avatar
우지원 committed
3
import { Link } from 'react-router-dom';
4
import { handleLogout } from '../utils/auth';
Choi Ga Young's avatar
Choi Ga Young committed
5

6

Choi Ga Young's avatar
Choi Ga Young committed
7
function Menu() {
8
9

  const name = localStorage.getItem('name');
Choi Ga Young's avatar
Choi Ga Young committed
10
11
12
13

  return (
    <Navbar bg="dark" variant="dark">
      <Navbar.Brand href="/home">YDK Messenger</Navbar.Brand>
14
      <div className='ml-1 mr-2' style={{ color: 'white' }}>{name}  환영합니다</div>
Choi Ga Young's avatar
Choi Ga Young committed
15
16
17
18
19
      <Nav className="mr-auto">
        <Nav.Link href="/home">Home</Nav.Link>
        <Nav.Link href="/profile">Profile</Nav.Link>
        <Nav.Link href="/hello">Hello</Nav.Link>
      </Nav>
우지원's avatar
우지원 committed
20
21
22
      <Link to="./login">
        <Button onClick={() => handleLogout()} variant="light" className="ml-3">Logout</Button>
      </Link>
Choi Ga Young's avatar
Choi Ga Young committed
23
24
25
26
27
    </Navbar>
  )
}

export default Menu