fix: heart button - bigger tap target, stopPropagation, scale animation on tap

This commit is contained in:
clawd
2026-02-18 10:50:45 +00:00
parent 4d34e8304d
commit 931e2a3c1d
4 changed files with 5 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -43,11 +43,11 @@ export function RecipeCard({ recipe }: { recipe: Recipe }) {
</span>
)}
<button
onClick={(e) => { e.preventDefault(); favMutation.mutate() }}
className="ml-auto"
onClick={(e) => { e.preventDefault(); e.stopPropagation(); favMutation.mutate() }}
className="ml-auto p-2 -mr-2 min-w-[44px] min-h-[44px] flex items-center justify-center active:scale-125 transition-transform"
>
<Heart
size={20}
size={22}
className={recipe.is_favorite ? 'fill-primary text-primary' : 'text-warm-grey'}
/>
</button>

View File

@@ -126,8 +126,8 @@ export function RecipePage() {
<Link to={`/recipe/${recipe.slug}/edit`} className="bg-surface/80 backdrop-blur-sm rounded-full p-2 min-w-[44px] min-h-[44px] flex items-center justify-center">
<Pencil size={20} className="text-espresso" />
</Link>
<button onClick={() => favMutation.mutate()} className="bg-surface/80 backdrop-blur-sm rounded-full p-2 min-w-[44px] min-h-[44px] flex items-center justify-center">
<Heart size={20} className={recipe.is_favorite ? 'fill-primary text-primary' : 'text-espresso'} />
<button onClick={() => favMutation.mutate()} className="bg-surface/80 backdrop-blur-sm rounded-full p-2 min-w-[44px] min-h-[44px] flex items-center justify-center active:scale-125 transition-transform">
<Heart size={22} className={recipe.is_favorite ? 'fill-primary text-primary' : 'text-espresso'} />
</button>
</div>
</div>