From 254fed4a9939d5df1cebfaea88b76a913a2a411d Mon Sep 17 00:00:00 2001 From: Arda Samadi Date: Sat, 27 Jun 2026 23:16:42 +0330 Subject: [PATCH] feat(cart): mockup-style item rows + separate-shipping note MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CartItem: compact row — image + title + رنگ/سایز attribute chips (circular color dot) + a bottom row with the stepper and the effective price plus struck original. Drops the verbose label:value rows and the product-code line. Shared with the desktop detail column (verified). - cart list: add a green «ارسال جداگانه» badge per seller-cart, matching the mockup's per-seller grouping. Keeps the existing list -> detail checkout flow. Co-Authored-By: Claude Opus 4.8 --- app/components/cart/CartItem.tsx | 230 +++++++++++++------------------ app/routes/cart._index.tsx | 3 + 2 files changed, 102 insertions(+), 131 deletions(-) diff --git a/app/components/cart/CartItem.tsx b/app/components/cart/CartItem.tsx index ea5273d..44f66be 100644 --- a/app/components/cart/CartItem.tsx +++ b/app/components/cart/CartItem.tsx @@ -1,4 +1,4 @@ -import { Check, Trash } from "lucide-react"; +import { Trash } from "lucide-react"; import { memo, useMemo } from "react"; import { QuantityControl } from "./QuantityControl"; import { formatPrice } from "../../utils/helpers"; @@ -34,145 +34,113 @@ export const CartItem = memo(function CartItem({ ); }, [item.productVariant?.discountPrice, item.productVariant?.price]); - // Memoize video check const isVideoMedia = useMemo( () => isVideo(item.productVariant?.productImage || ""), [item.productVariant?.productImage] ); + + const color = + item.productVariant?.color?.value !== "UNSELECTED" + ? item.productVariant?.color?.info?.detail || "" + : ""; + const size = + item.productVariant?.size?.value !== "UNSELECTED" + ? item.productVariant?.size?.info?.detail || "" + : ""; + + const effectivePrice = + item.productVariant?.discountPrice || item.productVariant?.price || ""; + const inStock = + !!item?.productVariant?.stock && item.productVariant.stock > 0; + return ( -
-
- {isVideoMedia ? ( -