-
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
Feat/334 #353
Feat/334 #353
Changes from 3 commits
1ecbef4
c4e4081
2f4f688
748d8c0
b7b4000
b0bcc25
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import clsx from 'clsx'; | ||
import { useEffect } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { Button } from 'components/ui/Button'; | ||
|
@@ -18,10 +20,6 @@ | |
|
||
import styles from './index.module.scss'; | ||
|
||
const mockData = { | ||
wishCnt: 999999, | ||
}; | ||
|
||
type ButtonBundlesProps = { | ||
productDescription: ProductDescriptionResponse; | ||
hasOption: boolean; | ||
|
@@ -35,8 +33,15 @@ | |
selectedOption, | ||
quantity, | ||
}: ButtonBundlesProps) => { | ||
const { productId, name, price, productThumbnails, options } = | ||
productDescription; | ||
const { | ||
productId, | ||
name, | ||
price, | ||
productThumbnails, | ||
options, | ||
wishCount, | ||
wish, | ||
} = productDescription; | ||
const navigate = useNavigate(); | ||
const { isLoggedIn, login, confirmLogin } = useLogin(); | ||
const { isSelected, isSelfSelected, selectedFriends, getImgUrl } = | ||
|
@@ -85,7 +90,7 @@ | |
// 옵션 선택 여부 확인 | ||
const checkOptionBeforeAction = (action: () => void) => { | ||
if (hasOption && !selectedOption) { | ||
alert('옵션을 선택해주세요'); | ||
return; | ||
} | ||
action(); | ||
|
@@ -125,7 +130,7 @@ | |
} else if (selectedFriends.length === 1) { | ||
navigate('/bill/gift', { state: { orderInfos, giftFor: 'friends' } }); | ||
} else { | ||
alert('지금은 한 번에 한 명에게만 선물할 수 있어요.'); | ||
} | ||
}); | ||
}; | ||
|
@@ -141,6 +146,8 @@ | |
// console.log('선물상자 담기'); | ||
}; | ||
|
||
useEffect(() => {}, [wish]); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 위시 상품이 변경되면 재렌더링을 하기 위한 건가요?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 궁금합니다! 어떤 코드인지 잘 모르겠습니다 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 코드 의미 없는 코드인데 제가 지우는것을 깜빡한것같아요 제거했습니다! b7b4000 |
||
return ( | ||
<section className={styles.wrapper_bundle}> | ||
<FundingModal | ||
|
@@ -179,8 +186,8 @@ | |
</Button> | ||
<section className={styles.wrapper_gift}> | ||
<Button className={styles.btn_wish} onClick={handleClickWish}> | ||
<span className={styles.ico_wish} /> | ||
{formatNumberWithPlus(mockData.wishCnt, 100000)} | ||
<span className={clsx(styles.ico_wish, { [styles.on]: wish })} /> | ||
{formatNumberWithPlus(wishCount, 100000)} | ||
</Button> | ||
<Button | ||
color="black" | ||
|
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.
wish
가 위시 여부를 의미하는 건가요?그렇다면
isWished
나wished
처럼 이름을 짓는 건 어떨까용?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.
반영했습니다. b0bcc25