// import axios from 'axios'; import { response } from 'express'; import React, { useState, useEffect } from 'react'; import { Navbar, Nav, Button } from 'react-bootstrap'; import { handleLogout, isAuthenticated } from '../utils/auth'; // const INIT_USER = { // username: '' // } function Menu() { const userName = "정연우"; const user = isAuthenticated() // const [userName, setUsername] = useState(INIT_USER) // async function getLoginedUser() { // const userId = localStorage.getItem('user') // const response = await axios.get(`/users/${userId}`) // setUsername(response.data) // } // useEffect((user) => { // if (localStorage.getItem('user')) { // getLoginedUser(user) // } // }, []) return ( YDK Messenger {user ? <>
{response.data} 님 환영합니다
: }
) } export default Menu