import React, { useState, useEffect } from 'react'; import ReactDOM from 'react-dom'; import Menu from '../Components/Menu'; import { Image, Button, Container, Form, FormControl, Navbar, Nav, Row, Col, Dropdown, Carousel } from 'react-bootstrap'; import { BrowserRouter as Router, Route, Redirect, Switch, Link } from 'react-router-dom'; import axios from 'axios' import userdefault from './KakaoTalk_20201230_153151693.png' import img1 from './img_1.png' import img2 from './img_2.png' import img3 from './img_3.jpg' import DropdownItem from 'react-bootstrap/esm/DropdownItem'; const INIT_USER = { username: '', email: '', nickname: '' } function ProfilePage() { const [user, setUser] = useState(INIT_USER) const [userimg, setUserimg] = useState(img2) const [defaultImg, setDefaultImg] = useState(true) const [hidden, setHidden] = useState(true) async function getLoginedUser() { //email로 db에서 찾아오기 ㅇㅇㅇㅇㅇ const userid = localStorage.getItem('user') const response = await axios.post(`/users/${userid}`, { 'email': userid }) setUser(response.data) } function handleSubmit(e) { e.preventDefault() if (hidden) { setHidden(false) } else { setHidden(true) } console.log(document.cookie) } function handleChange(e) { setUser({ ...user, 'nickname': e.target.value }) } async function handleNicksave() { const userid = localStorage.getItem('user') await axios.put(`/users/${userid}`, user) } function setThumbnail(event) { //불러온 사진
펭수입니다.
라이언입니다.
어피치 입니다.