Skip to content

Commit 1271579

Browse files
committed
design: 게시판 상세 페이지의 편지 컴포넌트 퍼블리싱
1 parent fe85339 commit 1271579

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

src/assets/images/memo-yellow.png

292 KB
Loading

src/components/ModalOverlay.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ interface ModalOverlayProps {
1111
const ModalOverlay = ({ closeOnOutsideClick = false, children, onClose }: ModalOverlayProps) => {
1212
useEffect(() => {
1313
const scrollbarWidth = getScrollbarWidth();
14-
const header = document.querySelector('header');
1514

1615
document.documentElement.style.setProperty('--scrollbar-width', `${scrollbarWidth}px`);
1716
document.body.classList.add('modal-open');
18-
if (header) header.classList.add('modal-open');
1917

2018
return () => {
2119
document.documentElement.style.setProperty('--scrollbar-width', '0px');
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import PinkMemoBg from '@/assets/images/memo-pink.png';
2+
import YellowMemoBg from '@/assets/images/memo-yellow.png';
3+
4+
interface LetterProps {
5+
letter: {
6+
receiver: string;
7+
content: string;
8+
sender: string;
9+
};
10+
isSender?: boolean;
11+
}
12+
13+
const Letter = ({ letter, isSender = false }: LetterProps) => {
14+
return (
15+
<article
16+
className="flex flex-col gap-2 bg-[image:var(--bg-image)] bg-[length:100%_100%] bg-center p-4 text-black"
17+
style={
18+
{ '--bg-image': `url(${isSender ? PinkMemoBg : YellowMemoBg})` } as React.CSSProperties
19+
}
20+
>
21+
<p className="body-sb">To. {letter.receiver}</p>
22+
<p className="body-r leading-[26px] whitespace-pre-wrap">{letter.content}</p>
23+
<p className="body-m place-self-end">From. {letter.sender}</p>
24+
</article>
25+
);
26+
};
27+
28+
export default Letter;

0 commit comments

Comments
 (0)