-
Notifications
You must be signed in to change notification settings - Fork 0
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
[client] cart페이지 반응형 구현 #30
Open
pki071120
wants to merge
7
commits into
develop
Choose a base branch
from
feature/applyResponsiveCartPage
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3732b09
Update CheckProductComponents
pki071120 edd3fc9
Update CartLayout
pki071120 7065c3b
Update index.ts
pki071120 abf2b5e
Add mobileCartLayout
pki071120 67f5ea9
Add PCLayout
pki071120 bdba414
Delete style.ts
pki071120 ca22744
Update CartMobileLayout
pki071120 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,11 @@ | ||
'use client'; | ||
|
||
import * as S from './style'; | ||
|
||
import { PCHeader } from 'shared'; | ||
import { SelectShoppingCart, PaymentInfo } from 'client/components'; | ||
|
||
import { useGetCartInfo } from 'shared/hooks'; | ||
import { useGetLayoutByWidth } from 'client/hooks'; | ||
import { CartMobileLayout } from 'client/mobileLayout'; | ||
import { CartPCLayout } from 'client/pcLayout'; | ||
|
||
const CartLayout = () => { | ||
const { data: data } = useGetCartInfo(); | ||
|
||
const MokProduct = | ||
data?.map((item) => { | ||
return { | ||
productImg: item.product.images[0].url, | ||
productName: item.product.name, | ||
productColor: item.option.name, | ||
productPrice: item.product.price, | ||
productPercent: item.product.discount * 100, | ||
isSale: item.option.status === 'on_sale', | ||
}; | ||
}) || []; | ||
|
||
return ( | ||
<> | ||
<PCHeader type={'client_clear'} /> | ||
<S.Wrapper> | ||
<S.Container> | ||
<S.LeftBox> | ||
<SelectShoppingCart products={MokProduct} /> | ||
</S.LeftBox> | ||
<S.RightBox> | ||
<PaymentInfo | ||
productPrice={''} | ||
discountPrice={''} | ||
deliveryPrice={''} | ||
requiredPrice={''} | ||
isFreeDelivery={false} | ||
/> | ||
<S.TextBox> | ||
<S.InfoText> | ||
[주문완료] 상태일 경우에만 주문 취소 가능해요. | ||
</S.InfoText> | ||
<S.InfoText> | ||
[마이페이지 {'>'} 주문내역]에서 취소하실 수 있어요.{' '} | ||
</S.InfoText> | ||
</S.TextBox> | ||
</S.RightBox> | ||
</S.Container> | ||
</S.Wrapper> | ||
</> | ||
); | ||
return useGetLayoutByWidth(<CartPCLayout />, <CartMobileLayout />); | ||
}; | ||
|
||
export default CartLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
'use client'; | ||
|
||
import * as S from './style'; | ||
|
||
import { MobileHeader } from 'shared'; | ||
import { SelectShoppingCart, PaymentInfo } from 'client/components'; | ||
|
||
import { useGetCartInfo } from 'shared/hooks'; | ||
|
||
const CartMobileLayout = () => { | ||
const { data: data } = useGetCartInfo(); | ||
|
||
const MokProduct = | ||
data?.map((item) => { | ||
return { | ||
productImg: item.product.images[0].url, | ||
productName: item.product.name, | ||
productColor: item.option.name, | ||
productPrice: item.product.price, | ||
productPercent: item.product.discount * 100, | ||
isSale: item.option.status === 'on_sale', | ||
}; | ||
}) || []; | ||
|
||
return ( | ||
<> | ||
<MobileHeader logo={'장바구니'} /> | ||
<S.Wrapper> | ||
<S.Container length={MokProduct.length}> | ||
<S.TopBox> | ||
<SelectShoppingCart products={MokProduct} /> | ||
</S.TopBox> | ||
<S.BottomBox> | ||
<PaymentInfo | ||
productPrice={''} | ||
discountPrice={''} | ||
deliveryPrice={''} | ||
requiredPrice={''} | ||
isFreeDelivery={false} | ||
/> | ||
<S.TextBox> | ||
<S.InfoText isTitle> | ||
주문 내용을 확인했으며 서비스 약관 및 결제에 동의합니다. | ||
</S.InfoText> | ||
<S.InfoText>[필수] 정자결제대행 이용 동의</S.InfoText> | ||
<S.InfoText>[필수] 개인정보 제 3자 제공 동의</S.InfoText> | ||
<S.InfoText> | ||
[필수] 만 14세 이상 이용자, 개인정보 수집 및 이용 동의 | ||
</S.InfoText> | ||
<S.InfoText isTitle> | ||
[마이페이지 {'>'} 주문내역]에서 취소하실 수 있어요.{' '} | ||
</S.InfoText> | ||
<S.InfoText> | ||
낮은 확률로 상품이 품절일 가능성이 있어요, 이에 품절 시 빠르게 | ||
환불 처리를 도와드려요. | ||
<br /> 결제하신 수단으로 취소 돼요. | ||
<br /> 환불 받으신 날짜 기준으로 3~5일(주말 제외) 후 환불 처리 | ||
돼요. | ||
<br /> 무통장 입금 환불의 경우, 예금정보가 일치해야 환불 처리가 | ||
가능하니 은행명, 예금주명을 정확히 기재 부탁드려요. | ||
</S.InfoText> | ||
</S.TextBox> | ||
</S.BottomBox> | ||
</S.Container> | ||
</S.Wrapper> | ||
</> | ||
); | ||
}; | ||
|
||
export default CartMobileLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const Wrapper = styled.div` | ||
width: 100%; | ||
height: auto; | ||
display: flex; | ||
background-color: ${({ theme }) => theme.color.background}; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
export const Container = styled.div<{ length: number }>` | ||
width: 90vw; | ||
height: ${({ length }) => (length === 0 ? '100vh' : '100%')}; | ||
display: flex; | ||
margin: 4.0625rem 0; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: space-between; | ||
`; | ||
|
||
export const TopBox = styled.div` | ||
width: 100%; | ||
`; | ||
|
||
export const BottomBox = styled.div` | ||
width: 100%; | ||
height: 80%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 1.25rem; | ||
margin-top: 3.5rem; | ||
`; | ||
|
||
export const TextBox = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 0.25rem; | ||
`; | ||
|
||
export const InfoText = styled.span<{ isTitle?: boolean }>` | ||
${({ theme }) => theme.typo.label}; | ||
color: ${({ theme, isTitle }) => | ||
isTitle ? theme.color.grey[600] : theme.color.grey[500]}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as LoginMobileLayout } from './login'; | ||
export { default as ProductListMobileLayout } from './productList'; | ||
export { default as CartMobileLayout } from './cart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
'use client'; | ||
|
||
import * as S from './style'; | ||
|
||
import { PCHeader } from 'shared'; | ||
import { SelectShoppingCart, PaymentInfo } from 'client/components'; | ||
|
||
import { useGetCartInfo } from 'shared/hooks'; | ||
|
||
const CartPCLayout = () => { | ||
const { data: data } = useGetCartInfo(); | ||
|
||
const MokProduct = | ||
data?.map((item) => { | ||
return { | ||
productImg: item.product.images[0].url, | ||
productName: item.product.name, | ||
productColor: item.option.name, | ||
productPrice: item.product.price, | ||
productPercent: item.product.discount * 100, | ||
isSale: item.option.status === 'on_sale', | ||
}; | ||
}) || []; | ||
|
||
return ( | ||
<> | ||
<PCHeader type={'client_clear'} /> | ||
<S.Wrapper> | ||
<S.Container> | ||
<S.LeftBox> | ||
<SelectShoppingCart products={MokProduct} /> | ||
</S.LeftBox> | ||
<S.RightBox> | ||
<PaymentInfo | ||
productPrice={''} | ||
discountPrice={''} | ||
deliveryPrice={''} | ||
requiredPrice={''} | ||
isFreeDelivery={false} | ||
/> | ||
<S.TextBox> | ||
<S.InfoText> | ||
[주문완료] 상태일 경우에만 주문 취소 가능해요. | ||
</S.InfoText> | ||
<S.InfoText> | ||
[마이페이지 {'>'} 주문내역]에서 취소하실 수 있어요.{' '} | ||
</S.InfoText> | ||
</S.TextBox> | ||
</S.RightBox> | ||
</S.Container> | ||
</S.Wrapper> | ||
</> | ||
); | ||
}; | ||
|
||
export default CartPCLayout; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as LoginPCLayout } from './login'; | ||
export { default as ProductListPCLayout } from './productList'; | ||
export { default as CartPCLayout } from './cart'; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 height가 80%인 것 때문에 특정 화면에서는 화면이 길게 나오는 현상이 있습니다.