Skip to content

Commit

Permalink
feat: 마이페이지 라우터 연결
Browse files Browse the repository at this point in the history
-프로필 편집 라우터 연결
-로그아웃시 홈 화면으로 연결
-내가만든 토론 클릭시 debate로 연결
-내가 참여한 토론 클릭시 participated-debates로 연결
  • Loading branch information
clicelee committed Jul 23, 2024
1 parent af6337e commit 29b98a3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import DebatePage from './pages/HistoryPage/Debate';
import RankingPage from './pages/RankingPage/RankingPage';
import PwdChangePage from './pages/ChangeInfoPage/PwdChangePage';
import MyPage from './pages/MyPage/MyPage';
import ProfileEditPage from './pages/ChangeInfoPage/ProfileEditPage';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<BrowserRouter>
Expand All @@ -24,6 +25,7 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
<Route path="/ranking" element={<RankingPage />} />
<Route path="/change-password" element={<PwdChangePage />} />
<Route path="/my-page" element={<MyPage />} />
<Route path="/profile-edit" element={<ProfileEditPage />} />

</Routes>
</BrowserRouter>
Expand Down
28 changes: 24 additions & 4 deletions src/pages/MyPage/MyPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
import React from 'react';
import alarm from '../../assets/images/ic_alarm.svg';
import profile from '../../assets/images/ic_profile.svg';
import { useNavigate } from 'react-router-dom';

const MyPage: React.FC = () => {
const navigate = useNavigate();

const handleProfileEditClick = () => {
navigate('/profile-edit');
};

const handleLogoutClick = () => {
// 로그아웃 로직 추가
navigate('/');
};

const handleDebateClick = () => {
navigate('/debate');
};

const handleParticipatedDebatesClick = () => {
navigate('/participated-debates');
};

return (
<div className="w-[390px] flex flex-col items-center mx-auto">
<header className="w-full flex justify-between items-center py-4">
Expand All @@ -14,16 +34,16 @@ const MyPage: React.FC = () => {
<h2 className="text-[20px] text-black font-pretendard font-bold leading-[24px] mt-3">김잇픽</h2>
<p className="text-[14px] text-gray3 mt-1">kimitpick@gmail.com</p>
<div className="flex gap-8 mt-5">
<button className="bg-point500 text-[16px] text-white font-pretendard font-semibold px-12 py-3 rounded-xl">프로필 편집</button>
<button className="bg-point100 text-[16px] text-point500 font-pretendard font-semibold px-12 py-3 rounded-xl">로그아웃</button>
<button className="bg-point500 text-[16px] text-white font-pretendard font-semibold px-12 py-3 rounded-xl cursor-pointer" onClick={handleProfileEditClick}>프로필 편집</button>
<button className="bg-point100 text-[16px] text-point500 font-pretendard font-semibold px-12 py-3 rounded-xl cursor-pointer" onClick={handleLogoutClick}>로그아웃</button>
</div>
</div>
<div className="w-full h-3 bg-gray1 mt-8"></div>
<div className="w-full">
<div className="ml-6 my-2">
<h3 className="text-[16px] text-black font-pretendard font-bold py-3">히스토리</h3>
<p className="text-[16px] text-black font-pretendard font-normal py-3">내가 만든 토론</p>
<p className="text-[16px] text-black font-pretendard font-normal py-3">내가 참여한 토론</p>
<p className="text-[16px] text-black font-pretendard font-normal py-3 cursor-pointer" onClick={handleDebateClick}>내가 만든 토론</p>
<p className="text-[16px] text-black font-pretendard font-normal py-3 cursor-pointer" onClick={handleParticipatedDebatesClick}>내가 참여한 토론</p>
</div>
<div className="w-full h-0.5 bg-gray1"></div>
<div className="ml-6 mt-2">
Expand Down

0 comments on commit 29b98a3

Please sign in to comment.