Skip to content

Commit

Permalink
[feat]: 선택한 친구에 따른 버튼 내 프로필사진 변경 (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
uraflower committed May 30, 2024
1 parent 5309589 commit f59101a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
11 changes: 8 additions & 3 deletions src/layouts/Product/BuyInfo/ButtonBundles/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,18 @@
.btn_gift {
@include size(40%, 60px, 0 0 0 5px, 0);

.img_profile {
.wrapper_profile {
@include size(32px, 32px, 0, 0);

position: relative;
margin-right: 6px;
background-image: url('assets/profile_noimg.png');
background-size: cover;

.img_profile {
@include masking;

width: 100%;
object-fit: cover;
}
}

.ico_profile {
Expand Down
14 changes: 10 additions & 4 deletions src/layouts/Product/BuyInfo/ButtonBundles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { formatNumberWithPlus } from 'utils/format';
import { RequestOrderPreview } from 'types/payment';
import { OptionDetail, ProductDescriptionResponse } from 'types/product';

import DefaultProfileImage from 'assets/profile_noimg.png';

import styles from './index.module.scss';

const mockData = {
Expand All @@ -37,7 +39,7 @@ const ButtonBundles = ({
productDescription;
const navigate = useNavigate();
const { isLoggedIn, login, confirmLogin } = useLogin();
const { isSelected, isSelfSelected, selectedFriends } =
const { isSelected, isSelfSelected, selectedFriends, getImgUrl } =
useSelectedFriendsStore();
const { openKakaoPicker } = useKakaoPicker();

Expand Down Expand Up @@ -186,10 +188,14 @@ const ButtonBundles = ({
onClick={handleClickGiftForFriend}
className={styles.btn_gift}
>
<span className={styles.img_profile}>
{/* TODO : 로그인 되었을 때만 보이게 */}
<div className={styles.wrapper_profile}>
<img
src={getImgUrl(DefaultProfileImage)}
alt="선물할 친구 프로필 사진"
className={styles.img_profile}
/>
<span className={styles.ico_profile} />
</span>
</div>
선물하기
</Button>
</section>
Expand Down

0 comments on commit f59101a

Please sign in to comment.