add quantity controls to cart drawer via shared CartHook
Move increment/decrement handlers from Cart LiveView into CartHook so they work from any page's drawer. Enable show_quantity_controls on the drawer's cart_item_row. Scope cart tests to #main-content to avoid duplicate button matches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -105,7 +105,7 @@ defmodule SimpleshopThemeWeb.ShopComponents.Cart do
|
||||
<ul role="list" aria-label="Cart items" style="list-style: none; margin: 0; padding: 0;">
|
||||
<%= for item <- @cart_items do %>
|
||||
<li style="border-bottom: 1px solid var(--t-border-default);">
|
||||
<.cart_item_row item={item} size={:compact} mode={@mode} />
|
||||
<.cart_item_row item={item} size={:compact} show_quantity_controls mode={@mode} />
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user