From 1d6e4dab1fef612b1faa378c56df6fb0f80e0025 Mon Sep 17 00:00:00 2001 From: hummingbbird Date: Fri, 29 Mar 2024 02:56:45 +0900 Subject: [PATCH] Feat: create editProfilPage and connect button to page #11 --- src/pages/EditProfilPage.js | 19 +++++++++++++++++++ src/pages/MypagePage.js | 20 +++++++++++++------- src/routes/router.js | 2 ++ 3 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 src/pages/EditProfilPage.js diff --git a/src/pages/EditProfilPage.js b/src/pages/EditProfilPage.js new file mode 100644 index 0000000..e2c777b --- /dev/null +++ b/src/pages/EditProfilPage.js @@ -0,0 +1,19 @@ +import React from "react"; +import styled from "styled-components"; +import { Typography } from "@mui/material"; +import Avatar from "@mui/material/Avatar"; +import Default from "../assets/images/defaultavatar.svg"; +import { COLOR } from "../styles/color"; + +const EditProfilPage = () => { + return +

잘오셧습니다.

+
; +}; + +const StEditProfilPage = styled.div` + width: 100%; + height: 100%; +`; + +export default EditProfilPage; diff --git a/src/pages/MypagePage.js b/src/pages/MypagePage.js index 2b74db6..8dc6b3d 100644 --- a/src/pages/MypagePage.js +++ b/src/pages/MypagePage.js @@ -4,6 +4,7 @@ import { Typography } from "@mui/material"; import Avatar from "@mui/material/Avatar"; import Default from "../assets/images/defaultavatar.svg"; import { COLOR } from "../styles/color"; +import { useNavigate } from "react-router-dom"; import List from "@mui/material/List"; import ListItem from "@mui/material/ListItem"; import ListItemButton from "@mui/material/ListItemButton"; @@ -12,10 +13,15 @@ import LogoutOutlinedIcon from "@mui/icons-material/LogoutOutlined"; import DoDisturbOutlinedIcon from "@mui/icons-material/DoDisturbOutlined"; const MypagePage = () => { + const navigate = useNavigate(); + + const goToEdit = () => { + navigate("/editprofil"); + }; const Menu = [ - { icon: , text: "프로필 편집" }, - { icon: , text: "로그아웃" }, - { icon: , text: "계정 탈퇴" }, + { icon: , text: "프로필 편집", action: goToEdit }, + { icon: , text: "로그아웃", action: goToEdit }, + { icon: , text: "계정 탈퇴", action: goToEdit }, ]; return ( @@ -28,12 +34,12 @@ const MypagePage = () => { cy1234@naver.com - + {Menu.map((it) => { return (
- + {it.icon} {it.text} @@ -106,14 +112,14 @@ const MenuDiv = styled.div` `; const MenuLstItem = styled(ListItem)` - /* border: 1px solid black; */ width: 100%; height: 5rem; + margin-left: 0.2rem 0rem 0.2rem 1.2rem; `; const MenuLIBtn = styled(ListItemButton)` - /* border: 1px solid blue; */ display: flex; + width: 100%; `; const MenuP = styled.p` diff --git a/src/routes/router.js b/src/routes/router.js index 0bea5bc..3a6e387 100644 --- a/src/routes/router.js +++ b/src/routes/router.js @@ -4,6 +4,7 @@ import LoginPage from "../pages/LoginPage"; import JoinPage from "../pages/JoinPage"; import CreateTripPage from "../pages/CreateTripPage"; import MypagePage from "../pages/MypagePage"; +import EditProfilPage from "../pages/EditProfilPage"; import React from "react"; const Router = () => { @@ -15,6 +16,7 @@ const Router = () => { } /> } /> } /> + } /> );