Skip to content

Commit 07c877a

Browse files
authored
Merge pull request #82 from geulDa/fix/#70/likebutton
🐛Fix &✨Feat: 컨테이너 좋아요 버튼 활성화 & small Event Card 추가
2 parents 475a06a + fa90738 commit 07c877a

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/shared/components/container/EventCard.tsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,6 @@ const EventCard = ({
116116
) : (
117117
// Large 카드
118118
<div className='flex items-start justify-between w-full gap-[1.2rem]'>
119-
{/* 행사 이미지 */}
120-
<div className='relative w-[14.2rem] h-[10rem] rounded-[2rem] flex-shrink-0 overflow-hidden'>
121-
{imageSrc ? (
122-
<Image
123-
src={imageSrc}
124-
alt={name}
125-
fill
126-
className='object-cover'
127-
sizes='(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 14.2rem'
128-
loading='lazy'
129-
/>
130-
) : (
131-
<div className='absolute inset-0 bg-gray-200' />
132-
)}
133-
</div>
134-
135119
{/* 행사 제목 + 하트 */}
136120
<div className='flex flex-col justify-between flex-1'>
137121
<div className='flex items-start justify-between w-full'>
@@ -162,7 +146,7 @@ const EventCard = ({
162146
{/* 행사 설명 */}
163147
<p
164148
className={cn(
165-
'text-body-md mt-[1rem] line-clamp-4', //4줄 초과
149+
'text-body-md mt-[1rem] line-clamp-4 text-left', //4줄 초과
166150
variant === 'mint' ? 'text-mint-500' : 'text-gray-500',
167151
)}
168152
>

src/shared/components/container/LocationCard.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useState } from 'react';
12
import { Icon } from '@/shared/icons';
23
import { Card } from '@/shared/components/container/Card';
34
import { cn } from '@/shared/lib';
@@ -20,6 +21,11 @@ const LocationCard = ({
2021
size = 'medium',
2122
imageSrc = '',
2223
}: LocationCardProps) => {
24+
const [liked, setLiked] = useState(false);
25+
26+
const handleLikeClick = () => {
27+
setLiked((prev) => !prev);
28+
};
2329
return (
2430
<Card variant={variant} size={size}>
2531
{/* Medium 카드 */}
@@ -84,7 +90,16 @@ const LocationCard = ({
8490
<Icon
8591
name='HeartStraight'
8692
size={20}
87-
color={variant === 'mint' ? 'mint-400' : 'gray-300'}
93+
color={
94+
liked
95+
? 'red-400'
96+
: variant === 'mint'
97+
? 'mint-400'
98+
: 'gray-300'
99+
}
100+
fillColor={liked ? 'red-300' : undefined}
101+
onClick={handleLikeClick}
102+
className='cursor-pointer'
88103
/>
89104
</div>
90105
</div>

0 commit comments

Comments
 (0)