@@ -20,17 +20,25 @@ const SendDetailPage = () => {
2020 const [ letterCode , setLetterCode ] = useState ( '' ) ;
2121
2222 const [ maxLinesPerPage , setMaxLinesPerPage ] = useState ( 12 ) ;
23+ const [ fontSize , setFontSize ] = useState < string > ( '16px' ) ;
2324
2425 useEffect ( ( ) => {
2526 const updateMaxLines = ( ) => {
2627 if ( window . innerHeight > 780 ) {
27- setMaxLinesPerPage ( 10 ) ;
28- } else if ( window . innerHeight > 630 ) {
29- setMaxLinesPerPage ( 7 ) ;
28+ setMaxLinesPerPage ( 11 ) ;
29+ setFontSize ( '16px' ) ;
30+ } else if ( window . innerHeight > 660 ) {
31+ setMaxLinesPerPage ( 9 ) ;
32+ setFontSize ( '16px' ) ;
33+ } else if ( window . innerHeight > 628 ) {
34+ setMaxLinesPerPage ( 8 ) ;
35+ setFontSize ( '16px' ) ;
3036 } else if ( window . innerHeight > 580 ) {
31- setMaxLinesPerPage ( 5 ) ;
37+ setMaxLinesPerPage ( 7 ) ;
38+ setFontSize ( '16px' ) ;
3239 } else {
33- setMaxLinesPerPage ( 6 ) ;
40+ setMaxLinesPerPage ( 8 ) ;
41+ setFontSize ( '11px' ) ;
3442 }
3543 } ;
3644
@@ -76,7 +84,11 @@ const SendDetailPage = () => {
7684 ` ยท ์ฌ์ง ${ letterData . images . length } ์ฅ` }
7785 </ LetterCount >
7886 </ Header >
79- < LetterContainer >
87+ < LetterContainer
88+ $hasChangeButton = {
89+ letterData . content . length > 0 && letterData . images . length > 0
90+ }
91+ >
8092 < Letter
8193 key = { `${ key } -${ maxLinesPerPage } ` }
8294 showType = "send"
@@ -91,6 +103,7 @@ const SendDetailPage = () => {
91103 width = "100%"
92104 height = "100%"
93105 maxLines = { maxLinesPerPage }
106+ fontSize = { fontSize }
94107 />
95108 </ LetterContainer >
96109 < WhiteSpace />
@@ -170,48 +183,40 @@ const Header = styled.div`
170183 width: 100%;
171184` ;
172185
173- const LetterContainer = styled . div `
186+ const LetterContainer = styled . div < { $hasChangeButton : boolean } > `
174187 display: flex;
175188 justify-content: center;
176189 width: 100%;
177190 max-width: 345px;
178191 min-height: 398px;
179192 max-height: 398px;
193+ margin-bottom: ${ ( { $hasChangeButton } ) => ( $hasChangeButton ? '0' : '80px' ) } ;
180194
181- @media (max-height: 824px) {
182- max-width: 320px;
183- max-height: 350px;
195+ @media (max-height: 780px) {
184196 min-height: 350px;
197+ max-height: 350px;
185198 }
186199
187- @media (max-height: 780px) {
188- max-width: 300px;
200+ @media (max-height: 660px) {
189201 min-height: 330px;
190202 max-height: 330px;
191203 }
192204
193- @media (max-height: 680px) {
194- max-width: 300px;
195- min-height: 330px;
196- max-height: 330px;
205+ @media (max-height: 628px) {
206+ min-height: 310px;
207+ max-height: 310px;
197208 }
198209
199- @media (max-height: 630px) {
200- max-width: 300px;
210+ @media (max-height: 580px) {
201211 min-height: 280px;
202212 max-height: 280px;
203213 }
204214
205- @media (max-height: 580px) {
206- max-width: 250px;
207- min-height: 250px;
208- max-height: 250px;
209- }
210-
211215 @media (max-height: 550px) {
212- max-width: 250px;
213- min-height: 250px;
214- max-height: 250px;
216+ min-height: 260px;
217+ max-height: 260px;
218+ margin-bottom: ${ ( { $hasChangeButton } ) =>
219+ $hasChangeButton ? '0' : '55px' } ;
215220 }
216221` ;
217222
0 commit comments