Skip to content

Commit b80300f

Browse files
committed
design: 편지 공유 게시글 상세 페이지 퍼블리싱
1 parent 1271579 commit b80300f

File tree

9 files changed

+160
-5
lines changed

9 files changed

+160
-5
lines changed

src/assets/icons/delete.svg

Lines changed: 8 additions & 0 deletions
Loading

src/assets/icons/index.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
import AlarmIcon from './alarm.svg?react';
22
import ArrowLeftIcon from './arrow-left.svg?react';
33
import BoardIcon from './board.svg?react';
4+
import DeleteIcon from './delete.svg?react';
45
import EnvelopeIcon from './envelope.svg?react';
6+
import LikeFilledIcon from './like-filled.svg?react';
7+
import LikeOutlinedIcon from './like-outlined.svg?react';
58
import NoticeIcon from './notice.svg?react';
69
import PersonIcon from './person.svg?react';
7-
import SirenIcon from './siren.svg?react';
10+
import SirenFilledIcon from './siren-filled.svg?react';
11+
import SirenOutlinedIcon from './siren-outlined.svg?react';
812

9-
export { AlarmIcon, PersonIcon, ArrowLeftIcon, SirenIcon, EnvelopeIcon, BoardIcon, NoticeIcon };
13+
export {
14+
AlarmIcon,
15+
PersonIcon,
16+
ArrowLeftIcon,
17+
SirenFilledIcon,
18+
SirenOutlinedIcon,
19+
EnvelopeIcon,
20+
BoardIcon,
21+
NoticeIcon,
22+
LikeFilledIcon,
23+
LikeOutlinedIcon,
24+
DeleteIcon,
25+
};

src/assets/icons/like-filled.svg

Lines changed: 8 additions & 0 deletions
Loading

src/assets/icons/like-outlined.svg

Lines changed: 8 additions & 0 deletions
Loading
File renamed without changes.
Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import {
2+
ArrowLeftIcon,
3+
DeleteIcon,
4+
LikeFilledIcon,
5+
LikeOutlinedIcon,
6+
SirenOutlinedIcon,
7+
} from '@/assets/icons';
8+
9+
interface HeaderProps {
10+
likeCount: number;
11+
isLike: boolean;
12+
isWriter: boolean;
13+
onToggleLike: () => void;
14+
onOpenReportModal: () => void;
15+
}
16+
17+
const Header = ({ likeCount, isLike, isWriter, onToggleLike, onOpenReportModal }: HeaderProps) => {
18+
return (
19+
<header className="fixed top-0 z-40 w-full max-w-150">
20+
<div className="flex h-16 items-center justify-between bg-white p-5">
21+
<ArrowLeftIcon className="text-primary-1 h-6 w-6" />
22+
<div className="flex items-center gap-3">
23+
<div className="flex items-center gap-1">
24+
<button type="button" onClick={onToggleLike}>
25+
{isLike ? (
26+
<LikeFilledIcon className="text-primary-1 h-6 w-6" />
27+
) : (
28+
<LikeOutlinedIcon className="text-primary-1 h-6 w-6" />
29+
)}
30+
</button>
31+
<p className="body-l-m text-primary-1">{likeCount}</p>
32+
</div>
33+
{isWriter ? (
34+
<DeleteIcon className="text-primary-1 h-6 w-6" />
35+
) : (
36+
<button type="button" onClick={onOpenReportModal}>
37+
<SirenOutlinedIcon className="text-primary-1 h-6 w-6" />
38+
</button>
39+
)}
40+
</div>
41+
</div>
42+
<div className="h-4 w-full bg-gradient-to-b from-white to-white/0" />
43+
</header>
44+
);
45+
};
46+
47+
export default Header;
Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
1+
import { useState } from 'react';
2+
import { twMerge } from 'tailwind-merge';
3+
4+
import ReportModal from '@/components/ReportModal';
5+
6+
import Header from './components/Header';
7+
import Letter from './components/Letter';
8+
9+
const DUMMY_LETTER = {
10+
receiver: '12E21',
11+
content:
12+
'편지 내용 어쩌구저쩌구 뾰로롱 편지 내용 어쩌구저쩌구 뾰로롱편지 내용 어쩌구 뾰로롱편지 내용 어쩌구 뾰로롱편지 내용 어쩌구 뾰로롱편지 내용 어쩌구 뾰로롱편지 내용 어쩌구 뾰로롱편지 내용 어쩌구 뾰로롱편지 내용 어쩌구 뾰로롱편지 내용 어쩌구 뾰로롱편지 내용 어쩌구 저쩌구 끝~!!',
13+
sender: '12345',
14+
};
15+
116
const LetterBoardDetailPage = () => {
2-
return <div>LetterBoardDetailPage</div>;
17+
const [likeCount, setLikeCount] = useState(122);
18+
const [isLike, setIsLike] = useState(false);
19+
const isWriter = false;
20+
const [activeReportModal, setActiveReportModal] = useState(false);
21+
22+
const handleToggleLike = () => {
23+
setLikeCount((prev) => prev + (isLike ? -1 : 1));
24+
setIsLike((prev) => !prev);
25+
};
26+
27+
return (
28+
<>
29+
{activeReportModal && <ReportModal onClose={() => setActiveReportModal(false)} />}
30+
<div className="grow bg-white">
31+
<Header
32+
likeCount={likeCount}
33+
isLike={isLike}
34+
isWriter={isWriter}
35+
onToggleLike={handleToggleLike}
36+
onOpenReportModal={() => setActiveReportModal(true)}
37+
/>
38+
<main className="px-5 pt-18 pb-3">
39+
<p className="body-b mb-6 px-5">FROM. 12E31</p>
40+
<p
41+
className={twMerge(
42+
'body-r bg-[repeating-linear-gradient(transparent,transparent_25px,#ffe6e3_26px)] px-5 whitespace-pre-wrap',
43+
'leading-[26px]',
44+
)}
45+
>
46+
내가 최근 먀먀먀를 했음. 그런데 이런 고민을 부모님께 말씀드리기에는 너무 죄송했음.
47+
이런저런 조언을 구하지 못해 편지를 작성했는데 너무나도 따뜻한 조언과 이야기를 받고 힘이
48+
났음. 다른 분들께도 내가 받았던 응원을 함께 공유하고 싶음.
49+
</p>
50+
<section className="flex flex-col gap-6.5 px-5 py-6.5">
51+
<Letter letter={DUMMY_LETTER} isSender />
52+
<Letter letter={DUMMY_LETTER} />
53+
<Letter letter={DUMMY_LETTER} isSender />
54+
<Letter letter={DUMMY_LETTER} />
55+
<Letter letter={DUMMY_LETTER} isSender />
56+
<Letter letter={DUMMY_LETTER} isSender />
57+
<Letter letter={DUMMY_LETTER} />
58+
</section>
59+
</main>
60+
</div>
61+
</>
62+
);
363
};
464

565
export default LetterBoardDetailPage;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { BoardIcon, EnvelopeIcon, SirenIcon } from '@/assets/icons';
1+
import { BoardIcon, EnvelopeIcon, SirenFilledIcon } from '@/assets/icons';
22

33
export const NOTIFICATION_ICON: Record<
44
string,
55
React.ComponentType<React.SVGProps<SVGSVGElement>>
66
> = {
77
letter: EnvelopeIcon,
8-
warning: SirenIcon,
8+
warning: SirenFilledIcon,
99
board: BoardIcon,
1010
};

0 commit comments

Comments
 (0)