Skip to content

Commit 6259f83

Browse files
committed
버튼 적용(리스트페이지완료)
1 parent 8bb74ce commit 6259f83

File tree

3 files changed

+56
-31
lines changed

3 files changed

+56
-31
lines changed

src/components/domain/rollingpaper/Card/CreateAtCardList.jsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ const BoneWrap = styled.div`
99
width: 1160px;
1010
position: relative;
1111
overflow: visible;
12+
height: 260px;
1213
@media (max-width: 1199px) {
13-
width: 100% ;
14+
width: 100%;
1415
}
16+
@media (max-width: 767px) {
17+
height: 232px;
18+
}
1519
`;
1620

1721
const BoneContainer = styled.div`
@@ -71,7 +75,7 @@ const BackgroundWrap = styled.div.withConfig({
7175
transform: scale(0.98);
7276
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.3);
7377
}
74-
@media (max-width: 359px) {
78+
@media (max-width: 767px) {
7579
width: 208px;
7680
height: 232px;
7781
}
@@ -86,7 +90,7 @@ const ToText = styled.div`
8690
${(props) => textStyle(24, 700)(props)}
8791
margin-bottom: 0.75rem;
8892
height: 2.625rem;
89-
@media (max-width: 359px) {
93+
@media (max-width: 767px) {
9094
${(props) => textStyle(18, 700)(props)}
9195
}
9296
`;
@@ -136,18 +140,17 @@ const WriteCountDisplay = styled.div`
136140

137141
const WritedText = styled.div`
138142
font-size: 14px;
139-
@media (max-width: 359px) {
143+
@media (max-width: 767px) {
140144
${(props) => textStyle(14, 700)(props)}
141145
}
142146
`;
143147

144148
const ArrowButtonDisplay = styled.div`
145-
align-items: center;
146-
147-
transform: translateY(40%);
148-
z-index: 2;
149-
transform: matrix(1, 0, 0, 1, 0, 108);
150-
transition: opacity 0.3s ease;
149+
align-items: center;
150+
transform: translateY(40%);
151+
z-index: 2;
152+
transform: matrix(1, 0, 0, 1, 0, 108);
153+
transition: opacity 0.3s ease;
151154
}
152155
`;
153156
const LeftArrowButtonDisplay = styled(ArrowButtonDisplay)`
@@ -179,7 +182,6 @@ const TopEmojisContainer = styled.div`
179182
gap: 8px;
180183
@media (max-width: 767px) {
181184
padding: 0 4px;
182-
183185
}
184186
`;
185187

src/components/domain/rollingpaper/Card/PopularCardList.jsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ const BoneWrap = styled.div`
99
width: 1160px;
1010
position: relative;
1111
overflow: visible;
12+
height: 260px;
13+
margin-bottom: 50px;
1214
@media (max-width: 1199px) {
1315
width: 100% ;
16+
1417
}
15-
@media (max-width: 359px) {
16-
padding-bottom: 50px;
17-
}
18+
@media (max-width: 767px) {
19+
height: 232px;
20+
margin-bottom: 74px;
21+
}
1822
`;
1923

2024
const BoneContainer = styled.div`
@@ -74,7 +78,7 @@ const BackgroundWrap = styled.div.withConfig({
7478
transform: scale(0.98);
7579
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.3);
7680
}
77-
@media (max-width: 359px) {
81+
@media (max-width: 767px) {
7882
width: 208px;
7983
height: 232px;
8084
}
@@ -89,7 +93,7 @@ const ToText = styled.div`
8993
${(props) => textStyle(24, 700)(props)}
9094
margin-bottom: 0.75rem;
9195
height: 2.625rem;
92-
@media (max-width: 359px) {
96+
@media (max-width: 767px) {
9397
${(props) => textStyle(18, 700)(props)}
9498
}
9599
`;
@@ -139,18 +143,17 @@ const WriteCountDisplay = styled.div`
139143

140144
const WritedText = styled.div`
141145
font-size: 14px;
142-
@media (max-width: 359px) {
146+
@media (max-width: 767px) {
143147
${(props) => textStyle(14, 700)(props)}
144148
}
145149
`;
146150

147151
const ArrowButtonDisplay = styled.div`
148-
align-items: center;
149-
150-
transform: translateY(40%);
151-
z-index: 2;
152-
transform: matrix(1, 0, 0, 1, 0, 108);
153-
transition: opacity 0.3s ease;
152+
align-items: center;
153+
transform: translateY(40%);
154+
z-index: 2;
155+
transform: matrix(1, 0, 0, 1, 0, 108);
156+
transition: opacity 0.3s ease;
154157
}
155158
`;
156159
const LeftArrowButtonDisplay = styled(ArrowButtonDisplay)`
@@ -182,7 +185,6 @@ const TopEmojisContainer = styled.div`
182185
gap: 8px;
183186
@media (max-width: 767px) {
184187
padding: 0 4px;
185-
186188
}
187189
`;
188190

src/pages/RollingPaperList/RollingPaperListPage.jsx

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import styled from "styled-components";
44
import PopularCardList from "../../components/domain/rollingpaper/Card/PopularCardList";
55
import Button from "../../components/common/Button/Button";
66
import { textStyle } from "../../styles/textStyle";
7+
import { useEffect, useState, useCallback } from "react";
8+
79
const Container = styled.div`
810
background-color: #ffffff;
911
`;
@@ -21,7 +23,7 @@ const PageWrapper = styled.div`
2123
margin: 0;
2224
width: 100%;
2325
}
24-
@media (max-width: 359px) {
26+
@media (max-width: 767px) {
2527
padding-top: 40px;
2628
}
2729
@@ -32,15 +34,21 @@ const Title = styled.div`
3234
display: flex;
3335
width: -webkit-fill-available;
3436
justify-content: left;
35-
@media (max-width: 366px) {
37+
@media (max-width: 767px) {
3638
${(props) => textStyle(20, 600)(props)}
3739
}
3840
`;
3941

4042
const ButtonWrapper = styled.div`
41-
margin-top: 156px;
43+
margin-top: 64px;
4244
display: flex;
4345
justify-content: center;
46+
@media (max-width: 1199px) {
47+
margin-top: 156px;
48+
}
49+
@media (max-width: 767px) {
50+
margin-top: 66px;
51+
}
4452
`;
4553

4654
const StyledCardList = styled.div`
@@ -55,10 +63,23 @@ const StyledCardList = styled.div`
5563
}
5664
5765
`;
66+
const StyledButton = styled(Button)`
67+
width: ${({ isTablet }) => (isTablet ? "calc(100% - 24px)" : "280px")};
68+
`;
5869

5970
function RollingPaperListPage() {
6071
const navigate = useNavigate();
61-
72+
const [isTablet, setIsTablet] = useState(window.innerWidth <= 1199);
73+
const handleResize = useCallback(() => {
74+
setIsTablet(window.innerWidth <= 1199);
75+
}, []);
76+
useEffect(() => {
77+
handleResize();
78+
window.addEventListener("resize", handleResize);
79+
return () => {
80+
window.removeEventListener("resize", handleResize);
81+
};
82+
}, [handleResize]);
6283
return (
6384
<Container>
6485

@@ -72,14 +93,14 @@ function RollingPaperListPage() {
7293
</StyledCardList>
7394
<CreateAtCardList />
7495
<ButtonWrapper>
75-
<Button
96+
<StyledButton
7697
variant="primary"
7798
size="56"
78-
width="280"
99+
width={isTablet ? "calc(100% - 24px)" : 280}
79100
onClick={() => navigate(`/post`)}
80101
>
81102
나도 만들어보기
82-
</Button>
103+
</StyledButton>
83104
</ButtonWrapper>
84105
</PageWrapper>
85106
</Container>

0 commit comments

Comments
 (0)