Skip to content

Commit b0ff562

Browse files
committed
feat: Navigation bar 사이즈 고정, RoundBtnV2 사용
1 parent bbae3e7 commit b0ff562

File tree

2 files changed

+29
-69
lines changed

2 files changed

+29
-69
lines changed

src/pages/MainNav.jsx

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useContext, useState } from "react";
22
import { Link, useLocation, useNavigate } from "react-router-dom";
33

44
import ImageBtn from "@/components/button/ImageBtn";
5+
import RoundBtnV2 from "@/components/button/round_btn/RoundBtnV2";
56
import SideMenuDialog from "@/components/navBar/SideMenuDialog";
67

78
import AuthContext from "../contexts/AuthContext";
@@ -30,9 +31,7 @@ function MainNav() {
3031

3132
return (
3233
<>
33-
{openDialog && (
34-
<SideMenuDialog open={openDialog} onClose={onCloseDialog} />
35-
)}
34+
{openDialog && <SideMenuDialog open={openDialog} onClose={onCloseDialog} />}
3635
<nav className="navbar">
3736
<ImageBtn
3837
className="hamburger-btn"
@@ -49,23 +48,14 @@ function MainNav() {
4948
navigateWithRefresh(event, "/");
5049
}}
5150
>
52-
<img
53-
className="icon"
54-
src={navLogo}
55-
alt="logo"
56-
style={{ height: "2.786vh" }}
57-
/>
58-
<img
59-
src={navTitle}
60-
alt="포도상점"
61-
style={{ height: "2.593vh" }}
62-
></img>
51+
<img className="icon h-[30.086px]" src={navLogo} alt="logo" />
52+
<img src={navTitle} alt="포도상점" className="h-[28px]"></img>
6353
</Link>
6454
<ul className="navbar_menu">
6555
<li>
6656
<Link
6757
to="/list"
68-
className="li"
58+
className="h5-regular"
6959
onClick={(event) => {
7060
navigateWithRefresh(event, "/list");
7161
}}
@@ -81,7 +71,7 @@ function MainNav() {
8171
<li>
8272
<Link
8373
to="/post"
84-
className="li"
74+
className="h5-regular"
8575
onClick={(event) => {
8676
navigateWithRefresh(event, "/post");
8777
}}
@@ -100,35 +90,36 @@ function MainNav() {
10090
</ul>
10191
{!isAuthenticated ? (
10292
<div className="navbar_login">
103-
<button
93+
<RoundBtnV2
10494
onClick={() => {
10595
navigate("/signin", { state: { from: location } });
10696
}}
107-
className="signin_btn"
97+
className="signin_btn p-large-regular w-[150px] h-[44px] rounded-[30px]"
98+
color="white"
10899
>
109100
로그인
110-
</button>
101+
</RoundBtnV2>
111102
</div>
112103
) : (
113104
<div className="navbar_login">
114105
{/*<img src={cart} alt="cart" />*/}
115-
<img
116-
src={person}
117-
alt="myPage"
106+
<button
118107
onClick={(event) => {
119108
navigateWithRefresh(event, "/mypage/purchased");
120109
}}
121-
/>
122-
<button
110+
>
111+
<img src={person} alt="myPage" className="my-page-button" />
112+
</button>
113+
<RoundBtnV2
123114
onClick={() => {
124-
// context 호출
125115
logout();
126116
navigate("/");
127117
}}
128-
className="signin_btn"
118+
className="signin_btn p-large-regular w-[150px] h-[44px] rounded-[30px]"
119+
color="white"
129120
>
130121
로그아웃
131-
</button>
122+
</RoundBtnV2>
132123
</div>
133124
)}
134125
</nav>

src/pages/MainNav.scss

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77
align-items: center;
88

99
padding-left: 88px;
10-
@include r.media-tablet {
11-
padding-left: 44px;
12-
}
13-
& {
14-
padding-right: 44px;
10+
padding-right: 44px;
1511

16-
height: 6.481vh; /* 70px */
17-
background-color: #ffffff;
12+
height: 70px;
13+
background-color: #ffffff;
1814

19-
border-bottom: 1px solid var(--Main, #6a39c0);
15+
border-bottom: 1px solid var(--Main, #6a39c0);
16+
17+
@include r.media-tablet {
18+
padding-left: 44px;
2019
}
2120
}
2221

@@ -75,60 +74,30 @@
7574
padding: 8px 30px;
7675
}
7776

78-
.navbar .navbar_menu .li {
79-
color: #000;
80-
81-
/* H5/Regular */
82-
font-family: "Noto Sans KR";
83-
font-size: 1.852vh;
84-
font-style: normal;
85-
font-weight: 400;
86-
line-height: 2.593vh; /* 140% */
87-
}
88-
8977
.navbar .navbar_login {
9078
display: flex;
9179
align-items: center;
9280

9381
position: relative;
9482
}
9583

96-
.navbar .navbar_login img {
84+
.navbar .navbar_login .my-page-button {
9785
position: absolute;
9886
left: -45px;
9987

100-
width: 2.407vh;
101-
height: 2.593vh;
88+
width: 26px;
89+
height: 28px;
10290

10391
cursor: pointer;
10492

105-
transform: translateX(-100%);
93+
transform: translate(-50%, -50%);
10694
@include r.media-mobile {
10795
position: static;
10896
transform: none;
10997
}
11098
}
11199

112100
.navbar .signin_btn {
113-
@include m.white-btn;
114-
115-
border-radius: 30px;
116-
border: 2.5px solid var(--Main, #6a39c0);
117-
width: 13.889vh;
118-
height: 4.074vh;
119-
background-color: #fdfaff;
120-
121-
cursor: pointer;
122-
123-
color: var(--Main, #6a39c0);
124-
125-
/* Paragraph/Large/Regular */
126-
font-family: "Noto Sans KR";
127-
font-size: 1.667vh;
128-
font-style: normal;
129-
font-weight: 500;
130-
line-height: 2.593vh; /* 155.556% */
131-
132101
@include r.media-tablet {
133102
display: none;
134103
}

0 commit comments

Comments
 (0)