Skip to content

Commit fe85339

Browse files
committed
design: 마이페이지 중 내가 올린 게시물 페이지 퍼블리싱
1 parent 7988034 commit fe85339

File tree

4 files changed

+45
-21
lines changed

4 files changed

+45
-21
lines changed

src/App.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ const App = () => {
3131
<Route path=":id" element={<LetterDetailPage />} />
3232
</Route>
3333
<Route path="board">
34-
<Route path="letter" element={<LetterBoardPage />} />
34+
<Route element={<Layout />}>
35+
<Route path="rolling/:id" element={<RollingPaperPage />} />
36+
<Route path="letter" element={<LetterBoardPage />} />
37+
</Route>
3538
<Route path="letter/:id" element={<LetterBoardDetailPage />} />
36-
<Route path="rolling/:id" element={<RollingPaperPage />} />
3739
</Route>
3840
<Route path="mypage" element={<Layout />}>
3941
<Route index element={<MyPage />} />
42+
<Route path="board" element={<LetterBoardPage />} />
4043
<Route path="notifications" element={<NotificationsPage />} />
4144
</Route>
4245
</Route>

src/components/NoticeRolling.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Link } from 'react-router';
12
import { twMerge } from 'tailwind-merge';
23

34
import { NoticeIcon } from '@/assets/icons';
@@ -7,16 +8,18 @@ const DUMMY_CONTENT =
78

89
const NoticeRolling = () => {
910
return (
10-
<article
11-
className={twMerge(
12-
'text-gray-60 flex w-full items-center gap-2.5 rounded-lg px-4 py-2',
13-
'bg-linear-[275deg,rgba(255,255,255,0.4)_13.74%,rgba(238,238,238,0.4)_67.61%]',
14-
'shadow-[0_1px_6px_rgba(218,189,74,0.8)]',
15-
)}
16-
>
17-
<NoticeIcon className="h-6 w-6 text-gray-50" />
18-
<p className="body-sb line-clamp-1">{DUMMY_CONTENT}</p>
19-
</article>
11+
<Link to="/board/rolling/1">
12+
<article
13+
className={twMerge(
14+
'text-gray-60 flex w-full items-center gap-2.5 rounded-lg px-4 py-2',
15+
'bg-linear-[275deg,rgba(255,255,255,0.4)_13.74%,rgba(238,238,238,0.4)_67.61%]',
16+
'shadow-[0_1px_6px_rgba(218,189,74,0.8)]',
17+
)}
18+
>
19+
<NoticeIcon className="h-6 w-6 text-gray-50" />
20+
<p className="body-sb line-clamp-1">{DUMMY_CONTENT}</p>
21+
</article>
22+
</Link>
2023
);
2124
};
2225

src/pages/LetterBoard/index.tsx

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
1+
import { twMerge } from 'tailwind-merge';
2+
3+
import BackgroundBottom from '@/components/BackgroundBottom';
14
import NoticeRolling from '@/components/NoticeRolling';
25
import PageTitle from '@/components/PageTitle';
3-
import Header from '@/layouts/Header';
46

57
import LetterPreview from './components/LetterPreview';
68

79
const LetterBoardPage = () => {
10+
const isMyBoard = window.location.pathname.includes('/mypage');
11+
812
return (
913
<>
10-
<Header />
11-
<main className="mt-[-9px] flex grow flex-col items-center px-5 pb-10">
12-
<NoticeRolling />
13-
<PageTitle className="mt-4">게시판</PageTitle>
14-
<p className="text-gray-60 caption-m mt-4.5">
15-
따숨이에게 힘이 되었던 다양한 편지들을 모아두었어요
16-
</p>
14+
<main
15+
className={twMerge(
16+
'flex grow flex-col items-center px-5 pt-20 pb-10',
17+
!isMyBoard && 'mt-[-25px]',
18+
)}
19+
>
20+
{isMyBoard ? (
21+
<PageTitle className="mb-11">내가 올린 게시물</PageTitle>
22+
) : (
23+
<>
24+
<NoticeRolling />
25+
<PageTitle className="mt-4">게시판</PageTitle>
26+
<p className="text-gray-60 caption-m mt-4.5">
27+
따숨이에게 힘이 되었던 다양한 편지들을 모아두었어요
28+
</p>
29+
</>
30+
)}
1731
<section className="mt-6 grid grid-cols-2 gap-x-5 gap-y-4">
1832
{Array.from({ length: 10 }).map((_, index) => (
1933
<LetterPreview
@@ -27,6 +41,7 @@ const LetterBoardPage = () => {
2741
))}
2842
</section>
2943
</main>
44+
<BackgroundBottom />
3045
</>
3146
);
3247
};

src/pages/MyPage/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useState } from 'react';
2+
import { Link } from 'react-router';
23

34
import ConfirmModal from '@/components/ConfirmModal';
45

@@ -55,7 +56,9 @@ const MyPage = () => {
5556
<section className="flex flex-col gap-8">
5657
<div className="flex flex-col gap-2">
5758
<h3 className="text-gray-40 body-sb">활동</h3>
58-
<p className="body-sb text-gray-100">내가 올린 게시물</p>
59+
<Link to="board">
60+
<p className="body-sb text-gray-100">내가 올린 게시물</p>
61+
</Link>
5962
</div>
6063
<div className="flex flex-col gap-2">
6164
<h3 className="text-gray-40 body-sb">고객 센터</h3>

0 commit comments

Comments
 (0)