@@ -29,17 +29,25 @@ const IndependentLetterPage = () => {
2929 const [ isDelete , setIsDelete ] = useState ( false ) ;
3030
3131 const [ maxLinesPerPage , setMaxLinesPerPage ] = useState ( 12 ) ;
32+ const [ fontSize , setFontSize ] = useState < string > ( '16px' ) ;
3233
3334 useEffect ( ( ) => {
3435 const updateMaxLines = ( ) => {
35- if ( window . innerHeight > 800 ) {
36- setMaxLinesPerPage ( 10 ) ;
37- } else if ( window . innerHeight > 680 ) {
36+ if ( window . innerHeight > 780 ) {
37+ setMaxLinesPerPage ( 11 ) ;
38+ setFontSize ( '16px' ) ;
39+ } else if ( window . innerHeight > 660 ) {
40+ setMaxLinesPerPage ( 9 ) ;
41+ setFontSize ( '16px' ) ;
42+ } else if ( window . innerHeight > 628 ) {
3843 setMaxLinesPerPage ( 8 ) ;
39- } else if ( window . innerHeight > 600 ) {
40- setMaxLinesPerPage ( 6 ) ;
44+ setFontSize ( '16px' ) ;
45+ } else if ( window . innerHeight > 580 ) {
46+ setMaxLinesPerPage ( 7 ) ;
47+ setFontSize ( '16px' ) ;
4148 } else {
42- setMaxLinesPerPage ( 5 ) ;
49+ setMaxLinesPerPage ( 8 ) ;
50+ setFontSize ( '11px' ) ;
4351 }
4452 } ;
4553
@@ -143,7 +151,11 @@ const IndependentLetterPage = () => {
143151 ) }
144152 </ IconWrapper >
145153 < MainWrapper >
146- < LetterContainer >
154+ < LetterContainer
155+ $hasChangeButton = {
156+ letterData . content . length > 0 && letterData . images . length > 0
157+ }
158+ >
147159 < Letter
148160 key = { `${ key } -${ maxLinesPerPage } ` }
149161 showType = "receive"
@@ -158,6 +170,7 @@ const IndependentLetterPage = () => {
158170 width = "100%"
159171 height = "100%"
160172 maxLines = { maxLinesPerPage }
173+ fontSize = { fontSize }
161174 />
162175 </ LetterContainer >
163176 { letterData . images . length > 0 && letterData . content . length > 0 ? (
@@ -332,42 +345,41 @@ const PopupBtn = styled.button`
332345 }
333346` ;
334347
335- const LetterContainer = styled . div `
348+ const LetterContainer = styled . div < { $hasChangeButton : boolean } > `
336349 display: flex;
337350 justify-content: center;
351+ align-items: center;
338352 width: 100%;
339353 max-width: 345px;
340354 min-height: 398px;
341355 max-height: 398px;
356+ margin-bottom: ${ ( { $hasChangeButton } ) => ( $hasChangeButton ? '0' : '80px' ) } ;
342357
343- @media (max-height: 824px) {
344- max-width: 320px;
358+ @media (max-height: 780px) {
345359 min-height: 350px;
346360 max-height: 350px;
347361 }
348362
349- @media (max-height: 780px) {
350- max-width: 300px;
363+ @media (max-height: 660px) {
351364 min-height: 330px;
352365 max-height: 330px;
353366 }
354367
355- @media (max-height: 680px) {
356- max-width: 300px;
357- min-height: 300px;
358- max-height: 300px;
368+ @media (max-height: 628px) {
369+ min-height: 310px;
370+ max-height: 310px;
359371 }
360372
361- @media (max-height: 600px) {
362- max-width: 250px;
363- min-height: 250px;
364- max-height: 250px;
373+ @media (max-height: 580px) {
374+ min-height: 280px;
375+ max-height: 280px;
365376 }
366377
367378 @media (max-height: 550px) {
368- max-width: 250px;
369- min-height: 250px;
370- max-height: 250px;
379+ min-height: 260px;
380+ max-height: 260px;
381+ margin-bottom: ${ ( { $hasChangeButton } ) =>
382+ $hasChangeButton ? '0' : '55px' } ;
371383 }
372384` ;
373385
0 commit comments