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

7

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

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

  return (
    <Navbar bg="dark" variant="dark">
      <Navbar.Brand href="/home">YDK Messenger</Navbar.Brand>
15
      <div className='ml-1 mr-2' style={{ color: 'white' }}>{name}  환영합니다</div>
Choi Ga Young's avatar
Choi Ga Young committed
16
17
18
19
20
      <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
21
22
23
      <Link to="./login">
        <Button onClick={() => handleLogout()} variant="light" className="ml-3">Logout</Button>
      </Link>
Choi Ga Young's avatar
Choi Ga Young committed
24
25
26
27
28
    </Navbar>
  )
}

export default Menu