-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feature/#2
- Loading branch information
Showing
6 changed files
with
283 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
.EditMyPageTitle h1{ | ||
color: #456268; | ||
font-weight: bold; | ||
font-size: 38px; | ||
} | ||
.EditMyPage{ | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin-top: 100px; | ||
} | ||
|
||
.EditMyPageUser{ | ||
display: flex; | ||
flex-direction: row; | ||
margin-top: 45px; | ||
font-size: 18px; | ||
} | ||
.EditMyPageContent { | ||
display: flex; | ||
flex-direction: column; | ||
margin-left: 40px; | ||
} | ||
.EditMyPageCont{ | ||
margin-bottom: 43px; | ||
} | ||
.EditMyPageInputBtn input{ | ||
padding: 10px; | ||
border-radius: 4px; | ||
border: 1px solid #dee2e6; | ||
outline: none; | ||
font-size: 15px; | ||
width: 250px; | ||
} | ||
|
||
.EditMyPageContentTitle{ | ||
font-size: 20px; | ||
font-weight: bold; | ||
margin-right: 40px; | ||
|
||
} | ||
.EditMyPageContentTitle div{ | ||
margin-bottom: 40px; | ||
} | ||
|
||
.EditMyPageEditBtn{ | ||
color: #456268; | ||
background-color: transparent; | ||
width: 40px; | ||
height: 40px; | ||
font-size: 25px; | ||
border: none; | ||
outline: none; | ||
position: relative; | ||
margin-left: 20px; | ||
} | ||
|
||
.EditMyPageEditBtn :hover { | ||
opacity: 0.5; | ||
} | ||
.EditMyPageInputBtn{ | ||
display: flex; | ||
flex-direction: row; | ||
margin-bottom: 25px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
.MyPage{ | ||
} | ||
.MyPageContent{ | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin-top: 30px; | ||
} | ||
.MyPageTitle h1{ | ||
color: #456268; | ||
font-weight: bold; | ||
font-size: 38px; | ||
} | ||
.MyPageImage{ | ||
width: 170px; | ||
height: 170px; | ||
border-radius: 70%; | ||
background-color: white; | ||
overflow: hidden; | ||
margin-top: 45px; | ||
} | ||
.MyPageUser{ | ||
display: flex; | ||
flex-direction: row; | ||
margin-top: 25px; | ||
} | ||
.MyPageUserContent{ | ||
display: flex; | ||
flex-direction: column; | ||
font-size: 18px; | ||
|
||
} | ||
.MyPageUserContent div{ | ||
margin-bottom: 4px; | ||
} | ||
|
||
.MyPageUserContentTitle{ | ||
font-size: 20px; | ||
font-weight: bold; | ||
margin-right: 15px; | ||
} | ||
.MyPageBtns{ | ||
margin-top: 40px; | ||
} | ||
.MyPageBtn { | ||
color:#FCF8EC; | ||
background-color:#456268; | ||
border-color:#456268; | ||
padding: 1rem 1.75rem; | ||
font-size: 1.25rem; | ||
margin-right: 1rem; | ||
display: inline-block; | ||
font-weight: 400; | ||
line-height: 1.5; | ||
text-align: center; | ||
text-decoration: none; | ||
vertical-align: middle; | ||
cursor: pointer; | ||
background-color: #456268; | ||
border: 0.125rem solid transparent; | ||
padding: 0.375rem 0.75rem; | ||
font-size: 1rem; | ||
border-radius: 0.5rem; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import "../EditMyPage.css" | ||
import React , {useState, useEffect,useCallback} from 'react'; | ||
import axios from "axios"; | ||
import { RiEdit2Fill } from "react-icons/ri"; | ||
|
||
export default function EditMyPage({location}){ | ||
|
||
const id=location.state.id; | ||
const name=location.state.name; | ||
const pw=location.state.pw; | ||
const email=location.state.email; | ||
const major=location.state.major; | ||
|
||
const [newEmail, setNewEmail]=useState(email); | ||
const [newMajor, setNewMajor]=useState(major); | ||
|
||
const changeEmail=useCallback( | ||
(e) => { | ||
setNewEmail(e.target.value); | ||
}, | ||
[] | ||
); | ||
const changeMajor=useCallback( | ||
(e) => { | ||
setNewMajor(e.target.value); | ||
}, | ||
[] | ||
); | ||
|
||
const editEmail=(id, {data})=>{ | ||
console.log(data); | ||
axios.post('/mypage/changeEmail',{ | ||
id:id, | ||
newEmail:data, | ||
}) | ||
|
||
|
||
} | ||
const editMajor=(id, {data})=>{ | ||
|
||
axios.post('/mypage/changeMajor',{ | ||
id:id, | ||
newMajor:data, | ||
}) | ||
} | ||
|
||
return( | ||
<div className="EditMyPage"> | ||
<div className="EditMyPageTitle"> | ||
<h1>회원정보 수정</h1> | ||
</div> | ||
<div className="EditMyPageUser"> | ||
<div className="EditMyPageContentTitle"> | ||
<div>이름</div> | ||
<div>아이디</div> | ||
<div>비밀번호</div> | ||
<div>이메일</div> | ||
<div>전공</div> | ||
</div> | ||
<div className="EditMyPageContent"> | ||
<div className="EditMyPageCont">{name}</div> | ||
<div className="EditMyPageCont">{id}</div> | ||
<div className="EditMyPageInputBtn"> | ||
<input value={pw}></input> | ||
<button className="EditMyPageEditBtn"><RiEdit2Fill /></button> | ||
</div> | ||
<div className="EditMyPageInputBtn"> | ||
<input value={newEmail} onChange={changeEmail}></input> | ||
<button className="EditMyPageEditBtn" onClick={editEmail(id, newEmail)}><RiEdit2Fill /></button> | ||
</div> | ||
<div className="EditMyPageInputBtn"> | ||
<input value={newMajor} onChange={changeMajor}></input> | ||
<button className="EditMyPageEditBtn" onClick={editMajor(id, newMajor)}><RiEdit2Fill /></button> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import "../MyPage.css" | ||
import Navbr from "./Navbar"; | ||
import React , {useState, useEffect} from 'react'; | ||
import Axios from 'axios'; | ||
import {Link} from 'react-router-dom'; | ||
|
||
export default function MyPage(){ | ||
const [user,setUser]=useState([]); | ||
|
||
useEffect(() => { | ||
Axios.get("/mypage/info") | ||
.then(res => { | ||
console.log(res.data.data[0]); | ||
setUser(res.data.data[0]); | ||
}) | ||
}, []) | ||
|
||
return( | ||
<div className="MyPage"> | ||
<div className="MyPageNavbar"> | ||
<Navbr page="MyPage"></Navbr> | ||
</div> | ||
<div className="MyPageContent"> | ||
<div className="MyPageTitle"> | ||
<h1>My Page</h1> | ||
</div> | ||
<div className="MyPageImage"> | ||
<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgNTEzLjMyMyA1MTMuMzIzIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTMuMzI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CjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8L3N2Zz4NCg==" /> | ||
</div> | ||
<div className="MyPageUser"> | ||
<div className="MyPageUserContentTitle"> | ||
<div>이름</div> | ||
<div>아이디</div> | ||
<div>이메일</div> | ||
<div>전공</div> | ||
</div> | ||
|
||
<div className="MyPageUserContent"> | ||
<div>{user.name}</div> | ||
<div>{user.id}</div> | ||
<div>{user.email}</div> | ||
<div>{user.major}</div> | ||
</div> | ||
</div> | ||
|
||
<div className="MyPageBtns"> | ||
<Link to={{ | ||
pathname: "/editMyPage", | ||
state:{ | ||
name:user.name, | ||
id:user.id, | ||
pw:user.pw, | ||
email:user.email, | ||
major:user.major | ||
} | ||
}}> | ||
<button className="MyPageBtn MyPageEditBtn">회원정보 수정</button> | ||
|
||
</Link> | ||
|
||
<button className="MyPageBtn MyPageExamBtn">시험일정 관리</button> | ||
<button className="MyPageBtn MyPageTimeBtn">공부시간 관리</button> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |