diff --git a/src/components/shop/Breadcrumbs.tsx b/src/components/shop/Breadcrumbs.tsx deleted file mode 100644 index d27218fd..00000000 --- a/src/components/shop/Breadcrumbs.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import * as React from 'react' -import { Link } from '@tanstack/react-router' -import { ChevronRight } from 'lucide-react' - -export type Crumb = { - label: string - href?: string -} - -/** - * Accessible breadcrumb trail. The last crumb renders as plain text - * (current location); intermediate crumbs link back. - */ -export function Breadcrumbs({ crumbs }: { crumbs: Array }) { - return ( - - ) -} diff --git a/src/components/shop/CartDrawer.tsx b/src/components/shop/CartDrawer.tsx index e25e3b10..1cb62c02 100644 --- a/src/components/shop/CartDrawer.tsx +++ b/src/components/shop/CartDrawer.tsx @@ -1,4 +1,3 @@ -import * as React from 'react' import * as Dialog from '@radix-ui/react-dialog' import { Link } from '@tanstack/react-router' import { Minus, Plus, ShoppingCart, Trash2, X } from 'lucide-react' @@ -6,6 +5,7 @@ import { twMerge } from 'tailwind-merge' import { useCart, useRemoveCartLine, useUpdateCartLine } from '~/hooks/useCart' import { formatMoney, shopifyImageUrl } from '~/utils/shopify-format' import type { CartLineDetail } from '~/utils/shopify-queries' +import { ShopLabel, ShopMono } from './ui' type CartDrawerProps = { open: boolean @@ -14,10 +14,8 @@ type CartDrawerProps = { /** * Slide-in cart drawer. Shares state with /shop/cart through the same - * useCart React Query key, so adds in the drawer mirror the full page - * and vice-versa. Pinned to the right on desktop; full-width slide-up on - * mobile would be nice later, but a right-anchored sheet is the standard - * Shopify-theme pattern and works on phones too. + * useCart React Query key. The root element wears `shop-scope` because the + * drawer is portaled outside the ShopLayout tree. */ export function CartDrawer({ open, onOpenChange }: CartDrawerProps) { const { cart, totalQuantity } = useCart() @@ -26,26 +24,28 @@ export function CartDrawer({ open, onOpenChange }: CartDrawerProps) { return ( - + -
- - Cart{totalQuantity > 0 ? ` (${totalQuantity})` : ''} +
+ + + Cart{totalQuantity > 0 ? ` (${totalQuantity})` : ''} + @@ -53,7 +53,7 @@ export function CartDrawer({ open, onOpenChange }: CartDrawerProps) { {hasLines ? ( <> -
    +
      {cart.lines.nodes.map((line) => ( void }) { return ( -
      - -

      Your cart is empty.

      +
      + +

      Your cart is empty.

      Shop all products + + → +
      ) @@ -98,26 +105,33 @@ function DrawerFooter({ }) { const subtotal = cart.cost.subtotalAmount return ( -