Skip to content

Commit 5a22765

Browse files
authored
Merge pull request #109 from ASAP-Lettering/design/#108
[Design] 편지 열람 반응형 수정
2 parents 24b9a1d + c62a847 commit 5a22765

File tree

4 files changed

+287
-252
lines changed

4 files changed

+287
-252
lines changed

src/app/independent/[id]/page.tsx

Lines changed: 127 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Button from "@/components/common/Button";
55
import Loader from "@/components/common/Loader";
66
import NavigatorBar from "@/components/common/NavigatorBar";
77
import Letter from "@/components/letter/Letter";
8+
import { theme } from "@/styles/theme";
89
import { IndependentLetterType, LetterDetailType } from "@/types/letter";
910
import { getAccessToken } from "@/utils/storage";
1011
import { useParams, useRouter } from "next/navigation";
@@ -58,9 +59,9 @@ const IndependentLetterPage = () => {
5859

5960
return letterData ? (
6061
<Container>
61-
<Wrapper>
62+
<NavigatorBarWrapper>
6263
<NavigatorBar cancel={false} url="/planet" />
63-
</Wrapper>
64+
</NavigatorBarWrapper>
6465
<MainWrapper>
6566
<Header>
6667
<HeaderTitle>
@@ -73,17 +74,21 @@ const IndependentLetterPage = () => {
7374
</HeaderTitle>
7475
<LetterCount>궤도 속 편지 | {letterData.letterCount}</LetterCount>
7576
</Header>
76-
<Letter
77-
showType="receive"
78-
key={key}
79-
id={letterId}
80-
templateType={letterData.templateType}
81-
name={letterData.senderName}
82-
content={letterData.content}
83-
images={letterData.images}
84-
date={letterData.sendDate}
85-
isImage={isImage}
86-
/>
77+
<LetterContainer>
78+
<Letter
79+
showType="receive"
80+
key={key}
81+
id={letterId}
82+
templateType={letterData.templateType}
83+
name={letterData.senderName}
84+
content={letterData.content}
85+
images={letterData.images}
86+
date={letterData.sendDate}
87+
isImage={isImage}
88+
width="100%"
89+
height="100%"
90+
/>
91+
</LetterContainer>
8792
{letterData.images.length > 0 && letterData.content.length > 0 ? (
8893
<ChangeButtonWrapper onClick={changeImageorContent}>
8994
<img src="/assets/icons/ic_change_image.svg"></img>
@@ -154,48 +159,110 @@ const Container = styled.div`
154159
flex-direction: column;
155160
justify-content: space-between;
156161
box-sizing: border-box;
162+
width: 100%;
157163
height: 100%;
158-
color: white;
159-
//padding: 25px;
160-
overflow-x: hidden;
164+
color: ${theme.colors.white};
161165
background: ${(props) => props.theme.colors.bg};
162-
/* background-image: url('/assets/signup/verify_image.png');
163-
background-size: 550px auto;
164-
background-position: bottom 80px center;
165-
background-repeat: no-repeat; */
166+
position: relative;
167+
`;
168+
169+
const NavigatorBarWrapper = styled.div`
170+
display: flex;
171+
width: 100%;
172+
padding: 18px 18px 9px 18px;
166173
`;
167174

168175
const MainWrapper = styled.div`
169176
display: flex;
170177
flex-direction: column;
171178
align-items: center;
172-
justify-content: center;
179+
justify-content: flex-start;
173180
width: 100%;
174181
height: 100%;
175-
padding: 0 19px 0 24px;
182+
padding: 0 18px;
176183
overflow-y: auto;
177184
overflow-x: hidden;
178-
&::-webkit-scrollbar {
179-
width: 5px; /* Width of the scrollbar */
185+
`;
186+
187+
const Header = styled.div`
188+
display: flex;
189+
flex-direction: row;
190+
padding-bottom: 15px;
191+
width: 100%;
192+
`;
193+
194+
const HeaderTitle = styled.div`
195+
width: 100%;
196+
${(props) => props.theme.fonts.heading01};
197+
flex: 2;
198+
span {
199+
${(props) => props.theme.fonts.heading02};
200+
white-space: nowrap;
180201
}
181202
182-
&::-webkit-scrollbar-track {
183-
background: ${(props: any) => props.theme.colors.gray800};
184-
border-radius: 10px; /* Rounded corners */
203+
@media (max-height: 780px) {
204+
${theme.fonts.title01};
205+
span {
206+
${(props) => props.theme.fonts.body03};
207+
}
185208
}
186209
187-
&::-webkit-scrollbar-thumb {
188-
background: ${(props: any) => props.theme.colors.gray600};
189-
border-radius: 10px; /* Rounded corners */
210+
@media (max-height: 628px) {
211+
${theme.fonts.subtitle};
212+
span {
213+
${(props) => props.theme.fonts.body07};
214+
}
215+
}
216+
217+
@media (max-height: 580px) {
218+
${theme.fonts.subtitle};
219+
span {
220+
${(props) => props.theme.fonts.body07};
221+
}
190222
}
191223
`;
192224

193-
const Header = styled.div`
225+
const LetterContainer = styled.div`
194226
display: flex;
195-
flex-direction: row;
196-
padding: 15px 0px;
227+
justify-content: center;
197228
width: 100%;
198-
padding-top: 40px;
229+
max-width: 345px;
230+
min-height: 398px;
231+
max-height: 398px;
232+
233+
@media (max-height: 824px) {
234+
max-width: 320px;
235+
min-height: 350px;
236+
}
237+
238+
@media (max-height: 780px) {
239+
max-width: 280px;
240+
min-height: 320px;
241+
max-height: 320px;
242+
}
243+
244+
@media (max-height: 700px) {
245+
min-height: 300px;
246+
max-height: 300px;
247+
}
248+
249+
@media (max-height: 680px) {
250+
max-width: 250px;
251+
min-height: 280px;
252+
max-height: 280px;
253+
}
254+
255+
@media (max-height: 580px) {
256+
max-width: 250px;
257+
min-height: 250px;
258+
max-height: 250px;
259+
}
260+
261+
@media (max-height: 550px) {
262+
max-width: 220px;
263+
min-height: 220px;
264+
max-height: 220px;
265+
}
199266
`;
200267

201268
const LetterCount = styled.div`
@@ -209,30 +276,13 @@ const LetterCount = styled.div`
209276
padding: 5px;
210277
`;
211278

212-
const HeaderTitle = styled.div`
213-
width: 100%;
214-
${(props) => props.theme.fonts.heading01};
215-
margin-top: 1rem;
216-
flex: 2;
217-
span {
218-
${(props) => props.theme.fonts.heading02};
219-
white-space: nowrap;
220-
}
221-
`;
222-
223-
// const HeaderSubTitle = styled.div`
224-
// width: 100%;
225-
// ${(props) => props.theme.fonts.regular16};
226-
// color: ${(props) => props.theme.colors.gray300};
227-
// padding-top: 10px;
228-
// `;
229-
230279
const ButtonContainer = styled.div`
231-
display: flex;
232-
flex-direction: row;
233280
width: 100%;
234-
gap: 12px;
235-
padding: 25px;
281+
position: absolute;
282+
padding: 0 20px;
283+
bottom: 40px;
284+
left: 0;
285+
z-index: 1000;
236286
`;
237287

238288
const LoaderContainer = styled.div`
@@ -272,19 +322,39 @@ const ChangeButtonWrapper = styled.div`
272322
height: 20px;
273323
flex-shrink: 0;
274324
}
325+
326+
@media (max-height: 730px) {
327+
flex-direction: row;
328+
gap: 10px;
329+
padding-top: 15px;
330+
}
331+
332+
@media (max-height: 628px) {
333+
flex-direction: row;
334+
gap: 6px;
335+
${theme.fonts.body12};
336+
}
275337
`;
276338

277339
const PaginationWrapper = styled.div`
278340
display: flex;
279341
width: 100%;
280-
padding: 30px 4px;
342+
padding: 25px 4px;
281343
padding-bottom: 20px;
282344
align-items: center;
283345
justify-content: center;
284346
flex-direction: row;
285347
${(props) => props.theme.fonts.body07};
286348
color: ${(props) => props.theme.colors.gray500};
287349
gap: 24px;
350+
351+
@media (max-height: 730px) {
352+
padding: 20px 4px;
353+
}
354+
355+
@media (max-height: 628px) {
356+
padding: 10px 4px;
357+
}
288358
`;
289359

290360
const Page = styled.div`
@@ -310,9 +380,3 @@ const CurrentPage = styled.div`
310380
const WhiteSpace = styled.div`
311381
height: 44px;
312382
`;
313-
314-
const Wrapper = styled.div`
315-
display: flex;
316-
width: 100%;
317-
padding: 24px;
318-
`;

0 commit comments

Comments
 (0)