diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 10a42eb..2b629cd 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -3,7 +3,7 @@ import { Link } from "@mui/icons-material"; import "../../style/login.scss"; import CloseIcon from "@mui/icons-material/Close"; import Menubar from "../../component/MenuBar"; -import { useState, ChangeEvent, FormEvent } from "react"; +import { useState, ChangeEvent, FormEvent, useEffect } from "react"; import axios from "axios"; import { useRouter } from "next/navigation"; @@ -21,43 +21,25 @@ export default function Login() { const handleLogin = async (e: FormEvent) => { e.preventDefault(); - try { - const respone = await axios({ - method: "GET", - url: '13.124.197.227:8080/user/api/login?email="user100@test.com&password="1234"', - headers: { - Authorization: "weatherfit", - }, - }); - /* - const res = await axios.post("/user/signin", { email, pw }); + useEffect(() => { + const dataFunc = async () => { + try { + const respone = await axios({ + method: "GET", + url: "https://www.jerneithe.site/user/signin?email=user100@test.com&password=1234", + headers: { + Authorization: "weatherfit", + }, + }); + console.log(respone); + } catch (error) { + console.error(error); + } + }; - // 응답 상태 코드가 200이면 로그인 성공 - if (res.status === 200) { - alert(`${res.data.ninkname}님 반갑습니다!`); - router.push("/"); // 로그인 성공 후 메인으로 이동 - } else { - // 로그인 실패 시 서버에서 보낸 에러 메시지를 출력 - alert(res.data.message); - } - */ - - /* - // if (email === userData.email && pw === userData.pw) { - // alert(`${userData.name}님 반갑습니다!`); - // router.push("/"); // 로그인 성공 후 메인으로 이동 - // } else if (email === userData.email && pw != userData.pw) { - // alert("비밀번호가 틀렸습니다."); - // } else if (email != userData.email && pw === userData.pw) { - // alert("아이디가 틀렸습니다."); - // } else { - // alert("로그인에 실패하였습니다."); - // } - */ - } catch (error) { - console.error(error); - } + dataFunc(); + }); }; const handleInputChange = diff --git a/src/app/mypage/page.tsx b/src/app/mypage/page.tsx index 3b9881e..d724b40 100644 --- a/src/app/mypage/page.tsx +++ b/src/app/mypage/page.tsx @@ -1,75 +1,53 @@ "use client"; import { useState } from "react"; -import Image from "next/image"; import "../../style/mypage.scss"; +import SettingsIcon from "@mui/icons-material/Settings"; import AccountCircleOutlinedIcon from "@mui/icons-material/AccountCircleOutlined"; -import GridOnOutlinedIcon from "@mui/icons-material/GridOnOutlined"; -import GridOnIcon from "@mui/icons-material/GridOn"; -import FavoriteBorderOutlinedIcon from "@mui/icons-material/FavoriteBorderOutlined"; -import FavoriteIcon from "@mui/icons-material/Favorite"; import Menubar from "@/component/MenuBar"; +import TabBar from "@/component/TabBar"; +import Profile from "@/component/Profile"; // import ChevronRightOutlinedIcon from '@mui/icons-material/ChevronRightOutlined'; // > 아이콘 export default function Mypage() { - const [liked, setLiked] = useState(false); + const [showProfileModify, setShowProfileModify] = useState(false); - const handleLikeClick = () => { - setLiked(!liked); + const handleSettingsClick = () => { + setShowProfileModify(!showProfileModify); }; - return ( -
- {/* header 넣을지 말지 */} - {/*
로고 이미지
*/} -

마이페이지

-
- {/* ------------- 프로필 부분 ------------- */} -
-
- -

김똥이

-
-
-
-

내 게시물

-

7

+ <> +
+ {/* header 넣을지 말지 */} + {/*
로고 이미지
*/} +
+

마이페이지

+ +
+
+ {/* ------------- 프로필 부분 ------------- */} +
+
+ +

김똥이

-
-

좋아요 한 게시물

-

10

+
+
+

내 게시물

+

7

+
+
+

좋아요 한 게시물

+

10

+
+ {/* --------------------------------------- */} + {/* ------------- tap 부분 ------------- */} +
- {/* --------------------------------------- */} - {/* ------------- tap 부분 ------------- */} -
- - {liked ? ( - - ) : ( - - )} -
- {/* --------------------------------------- */} - {/* ------------- post 부분 ------------- */} -
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
+
- -
+ {showProfileModify ? : null} + ); } diff --git a/src/component/LikePost.tsx b/src/component/LikePost.tsx new file mode 100644 index 0000000..2e7592c --- /dev/null +++ b/src/component/LikePost.tsx @@ -0,0 +1,11 @@ +export default function LikePost() { + return ( +
+
1
+
2
+
3
+
4
+
5
+
+ ); +} diff --git a/src/component/MyPost.tsx b/src/component/MyPost.tsx new file mode 100644 index 0000000..f6e4ae0 --- /dev/null +++ b/src/component/MyPost.tsx @@ -0,0 +1,14 @@ +export default function MyPost() { + return ( +
+
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
+ ); +} diff --git a/src/component/Profile.tsx b/src/component/Profile.tsx new file mode 100644 index 0000000..26cbe33 --- /dev/null +++ b/src/component/Profile.tsx @@ -0,0 +1,3 @@ +export default function Profile() { + return
프로필 수정창
; +} diff --git a/src/component/TabBar.tsx b/src/component/TabBar.tsx new file mode 100644 index 0000000..47428e2 --- /dev/null +++ b/src/component/TabBar.tsx @@ -0,0 +1,57 @@ +import { useState } from "react"; +import GridOnOutlinedIcon from "@mui/icons-material/GridOnOutlined"; +import GridOnTwoToneIcon from "@mui/icons-material/GridOnTwoTone"; +import FavoriteBorderOutlinedIcon from "@mui/icons-material/FavoriteBorderOutlined"; +import FavoriteIcon from "@mui/icons-material/Favorite"; +import LikePost from "./LikePost"; +import MyPost from "./MyPost"; + +export default function TabBar() { + const [grid, setGrid] = useState(true); + const [liked, setLiked] = useState(false); + + const handleGridClick = () => { + if (!liked && grid) { + setGrid(grid); + } else { + setGrid(true); + setLiked(false); + } + }; + + const handleLikeClick = () => { + if (!grid && liked) { + setLiked(liked); + } else { + setLiked(true); + setGrid(false); + } + }; + + return ( + <> +
+ {grid ? ( + + ) : ( + + )} + + {liked ? ( + + ) : ( + + )} +
+ {/* post 부분 */} + {grid ? : null} + {liked ? : null} + + ); +} diff --git a/src/style/mypage.scss b/src/style/mypage.scss index 303dc4c..72b2659 100644 --- a/src/style/mypage.scss +++ b/src/style/mypage.scss @@ -9,14 +9,21 @@ width: 100%; margin-top: 2%; } - .title { + .top { font-size: 150%; font-weight: bold; - text-align: center; + // text-align: center; width: 100%; padding: 1% 0 1% 0; border-bottom: solid 2px #d0dbff; margin: 2% 0; + display: flex; + align-items: center; + justify-content: center; + .title { + width: 90%; + text-align: center; + } } .mypage_body { width: 90%; @@ -64,16 +71,17 @@ // } } // -------------------------------------- - .tap_bar { + .tab_bar { height: 6vh; margin-bottom: 2%; .icon { height: 100%; width: 50%; cursor: pointer; + color: #a8bbff; } - .like_icon { - color: aqua; + .click_icon { + border-bottom: solid #a8bbff; } } .post_box { @@ -92,3 +100,7 @@ } } } + +.profile { + background-color: antiquewhite; +}