From 615dde52e6dc176685070052e52660ca01650ada Mon Sep 17 00:00:00 2001 From: k4rli Date: Thu, 10 Jul 2025 14:52:18 +0300 Subject: [PATCH] wip4 --- app/home/(user)/(dashboard)/cart/page.tsx | 40 ++++++++++++++++++- .../components/empty-cart-message/index.tsx | 17 -------- .../src/modules/cart/templates/index.tsx | 4 +- .../src/modules/cart/templates/items.tsx | 4 +- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/app/home/(user)/(dashboard)/cart/page.tsx b/app/home/(user)/(dashboard)/cart/page.tsx index 72fc72b..83248b3 100644 --- a/app/home/(user)/(dashboard)/cart/page.tsx +++ b/app/home/(user)/(dashboard)/cart/page.tsx @@ -1,3 +1,4 @@ +import { PageBody, PageHeader } from '@/packages/ui/src/makerkit/page'; import { Metadata } from 'next'; import { notFound } from 'next/navigation'; @@ -12,12 +13,47 @@ export const metadata: Metadata = { }; export default async function Cart() { - const cart = await retrieveCart().catch((error) => { + const cart2 = await retrieveCart().catch((error) => { console.error(error); return notFound(); }); const customer = await retrieveCustomer(); - return ; + const cart: NonNullable = { + items: [ + { + id: '1', + quantity: 1, + cart: cart2!, + item_total: 100, + item_subtotal: 100, + item_tax_total: 100, + original_total: 100, + original_subtotal: 100, + original_tax_total: 100, + total: 100, + subtotal: 100, + tax_total: 100, + title: 'Test', + requires_shipping: true, + discount_total: 0, + discount_tax_total: 0, + metadata: {}, + created_at: new Date(), + is_discountable: true, + is_tax_inclusive: true, + unit_price: 100, + cart_id: '1', + }, + ], + } + + return ( + + + + + + ); } diff --git a/packages/features/medusa-storefront/src/modules/cart/components/empty-cart-message/index.tsx b/packages/features/medusa-storefront/src/modules/cart/components/empty-cart-message/index.tsx index e04a1f8..477cf8e 100644 --- a/packages/features/medusa-storefront/src/modules/cart/components/empty-cart-message/index.tsx +++ b/packages/features/medusa-storefront/src/modules/cart/components/empty-cart-message/index.tsx @@ -1,23 +1,6 @@ -import { Heading, Text } from "@medusajs/ui" - -import InteractiveLink from "@modules/common/components/interactive-link" - const EmptyCartMessage = () => { return (
- - Cart - - - You don't have anything in your cart. Let's change that, use - the link below to start browsing our products. - -
- Explore products -
) } diff --git a/packages/features/medusa-storefront/src/modules/cart/templates/index.tsx b/packages/features/medusa-storefront/src/modules/cart/templates/index.tsx index 5d69dda..9af92eb 100644 --- a/packages/features/medusa-storefront/src/modules/cart/templates/index.tsx +++ b/packages/features/medusa-storefront/src/modules/cart/templates/index.tsx @@ -18,12 +18,12 @@ const CartTemplate = ({ {cart?.items?.length ? (
- {!customer && ( + {/* {!customer && ( <> - )} + )} */}
diff --git a/packages/features/medusa-storefront/src/modules/cart/templates/items.tsx b/packages/features/medusa-storefront/src/modules/cart/templates/items.tsx index 71818c3..0e6a246 100644 --- a/packages/features/medusa-storefront/src/modules/cart/templates/items.tsx +++ b/packages/features/medusa-storefront/src/modules/cart/templates/items.tsx @@ -13,9 +13,9 @@ const ItemsTemplate = ({ cart }: ItemsTemplateProps) => { const items = cart?.items return (
-
+ {/*
Cart -
+
*/}