@@ -9,7 +9,15 @@ import { SubscriptionLineItem } from "~/components/subscriptions/subscription-li
99import { calculateAspectRatio } from "~/utils/image" ;
1010import { toggleCartDrawer } from "../layout/cart-drawer" ;
1111import { CartLineQuantityAdjust } from "./cart-line-qty-adjust" ;
12+ import { SaveCartLineForLater } from "./cart-saved-for-later" ;
1213import type { CartLayout , CartLine } from "./cart-types" ;
14+ import {
15+ DRAWER_LINE_BODY_CLASS ,
16+ DRAWER_LINE_CLASS ,
17+ DRAWER_LINE_IMAGE_CLASS ,
18+ DRAWER_LINE_MEDIA_CLASS ,
19+ DRAWER_LINE_TITLE_CLASS ,
20+ } from "./drawer-frame" ;
1321import { useCartStore } from "./store" ;
1422
1523const cartCodeBadgeClassName =
@@ -51,7 +59,7 @@ export function CartLineItem({
5159 className = { clsx (
5260 "relative transition-all duration-300" ,
5361 layout === "drawer"
54- ? "flex gap-4 max-md:min-w-0 max-md:w-full"
62+ ? DRAWER_LINE_CLASS
5563 : "flex h-full flex-col items-center overflow-hidden rounded-(--radius-md) md:flex-row" ,
5664 isOptimistic && "opacity-70" ,
5765 id . startsWith ( "optimistic-" ) && "pointer-events-none" ,
@@ -61,7 +69,7 @@ export function CartLineItem({
6169 < div
6270 className = { clsx (
6371 layout === "drawer"
64- ? "shrink-0 rounded-(--radius-md) bg-(--color-background-subtle)/50 max-xl:w-[clamp(100px,32.56vw,140px)] max-md:relative max-md:h-[140px] max-md:min-w-0 max-md:flex-[1_0_0] max-md:self-start max-md:overflow-hidden"
72+ ? DRAWER_LINE_MEDIA_CLASS
6573 : "aspect-square w-full md:h-[360px] md:w-[360px] md:shrink-0" ,
6674 ) }
6775 >
@@ -73,7 +81,7 @@ export function CartLineItem({
7381 className = { clsx (
7482 "!object-cover" ,
7583 layout === "drawer"
76- ? "h-auto w-[140px] rounded-xl max-xl:aspect-square max-xl:h-full max-xl:max-h-[140px] max-xl:w-full max-md:absolute max-md:inset-0 max-md:aspect-auto max-md:max-h-none max-md:rounded-(--radius-md)"
84+ ? DRAWER_LINE_IMAGE_CLASS
7785 : "h-full w-full rounded" ,
7886 ) }
7987 alt = { title }
@@ -87,7 +95,7 @@ export function CartLineItem({
8795 className = { clsx (
8896 "flex flex-col" ,
8997 layout === "drawer"
90- ? "min-w-0 grow justify-between gap-4 max-xl:min-h-[140px] max-xl:text-sm max-md:min-w-min max-md:basis-3/5 max-md:grow-0 max-md:shrink-0 max-md:gap-2 max-md:wrap-anywhere"
98+ ? DRAWER_LINE_BODY_CLASS
9199 : "h-full w-full bg-[var(--Background-Background,#FFF)] p-6 md:h-[360px]" ,
92100 ) }
93101 >
@@ -130,6 +138,8 @@ export function CartLineItem({
130138 />
131139 < SubscriptionLineItem line = { line as any } />
132140
141+ < SaveCartLineForLater line = { line } />
142+
133143 { /* Quantity and Pricing */ }
134144 < div className = "grid w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-1" >
135145 < CartLineQuantityAdjust line = { line } />
@@ -158,12 +168,12 @@ export function CartLineItem({
158168 className = "w-full justify-start text-left max-xl:leading-5"
159169 onClick = { ( ) => toggleCartDrawer ( false ) }
160170 >
161- < span className = "max-xl:line-clamp-2 xl:line-clamp-1 font-semibold uppercase max-md:line-clamp-1" >
171+ < span className = { DRAWER_LINE_TITLE_CLASS } >
162172 { product ?. title || "" }
163173 </ span >
164174 </ Link >
165175 ) : (
166- < p className = "max-xl:line-clamp-2 xl:line-clamp-1 font-semibold uppercase max-md:line-clamp-1" >
176+ < p className = { DRAWER_LINE_TITLE_CLASS } >
167177 { product ?. title || "" }
168178 </ p >
169179 ) }
0 commit comments