Skip to content

Commit

Permalink
Refactor : my page (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
naraeng committed Aug 22, 2024
1 parent fb48141 commit e3d2b84
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 222 deletions.
20 changes: 5 additions & 15 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@ import BranchCentralPage from './pages/BranchCentral';
import BranchSmallPage from './pages/BranchSmall';
import ReviewComment from './component/detail/review/ReviewComment';
import MyReview from './component/mypage/review/MyReview';
// import AdminPage from './pages/AdminPage';
import AdminMenu from './component/admin/AdminMenu';
import EditPage from './component/admin/EditPage';
import PendingList from './component/admin/pending/PendingList';
import Layout from './component/admin/component/Layout';
import ClubReviews from './component/admin/ClubReviews';
import RecruitPage from './pages/RecruitPage';
import QnAPage from './pages/QnAPage';
import NoticeList from './component/main/NoticeList';
import NoticePage from './pages/NoticePage';
import AdminPage from './pages/AdminPage';
import UserMenu from './component/mypage/UserMenu';
import MyPage from './component/mypage/MyPage';

function App() {
const isPc = useMediaQuery({
Expand Down Expand Up @@ -60,25 +57,18 @@ function App() {
<Route path="/hashtag" element={<HashTagPage />} />
<Route path="/search" element={<SearchPage />} />
<Route path="/summary" element={<SummaryPage />} />
<Route path="/user" element={<UserMenu />} />
<Route path="/user" element={<MyPage />} />
<Route path="/user/bookmark" element={<BookMarkPage />} />
<Route path="/user/reviews" element={<MyReview />} />
<Route path="/recruit" element={<RecruitPage />} />

<Route path="/qna" element={<QnAPage />} />

<Route path="/admin" element={<AdminMenu />} />
<Route path="/admin" element={<MyPage />} />
<Route path="/admin/mypage" element={<AdminPage />} />
<Route path="/admin/edit/:clubId" element={<EditPage />} />
<Route path="/admin/mypage/reviews" element={<ClubReviews />} />
<Route path="/admin/mypage/pending" element={<PendingList />} />
{/* <Route path="/admin" element={<Layout />}>
<Route index element={<AdminMenu />} />
<Route path="/admin/edit/:clubId" element={<EditPage />} />
<Route path="/admin/mypage/reviews" element={<ClubReviews />} />
<Route path="/admin/mypage/pending" element={<PendingList />} />
</Route> */}
</Routes>
<Footer />
</BrowserRouter>
Expand All @@ -103,10 +93,10 @@ function App() {
<Route path="/hashtag" element={<HashTagPage />} />
<Route path="/search" element={<SearchPage />} />
<Route path="/summary" element={<SummaryPage />} />
<Route path="/user" element={<UserMenu />} />
<Route path="/user" element={<MyPage />} />
<Route path="/user/bookmark" element={<BookMarkPage />} />
<Route path="/user/reviews" element={<MyReview />} />
<Route path="/admin" element={<AdminMenu />} />
<Route path="/admin" element={<MyPage />} />
<Route path="/admin/mypage" element={<AdminPage />} />
<Route path="/admin/edit/:clubId" element={<EditPage />} />
<Route path="/admin/mypage/reviews" element={<ClubReviews />} />
Expand Down
27 changes: 0 additions & 27 deletions src/component/admin/AdminMenu.jsx

This file was deleted.

1 change: 0 additions & 1 deletion src/component/admin/Mypage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { customAxios } from '../../config/axios-config';
import { LinkItem } from '../branch/BranchCentral';
import AdminIntroductionPage from './AdminIntroductionpage';
import styles from './mypage.module.css';
import SideBar from './component/SideBar';

export default function MyPage() {
const accessToken = localStorage.getItem('accessToken');
Expand Down
17 changes: 0 additions & 17 deletions src/component/admin/component/Layout.jsx

This file was deleted.

49 changes: 0 additions & 49 deletions src/component/admin/component/SideBar.jsx

This file was deleted.

8 changes: 0 additions & 8 deletions src/component/admin/component/layout.module.css

This file was deleted.

86 changes: 0 additions & 86 deletions src/component/admin/component/sideBar.module.css

This file was deleted.

2 changes: 1 addition & 1 deletion src/component/layout/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function Header() {

setModalMessage(error.response.data.reason);
setIsModalOpen(true);

localStorage.removeItem('accessToken');
localStorage.removeItem('refreshToken');
localStorage.removeItem('adminId');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { customAxios } from '../../config/axios-config';
import '../admin/adminMenu.css';
import './myPage.css';
import { NavLink, useNavigate } from 'react-router-dom';

export default function UserMenu() {
export default function MyPage() {
const navigate = useNavigate();

const isAdmin = localStorage.getItem('isAdmin');
Expand Down Expand Up @@ -73,19 +73,40 @@ export default function UserMenu() {
};

return (
<div className="admin_container">
<div className="admin_header">
<div className="my_container">
<div className="my_header">
<h3>마이페이지</h3>
</div>
<div className="admin_body">
<NavLink to={`/user/bookmark`} className="menu_tab">
나의 즐겨찾기
</NavLink>
<NavLink to={`/user/reviews`} className="menu_tab">
내가 쓴 리뷰
</NavLink>
<div className="divider" />
<div className='menu_tab' onClick={handleLogout}>로그아웃</div>
<div className="my_body">
{isAdmin ? (
<>
<NavLink to={`/admin/mypage`} className="menu_tab">
동아리 정보수정
</NavLink>
<div className="menu_tab">나의 모집글</div>
<div className="my_divider" />
<NavLink to={`/admin/mypage/reviews`} className="menu_tab">
리뷰 목록
</NavLink>
<NavLink to={`/admin/mypage/pending`} className="menu_tab">
리뷰 승인
</NavLink>
<div className="my_divider" />
<div className='menu_tab'>비밀번호 변경</div>
<div className='menu_tab' onClick={handleLogout}>로그아웃</div>
</>
) : (
<>
<NavLink to={`/user/bookmark`} className="menu_tab">
나의 즐겨찾기
</NavLink>
<NavLink to={`/user/reviews`} className="menu_tab">
내가 쓴 리뷰
</NavLink>
<div className="my_divider" />
<div className='menu_tab' onClick={handleLogout}>로그아웃</div>
</>
)}
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
.admin_container {
.my_container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 200px;
}

.admin_header {
.my_header {
width: 100%;
height: 177px;
background: #7bc8e0;
text-align: center;
margin-bottom: 30px;
}

.admin_header h3 {
.my_header h3 {
position: relative;
top: 45%;
}

.admin_body {
.my_body {
width: 80%;
display: flex;
flex-direction: column;
Expand All @@ -44,7 +44,7 @@
color: #7bc8e0;
}

.divider {
.my_divider {
width: 45%;
border: 0.2px solid #9c9c9c4d;
margin: 20px 0px;
Expand Down

0 comments on commit e3d2b84

Please sign in to comment.