From 4653f741881de8c0d38bc8c79cf0402ec26e4d66 Mon Sep 17 00:00:00 2001 From: Jieren Chen Date: Sun, 8 Sep 2024 13:28:59 -0400 Subject: [PATCH] cleanup --- components/cart/cart-context.tsx | 2 -- components/cart/modal.tsx | 6 +----- lib/fourthwall/reshape.ts | 4 ---- lib/shopify/index.ts | 16 ---------------- lib/shopify/types.ts | 1 - 5 files changed, 1 insertion(+), 28 deletions(-) diff --git a/components/cart/cart-context.tsx b/components/cart/cart-context.tsx index 2d8ddd42f..802f2c1e8 100644 --- a/components/cart/cart-context.tsx +++ b/components/cart/cart-context.tsx @@ -84,7 +84,6 @@ function updateCartTotals(lines: CartItem[]): Pick

Taxes

- +

Calculated at checkout

Shipping

diff --git a/lib/fourthwall/reshape.ts b/lib/fourthwall/reshape.ts index 7c24b8d14..f690bfec8 100644 --- a/lib/fourthwall/reshape.ts +++ b/lib/fourthwall/reshape.ts @@ -165,10 +165,6 @@ export const reshapeCart = (cart: FourthwallCart): Cart => { amount: totalValue.toString(), currencyCode, }, - totalTaxAmount: { - amount: '0.0', - currencyCode, - } }, lines: cart.items.map(reshapeCartItem), // TODO: Stubbed out diff --git a/lib/shopify/index.ts b/lib/shopify/index.ts index c17ec0ad9..8f280ec2d 100644 --- a/lib/shopify/index.ts +++ b/lib/shopify/index.ts @@ -13,13 +13,11 @@ import { getProductsQuery } from './queries/product'; import { - Cart, Collection, Connection, Image, Page, Product, - ShopifyCart, ShopifyCollection, ShopifyCollectionOperation, ShopifyCollectionsOperation, @@ -97,20 +95,6 @@ const removeEdgesAndNodes = (array: Connection): T[] => { return array.edges.map((edge) => edge?.node); }; -const reshapeCart = (cart: ShopifyCart): Cart => { - if (!cart.cost?.totalTaxAmount) { - cart.cost.totalTaxAmount = { - amount: '0.0', - currencyCode: 'USD' - }; - } - - return { - ...cart, - lines: removeEdgesAndNodes(cart.lines) - }; -}; - const reshapeCollection = (collection: ShopifyCollection): Collection | undefined => { if (!collection) { return undefined; diff --git a/lib/shopify/types.ts b/lib/shopify/types.ts index 6c0ccf5be..1e55af88e 100644 --- a/lib/shopify/types.ts +++ b/lib/shopify/types.ts @@ -102,7 +102,6 @@ export type ShopifyCart = { cost: { subtotalAmount: Money; totalAmount: Money; - totalTaxAmount: Money; }; lines: Connection; totalQuantity: number;