Skip to content
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
34 changes: 17 additions & 17 deletions src/pages/mypage/components/PostcardContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,28 @@ export default function PostcardContainer({
postcards.length <= 8 && 'justify-center gap-[1.2rem] ',
)}
>
{filledSlots.map((card, idx) => (
<button
key={card?.postcardId ?? idx}
onClick={() => card && onClickCard?.(card.postcardId)}
disabled={!card}
aria-disabled={!card}
className={cn(
postcardCardStyle({ interactive: !!card }),
!card && 'items-center justify-center bg-pink-100',
)}
>
{card && (
{filledSlots.map((card, idx) =>
card ? (
<button
key={card.postcardId}
onClick={() => onClickCard?.(card.postcardId)}
className={postcardCardStyle({ interactive: true })}
>
<Image
src={card.imageUrl}
alt={card.placeName || `์—ฝ์„œ ${idx + 1}`}
src={card.imageUrl.trim()}
alt={card.placeName}
width={200}
height={200}
className='w-full h-full object-cover'
/>
)}
</button>
))}
</button>
) : (
<div
key={idx}
className='w-[70px] h-[70px] rounded-[8px] bg-pink-100'
/>
),
)}
</div>
</div>
);
Expand Down
8 changes: 6 additions & 2 deletions src/pages/mypage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useMyPageQuery } from '@/shared/api/member';

export default function MyPage() {
const { isLoggedIn } = useUserStatus();
const router = useRouter();
const router = useRouter();
const {
showLoginPopup,
showLogoutPopup,
Expand Down Expand Up @@ -126,10 +126,14 @@ export default function MyPage() {
</section>

{/* ์ €์žฅํ•œ ์—ฝ์„œ */}
<section aria-label='์ €์žฅํ•œ ์—ฝ์„œ' className='w-full mt-[1.8rem]'>
<section
aria-label='์ €์žฅํ•œ ์—ฝ์„œ'
className='w-full mt-[1.8rem] relative z-[100]'
>
<p className='text-label-lg mb-[0.6rem] pl-[1rem]'>์ €์žฅํ•œ ์—ฝ์„œ</p>
<PostcardContainer
postcards={!isLoggedIn ? [] : hasPostcards ? postcards : []}
onClickCard={(id) => router.push(`/mypage/postcard/${id}`)}
/>
</section>

Expand Down
2 changes: 1 addition & 1 deletion src/pages/mypage/postcard/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const PostCard = () => {
)}
>
<FlipCard
frontSrc={imageUrl}
frontSrc={imageUrl.trim()}
backSrc={imageProps.backSrc}
width={imageProps.width}
height={imageProps.height}
Expand Down
Loading