Menu.js 1.8 KB
Newer Older
Soo Hyun Kim's avatar
Soo Hyun Kim committed
1
2
import React from 'react'
import { Nav } from 'react-bootstrap';
3
import { handleLogout } from '../utils/auth';
Soo Hyun Kim's avatar
Soo Hyun Kim committed
4
import { BsPeopleCircle } from "react-icons/bs";
Soo Hyun Kim's avatar
Soo Hyun Kim committed
5
import { AiOutlineLogout } from "react-icons/ai";
Soo Hyun Kim's avatar
Soo Hyun Kim committed
6
import "../menu.css";
7

Soo Hyun Kim's avatar
Soo Hyun Kim committed
8
function Menu(props) {
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

  return (
Soo Hyun Kim's avatar
Soo Hyun Kim committed
13
    <div className="container-fluid" style={{ display: "flex", flexDirection: "row", backgroundColor: "#61477a", heigth: "100%", position: "relative" }}>
Soo Hyun Kim's avatar
Soo Hyun Kim committed
14
      <a href="/" className="navbar-brand" href="/home" style={{ color: 'white', alignItems: "center" }}>{'YDK Messenger'}</a>
Soo Hyun Kim's avatar
Soo Hyun Kim committed
15
16
      {name ?
        <>
Soo Hyun Kim's avatar
Soo Hyun Kim committed
17
18
          <div className="nav navbar-nav mr-auto" style={{ color: 'white', display: "flex", flexDirection: "row", alignItems: "center" }}>
            <p className="mt-2 mr-4">{`${name}님 환영합니다`}</p>
Soo Hyun Kim's avatar
Soo Hyun Kim committed
19
            <div className="showText">
Soo Hyun Kim's avatar
Soo Hyun Kim committed
20
21
              <a href="/profile" style={{ color: "#FFFFFF", marginRight: "15px" }}>{'Profile'}</a>
              <a onClick={() => handleLogout()} href="/login" style={{ color: "#FFFFFF" }}>{'logout'}</a>
Soo Hyun Kim's avatar
Soo Hyun Kim committed
22
23
            </div>
            <div className="showIcon">
Soo Hyun Kim's avatar
Soo Hyun Kim committed
24
              <a href="/profile" style={{ marginRight: "15px" }}><BsPeopleCircle size="25" color="#FFFFFF" /></a>
Soo Hyun Kim's avatar
Soo Hyun Kim committed
25
26
27
28
29
              <a href="/login" onClick={() => handleLogout()}><AiOutlineLogout size="25" color="#FFFFFF" /></a>
            </div>
          </div>
        </>
        : <>
Soo Hyun Kim's avatar
Soo Hyun Kim committed
30
31
32
33
34
35
          <div className="nav navbar-nav" style={{ display: "flex", flexDirection: "row", alignItems: "center" }}>
            <div className="showTextBFLogin">
              <a href="/login" style={{ color:"#FFFFFF", marginRight: "15px" }}>{'Login'}</a>
              <a href="/signup" style={{ color:"#FFFFFF" }}>{'Signup'}</a>
            </div>
          </div>
Soo Hyun Kim's avatar
Soo Hyun Kim committed
36
37
        </>}
    </div>
Choi Ga Young's avatar
Choi Ga Young committed
38
39
40
41
  )
}

export default Menu