File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
pages/LetterBoardDetail/components Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,9 @@ interface ModalOverlayProps {
1111const 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' ) ;
Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments