diff --git a/package.json b/package.json index f909fc2a..ce76d2a4 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "packageManager": "pnpm@10.11.0", "scripts": { - "dev": "next dev", + "dev": "next dev --webpack", "build": "next build --webpack", "start": "next start", "lint": "eslint .", diff --git a/src/app/pick/list/page.tsx b/src/app/pick/list/page.tsx index f4e81116..cd45f43c 100644 --- a/src/app/pick/list/page.tsx +++ b/src/app/pick/list/page.tsx @@ -20,12 +20,13 @@ const ListPage = () => { {items.length}개
- {items.map(({ giftId, itemName, itemUrl }) => ( + {items.map(({ giftId, itemName, itemUrl, imageUrl }) => ( ))}
diff --git a/src/app/pick/preview/page.tsx b/src/app/pick/preview/page.tsx index f98bcae2..e3e7b71f 100644 --- a/src/app/pick/preview/page.tsx +++ b/src/app/pick/preview/page.tsx @@ -48,13 +48,14 @@ const PreviewPage = () => {

최종 점검

최종 선택한 선물

- {pickedItems.map(({ giftId, itemName, itemUrl }) => ( + {pickedItems.map(({ giftId, itemName, itemUrl, imageUrl }) => ( ))}
diff --git a/src/app/pick/select/page.tsx b/src/app/pick/select/page.tsx index d2a0897f..9f00720c 100644 --- a/src/app/pick/select/page.tsx +++ b/src/app/pick/select/page.tsx @@ -52,7 +52,7 @@ const SelectPage = () => { className="no-scrollbar bg-blue-5 flex snap-x snap-mandatory gap-[2.4rem] overflow-x-auto overflow-y-hidden px-[2rem] pt-[7rem] pb-[5rem]" >
- {items.map(({ giftId, itemName, itemUrl }, i) => ( + {items.map(({ giftId, itemName, itemUrl, imageUrl }, i) => ( { itemName={itemName} itemUrl={itemUrl} onRemove={handleRemove} + imageUrl={imageUrl} /> ))}
diff --git a/src/app/wishpool/(viewer)/[id]/date/page.tsx b/src/app/wishpool/(viewer)/[id]/date/page.tsx index 7f1a4e5c..ab9de915 100644 --- a/src/app/wishpool/(viewer)/[id]/date/page.tsx +++ b/src/app/wishpool/(viewer)/[id]/date/page.tsx @@ -36,9 +36,9 @@ const DatePage = () => { pickDate: endDate, }); - const chosenUrl = res.chosenUrl; - sessionStorage.setItem('chosenUrl', chosenUrl); - router.push(PATH.WISHPOOL_INVITE(wishpoolId)); + router.push( + PATH.WISHPOOL_INVITE(wishpoolId) + `?chosenUrl=${res.chosenUrl}`, + ); } catch { alert('선물 고르기 마감일 설정에 실패했습니다.'); } diff --git a/src/app/wishpool/(viewer)/[id]/final/page.tsx b/src/app/wishpool/(viewer)/[id]/final/page.tsx index 06b93875..1a70f726 100644 --- a/src/app/wishpool/(viewer)/[id]/final/page.tsx +++ b/src/app/wishpool/(viewer)/[id]/final/page.tsx @@ -49,6 +49,7 @@ const FinalPage = () => { giftId={giftId} itemName={giftName} itemUrl={giftImage} + imageUrl={giftImage} /> ), )} diff --git a/src/app/wishpool/(viewer)/[id]/gifts/page.tsx b/src/app/wishpool/(viewer)/[id]/gifts/page.tsx index 9aed45bf..cf699dc7 100644 --- a/src/app/wishpool/(viewer)/[id]/gifts/page.tsx +++ b/src/app/wishpool/(viewer)/[id]/gifts/page.tsx @@ -30,6 +30,7 @@ const GiftPage = () => { guest={gift.guest || ''} itemName={gift.itemName} itemUrl={gift.itemUrl} + imageUrl={gift.imageUrl} /> ))}
diff --git a/src/app/wishpool/(viewer)/[id]/invite/page.tsx b/src/app/wishpool/(viewer)/[id]/invite/page.tsx index f321aef1..1fc4bbc6 100644 --- a/src/app/wishpool/(viewer)/[id]/invite/page.tsx +++ b/src/app/wishpool/(viewer)/[id]/invite/page.tsx @@ -7,6 +7,7 @@ import invite from '@/assets/images/invite.png'; import WishpoolShareSection from '@/components/common/WishpoolShareBox'; import { PATH } from '@/constants/common/path'; import { useGetWishpoolId } from '@/hooks/common/useGetWishpoolId'; +import { useGetChosenUrl } from '@/hooks/pick/useGetChosenUrl'; import { ShareSectionType } from '@/types/common/ShareSectionType'; const getOrigin = () => { @@ -17,7 +18,7 @@ const getOrigin = () => { const InvitePage = () => { const content = 'invite' as ShareSectionType; - const chosenUrl = sessionStorage.getItem('chosenUrl') || ''; + const chosenUrl = useGetChosenUrl(); const origin = getOrigin(); const inviteUrl = `${origin}${PATH.PICK_INVITE}?chosenUrl=${chosenUrl}`; diff --git a/src/components/pick/list/GiftCard.tsx b/src/components/pick/list/GiftCard.tsx index f1baccdf..6a7c2f65 100644 --- a/src/components/pick/list/GiftCard.tsx +++ b/src/components/pick/list/GiftCard.tsx @@ -1,5 +1,6 @@ import Image from 'next/image'; +import { useGetWishpoolImage } from '@/api/domain/detail/hooks'; import GiftCardImage from '@/assets/images/gift-card.png'; import type { GiftCardType } from '@/types/common/giftCardType'; @@ -13,16 +14,19 @@ const GiftCard = ({ size = 'small', giftId, itemName, - //itemUrl, + imageUrl, }: GiftCardProps) => { const isSmall = size === 'small'; + const { data: imageData } = useGetWishpoolImage(imageUrl); + const finalSrc = imageData && imageData.key ? imageData.key : GiftCardImage; + return (
{`선물 {renderSpacer && ( @@ -73,7 +77,7 @@ export default function CarouselCard({ ].join(' ')} > 선물 카드 이미지 { transition={{ duration, ease: 'linear', repeat: Infinity }} aria-hidden > - {items.map(({ giftId, itemName, itemUrl }) => ( + {items.map(({ giftId, itemName, itemUrl, imageUrl }) => ( ))} diff --git a/src/components/wishpool/viewer/list/ItemCard.tsx b/src/components/wishpool/viewer/list/ItemCard.tsx index 19d8dbbf..94fcdb0c 100644 --- a/src/components/wishpool/viewer/list/ItemCard.tsx +++ b/src/components/wishpool/viewer/list/ItemCard.tsx @@ -1,6 +1,7 @@ import Image from 'next/image'; import Link from 'next/link'; +import { useGetWishpoolImage } from '@/api/domain/detail/hooks'; import GiftCardImage from '@/assets/images/gift-card.png'; import UserTag from '@/components/common/UserTag'; @@ -8,14 +9,18 @@ type ItemCardProps = { guest: string; itemName: string; itemUrl: string; + imageUrl: string; }; -const ItemCard = ({ guest, itemName, itemUrl }: ItemCardProps) => { +const ItemCard = ({ guest, itemName, itemUrl, imageUrl }: ItemCardProps) => { + const { data: imageData } = useGetWishpoolImage(imageUrl); + const finalSrc = imageData && imageData.key ? imageData.key : GiftCardImage; + return ( <>