Skip to content

Commit 7bb75f7

Browse files
Navbar 로고와 Informationbar 반응형 수정
1 parent ee86209 commit 7bb75f7

4 files changed

Lines changed: 115 additions & 28 deletions

File tree

src/components/common/Emoji/Emoji.jsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ function Emoji({ topReactions = [], setRecipientData }) {
8686
<ArrowDown alt="더 보기" />
8787
</ShowMoreButton>
8888
)}
89-
<Button onClick={() => setShowPicker(!showPicker)} variant="outlined" image="add">추가</Button>
89+
90+
<StyledIcon>
91+
<StyledButton onClick={() => setShowPicker(!showPicker)} variant="outlined" image="add">
92+
<StyledText>추가</StyledText>
93+
</StyledButton>
94+
</StyledIcon>
9095
</ActionsContainer>
9196
</Header>
9297

@@ -114,6 +119,26 @@ function Emoji({ topReactions = [], setRecipientData }) {
114119

115120
export default Emoji;
116121

122+
const StyledIcon = styled.div`
123+
display: inline-block;
124+
`;
125+
126+
const StyledButton = styled(Button)`
127+
width: 88px;
128+
height: 36px;
129+
130+
@media (max-width: 768px) {
131+
width: 36px;
132+
height: 32px;
133+
}
134+
`;
135+
136+
const StyledText = styled.div`
137+
@media (max-width: 768px) {
138+
display: none;
139+
}
140+
`;
141+
117142
const ServiceContainer = styled.div`
118143
top: 6px;
119144
display: flex;
@@ -150,6 +175,7 @@ const TopEmojiItem = styled.div`
150175
gap: 2px;
151176
font-size: 20px;
152177
text-align: center;
178+
153179
`;
154180

155181
const EmojiImage = styled.span`

src/components/common/InformationBar/InformationBar.jsx

Lines changed: 68 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ function InformationBar({
1919
const [showToast, setShowToast] = useState(false);
2020
const buttonRef = useRef(null);
2121

22-
// ✅ 카카오 SDK 초기화 (한 번만 실행)
22+
2323
useEffect(() => {
2424
if (window.Kakao && !window.Kakao.isInitialized()) {
2525
window.Kakao.init("0e75199aafea8afc76aa6dd724c8f4bd"); // 🔥 여기에 JavaScript 키 입력
26-
console.log("Kakao SDK Initialized");
26+
console.log("Kakao SDK Initialized");
2727
}
2828
}, []);
2929

@@ -109,7 +109,7 @@ function InformationBar({
109109
</WritedContainer>
110110

111111
<SeparatorContainer>
112-
<Separator />
112+
<LeftSeparator />
113113
</SeparatorContainer>
114114

115115
<Emoji
@@ -120,7 +120,10 @@ function InformationBar({
120120
setRecipientData={setRecipientData}
121121
/>
122122
<Separator />
123-
<IconButton ref={buttonRef} onClick={toggleModal} image="share" width="56" />
123+
124+
<IconButton ref={buttonRef} onClick={toggleModal}
125+
image="share" width="56" height="40"/>
126+
124127
{isModalOpen && (
125128
<Modal ref={modalRef}>
126129
<Option onClick={shareToKakao}> 카카오톡 공유</Option>
@@ -148,12 +151,28 @@ function InformationBar({
148151
);
149152
}
150153

154+
155+
const LeftSeparator = styled.span`
156+
display: inline-block;
157+
width: 1px;
158+
height: 30px;
159+
background-color: ${({ theme }) => theme.colors.grayScale[300]};
160+
margin: 0 13px;
161+
162+
@media (max-width: 1199px) {
163+
display: none;
164+
}
165+
`;
151166
const Separator = styled.span`
152167
display: inline-block;
153168
width: 1px;
154-
height: 28px;
169+
height: 30px;
155170
background-color: ${({ theme }) => theme.colors.grayScale[300]};
156171
margin: 0 13px;
172+
173+
@media (max-width: 768px) {
174+
margin: 0 0px;
175+
}
157176
`;
158177

159178
const SeparatorContainer = styled.div`
@@ -184,21 +203,37 @@ const InformationBarContainer = styled.div`
184203
padding: 13px 24px;
185204
}
186205
@media (max-width: 767px) {
187-
206+
flex-direction: column;
207+
align-items: center;
208+
height: auto;
209+
padding: 10px;
188210
}
189211
`;
190212

191213
const LeftSection = styled.div`
192214
flex: 1;
193215
display: flex;
194216
justify-content: flex-start;
217+
218+
@media (max-width: 767px) {
219+
width: 100%;
220+
justify-content: center;
221+
margin-bottom: 10px;
222+
}
195223
`;
196224

197225
const RightSection = styled.div`
198226
display: flex;
199227
justify-content: flex-end;
200228
align-items: center;
201229
gap: 10px;
230+
margin-top: 10px;
231+
232+
@media (max-width: 767px) {
233+
margin-top:-8px;
234+
justify-content: center;
235+
gap: 20px;
236+
}
202237
`;
203238

204239
const ToName = styled.div`
@@ -208,12 +243,25 @@ const ToName = styled.div`
208243
line-height: 42px;
209244
letter-spacing: -0.01em;
210245
color: ${({ theme }) => theme.colors.grayScale[800]};
246+
margin-right: 10px;
211247
248+
@media (max-width: 767px) {
249+
left: 22px;
250+
font-size: 24px;
251+
margin-right: 0;
252+
margin-bottom: 10px;
253+
top:10px;
254+
position: absolute;
255+
}
212256
`;
213257

214258
const WritedContainer = styled.div`
215259
display: inline-flex;
216260
align-items: center;
261+
262+
@media (max-width: 767px) {
263+
display: none;
264+
}
217265
`;
218266

219267
const WriteCount = styled.span`
@@ -223,8 +271,9 @@ const WriteCount = styled.span`
223271
font-size: 18px;
224272
letter-spacing: 0%;
225273
line-height: 27px;
226-
@media (max-width: 1199px) {
227-
display: none;
274+
275+
@media (max-width: 767px) {
276+
display: none;
228277
}
229278
`;
230279

@@ -236,8 +285,8 @@ const WritedText = styled.span`
236285
line-height: 27px;
237286
letter-spacing: 0%;
238287
239-
@media (max-width: 1199px) {
240-
display: none;
288+
@media (max-width: 767px) {
289+
display: none;
241290
}
242291
`;
243292

@@ -269,8 +318,8 @@ const Avatar = styled.div`
269318
color: ${({ theme }) => theme.colors.grayScale[800]};
270319
}
271320
272-
@media (max-width: 1199px) {
273-
display: none;
321+
@media (max-width: 767px) {
322+
display: none;
274323
}
275324
`;
276325

@@ -296,6 +345,12 @@ const Modal = styled.div`
296345
transform: scale(1);
297346
}
298347
}
348+
349+
@media (max-width: 767px) {
350+
top: 100px;
351+
width: 120px;
352+
height: 100px;
353+
}
299354
`;
300355

301356
const Option = styled.div`
@@ -332,6 +387,7 @@ const Toast = styled.div`
332387
height: 64px;
333388
}
334389
`;
390+
335391
const ToastMessage = styled.span`
336392
font-family: "Pretendard", sans-serif;
337393
font-weight: 400;
@@ -348,7 +404,6 @@ const IconTextWrapper = styled.div`
348404
align-items: center;
349405
`;
350406

351-
352407
const IconWrapper = styled.div`
353408
width: 24px;
354409
height: 24px;

src/components/common/Navbar/Navbar.jsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Link, useLocation } from "react-router-dom";
22
import Button from "../Button/Button";
3-
43
import { LogoImg } from "../../../assets/images/icon/IconIndex";
54
import styled from "styled-components";
65

@@ -20,26 +19,35 @@ const NavbarContainer = styled.nav`
2019
max-width: 1207px;
2120
height: 64px;
2221
padding: 11px 24px;
23-
24-
2522
`;
23+
2624
const StyledLogo = styled(LogoImg)`
27-
display: flex;
2825
width: 106px;
2926
cursor: pointer;
27+
28+
29+
@media (min-width: 1200px) {
30+
display: flex;
31+
}
32+
3033
31-
34+
@media (max-width: 767px) {
35+
display: ${({ showLogo }) => (showLogo ? 'flex' : 'none')};
36+
}
3237
`;
3338

3439
function Navbar() {
3540
const location = useLocation();
41+
42+
const showLogo = location.pathname === '/list' || location.pathname === '/';
43+
3644
const isPostPage = location.pathname.startsWith("/post");
3745

3846
return (
3947
<NavbarWrapper>
4048
<NavbarContainer>
4149
<Link to="/">
42-
<StyledLogo alt="Rolling Logo" />
50+
<StyledLogo alt="Rolling Logo" showLogo={showLogo} />
4351
</Link>
4452
{!isPostPage && (
4553
<Link to="/post">
@@ -53,4 +61,4 @@ function Navbar() {
5361
);
5462
}
5563

56-
export default Navbar;
64+
export default Navbar;

src/pages/RollingPaperList/RollingPaperListPage.jsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import styled from "styled-components";
44
import PopularCardList from "../../components/domain/rollingpaper/Card/PopularCardList";
55
import Button from "../../components/common/Button/Button";
66

7-
// Container 스타일 수정
87
const Container = styled.div`
98
background-color: #ffffff;
109
width: 100%;
@@ -19,7 +18,6 @@ const Container = styled.div`
1918
}
2019
`;
2120

22-
// PageWrapper 스타일 수정
2321
const PageWrapper = styled.div`
2422
padding: 40px;
2523
display: flex;
@@ -39,7 +37,7 @@ const PageWrapper = styled.div`
3937
}
4038
`;
4139

42-
// Title 스타일 수정 (텍스트와 카드 리스트가 같이 고정되도록 sticky 적용)
40+
4341
const TitleWrapper = styled.div`
4442
width: 100%;
4543
position: sticky;
@@ -71,7 +69,7 @@ const TitleText = styled.div`
7169
}
7270
`;
7371

74-
// ButtonWrapper 스타일 수정
72+
7573
const ButtonWrapper = styled.div`
7674
margin-top: 20px;
7775
display: flex;
@@ -86,14 +84,14 @@ const ButtonWrapper = styled.div`
8684
}
8785
`;
8886

89-
// StyledCardList 수정 (카드 리스트가 오른쪽에서 사라지도록 설정)
87+
9088
const StyledCardList = styled.div`
9189
display: flex;
9290
gap: 20px;
9391
margin-bottom: 50px;
9492
width: 100%;
95-
flex-direction: row-reverse; /* 카드 리스트가 오른쪽에서 왼쪽으로 정렬되도록 설정 */
96-
overflow: hidden; /* 왼쪽에서 안 보이도록 처리 */
93+
flex-direction: row-reverse;
94+
overflow: hidden;
9795
9896
@media (max-width: 1199px) {
9997
gap: 15px;

0 commit comments

Comments
 (0)