Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Header 변경, 페이지 height 변경, navigate 연결 #205

Merged
merged 5 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions src/components/views/Header/Header.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,15 @@
font-weight: 700;
}

.top_header_page div {
/* .top_header_page div {
width: 4rem;
}

.header-link {
margin-top: 1rem;
margin-left: 2rem;
}
} */

.header_back {
width: 0.8125rem;
height: 1.5625rem;
/* margin-left: 1.56rem; */
margin-top: auto;
margin-bottom: auto;
}

.close-link {
width: 1.51144rem;
height: 1.54225rem;
margin-top: auto;
margin-bottom: auto;
margin-right: auto;
margin-left: 1.56rem;
}

.home-link {
Expand Down
73 changes: 28 additions & 45 deletions src/components/views/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,58 +47,41 @@ const Header = ({ headerProps }) => {
{/* headerProps가 주어진 경우 */}
{headerProps ? (
<header className="top_header_page">
{/* isClosed가 false인 경우 */}
{!headerProps.isClose ? (
<img
src={IMAGES.headerBack}
alt="back"
className="header_back"
// onClick={() => handleGoBack()}
onClick={() => navigate(headerProps.linkTo, { replace: true })}
/>
) : (
// isClosed가 true인 경우면 빈 div
<div></div>
)}
{/* 페이지 이름 표시 */}
<img
src={IMAGES.headerBack}
alt="back"
className="header_back"
// onClick={() => handleGoBack()}
onClick={() => navigate(headerProps.linkTo, { replace: true })}
/>
<span>{headerProps.pageName}</span>
{/* isClosed가 true인 경우 */}
{headerProps.isClose ? (
<img
src={IMAGES.headerClose}
alt="close"
className="close-link"
onClick={() => navigate(headerProps.linkTo, { replace: true })}
/>
) : (
<div className="homeAndCart">
{/* 현재 페이지가 홈이 아니고 장바구니 페이지가 아닌 경우에만 장바구니 아이콘 표시 */}
{!isCartPage ? (
<div>
<img
src={IMAGES.headerCart}
alt="cart"
className="header_cart"
onClick={() => navigate(`/cart`, { replace: true })}
/>
<div className="homeAndCart">
{/* 현재 페이지가 홈이 아니고 장바구니 페이지가 아닌 경우에만 장바구니 아이콘 표시 */}
{!isCartPage ? (
<div>
<img
src={IMAGES.headerCart}
alt="cart"
className="header_cart"
onClick={() => navigate(`/cart`, { replace: true })}
/>

<img
src={IMAGES.headerHome}
alt="home"
className="header_home1"
onClick={() => navigate(`/`, { replace: true })}
/>
</div>
) : (
<img
src={IMAGES.headerHome}
alt="home"
className="header_home2"
className="header_home1"
onClick={() => navigate(`/`, { replace: true })}
/>
)}
</div>
)}
</div>
) : (
<img
src={IMAGES.headerHome}
alt="home"
className="header_home2"
onClick={() => navigate(`/`, { replace: true })}
/>
)}
</div>
</header>
) : (
// headerProps가 주어지지 않은 경우
Expand Down
4 changes: 1 addition & 3 deletions src/components/views/PageComponent/OrderStorage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ function OrderStorage() {

return (
<section className="order_storage">
<Header
headerProps={{ pageName: "주문내역", isClose: false, linkTo: "/" }}
/>
<Header headerProps={{ pageName: "주문내역", linkTo: "/" }} />

<main className="order_storage__container">
{newStorageList?.length || oldStorageList?.length ? (
Expand Down
1 change: 0 additions & 1 deletion src/pages/CartPage/CartPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ const CartPage = () => {
<Header
headerProps={{
pageName: "장바구니",
isClose: false,
linkTo:
!storeId ||
isNaN(parseInt(storeId, 10)) ||
Expand Down
1 change: 0 additions & 1 deletion src/pages/MembershipPage/MembershipPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function MembershipPage() {
<Header
headerProps={{
pageName: "멤버십",
isClose: false,
linkTo: "/",
}}
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/MyPage/CouponPage/CouponPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ function CouponPage() {
<Header
headerProps={{
pageName: "할인쿠폰",
isClose: false,
linkTo: "/mypage",
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function CustomerServicePage() {
<Header
headerProps={{
pageName: "고객센터",
isClose: false,
linkTo: "/mypage",
}}
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/MyPage/EventingPage/EventingPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function EventingPage() {
<Header
headerProps={{
pageName: "진행 중인 이벤트",
isClose: false,
linkTo: "/mypage",
}}
/>
Expand Down
8 changes: 6 additions & 2 deletions src/pages/MyPage/MyPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function Mypage() {
<Header
headerProps={{
pageName: "마이페이지",
isClose: false,
linkTo: "/",
}}
/>
Expand Down Expand Up @@ -66,7 +65,12 @@ function Mypage() {
>
주문 내역
</div>
<div className="mypage_profile_category">멤버쉽 내역</div>
<div
className="mypage_profile_category"
onClick={() => navigate(isAuth ? `/membership` : `/login`)}
>
멤버쉽 내역
</div>
</div>

<div className="mypage_profile_line"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MyPage/MyprofilePage/MyprofilePage.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.myprofile {
width: 100%;
height: 92vh;
padding-top: 4.44rem;
}

Expand Down Expand Up @@ -65,4 +64,5 @@
font-weight: 500;
line-height: normal;
margin-top: 15rem;
margin-bottom: 5.25rem;
}
1 change: 0 additions & 1 deletion src/pages/MyPage/MyprofilePage/MyprofilePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function MyprofilePage() {
<Header
headerProps={{
pageName: "계정 관리",
isClose: false,
linkTo: "/mypage",
}}
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/MyPage/PolicyPage/PolicyPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function PolicyPage() {
<Header
headerProps={{
pageName: "약관 및 정책",
isClose: false,
linkTo: "/mypage",
}}
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/MyPage/PolicyPage/PositionpolicyPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function PositionpolicyPage() {
<Header
headerProps={{
pageName: "위치 기반 서비스 이용약관",
isClose: false,
linkTo: "/policy",
}}
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/MyPage/PolicyPage/PrivacypolicyPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function PrivacypolicyPage() {
<Header
headerProps={{
pageName: "개인정보 처리방침",
isClose: false,
linkTo: "/policy",
}}
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/MyPage/PolicyPage/TermsofusePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function TermsofusePage() {
<Header
headerProps={{
pageName: "서비스 이용약관",
isClose: false,
linkTo: "/policy",
}}
/>
Expand Down
38 changes: 22 additions & 16 deletions src/pages/MyPage/PolicyPage/ThirdpartyPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,32 @@ function ThirdpartyPage() {
<Header
headerProps={{
pageName: "개인정보 제3자 제공 동의",
isClose: false,
linkTo: "/policy",
}}
/>
<div style={{ fontSize: "12px", "fontFamily": "Regular" }}>
{TEXT.thirdPartyTitle.split("\n").map((title, index) => (
<React.Fragment key={index}>
<span style={{'fontSize' : '14px', 'fontFamily': "Bold", 'marginTop' : '5px'}}>{title}</span>
<br />
{/* Check if there's a corresponding line in privacyPolicy */}
{TEXT.thirdParty.split("#")[index] && (
<div style={{'marginTop': '10px', 'marginBottom': '10px'}}>
<span style={{'fontSize': '12px', 'fontFamily': "Regular"}}>
{TEXT.thirdParty.split("#")[index].split("\n").map((e) => (
<div>{e}</div>
))}
<div style={{ fontSize: "12px", fontFamily: "Regular" }}>
{TEXT.thirdPartyTitle.split("\n").map((title, index) => (
<React.Fragment key={index}>
<span
style={{ fontSize: "14px", fontFamily: "Bold", marginTop: "5px" }}
>
{title}
</span>
</div>
)}
</React.Fragment>
<br />
{/* Check if there's a corresponding line in privacyPolicy */}
{TEXT.thirdParty.split("#")[index] && (
<div style={{ marginTop: "10px", marginBottom: "10px" }}>
<span style={{ fontSize: "12px", fontFamily: "Regular" }}>
{TEXT.thirdParty
.split("#")
[index].split("\n")
.map((e) => (
<div>{e}</div>
))}
</span>
</div>
)}
</React.Fragment>
))}
</div>
</div>
Expand Down
Loading
Loading