From a474b22d1a8b5515c60892e2108d0196e9566a38 Mon Sep 17 00:00:00 2001 From: Jhonatan Gonzalez Date: Thu, 16 May 2024 16:37:43 +0900 Subject: [PATCH] adjust order items fit --- .../widgets/sale/components/OrderItems.tsx | 12 ++-- .../src/components/ui/sale/sale.tsx | 64 +++++++++---------- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItems.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItems.tsx index b695948cc0..1af14cd075 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItems.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItems.tsx @@ -8,7 +8,7 @@ import { OrderItem } from './OrderItem'; import { OrderQuoteProduct, FundingBalance } from '../types'; import { getPricingBySymbol } from '../utils/pricing'; -const singleItemSx: SxProps = { +const withFeesSx: SxProps = { mb: '0', bradbl: '0', bradbr: '0', @@ -27,10 +27,8 @@ export function OrderItems({ balance, pricing, conversions, - children, + children: feesChildren, }: OrderItemsProps) { - const singleItem = items.length === 1 && children; - return ( = 3 ? 'small' : 'medium'} pricing={getPricingBySymbol( balance.fundingItem.token.symbol, pricing?.[item.productId]?.pricing, conversions, )} - sx={singleItem ? singleItemSx : undefined} + sx={idx === items.length - 1 && feesChildren ? withFeesSx : undefined} rc={} /> ))} - {children} + {feesChildren} ); } diff --git a/packages/checkout/widgets-sample-app/src/components/ui/sale/sale.tsx b/packages/checkout/widgets-sample-app/src/components/ui/sale/sale.tsx index 99d2d0ffb0..a120b05ade 100644 --- a/packages/checkout/widgets-sample-app/src/components/ui/sale/sale.tsx +++ b/packages/checkout/widgets-sample-app/src/components/ui/sale/sale.tsx @@ -34,38 +34,38 @@ const defaultItems: SaleItem[] = [ "https://iguanas.mystagingwebsite.com/wp-content/uploads/2024/02/img-Qq0Lek5jO8O9ueAZwDmdAImI-600x600-1.png", description: "Biker Iguana", }, - // { - // productId: "lab", - // qty: 3, - // name: "Lab Iguana", - // image: - // "https://iguanas.mystagingwebsite.com/wp-content/uploads/2023/12/img-IsR4OA7a9IStLeQ9cPo75tII.png", - // description: "Lab Iguana", - // }, - // { - // productId: "baseball", - // qty: 2, - // name: "Baseball Iguana", - // image: - // "https://iguanas.mystagingwebsite.com/wp-content/uploads/2023/12/img-tGcvA5pnoUAA2oNANHpA5CXB.png", - // description: "Baseball Iguana", - // }, - // { - // productId: "firefighter", - // qty: 1, - // name: "Fire Fighter Iguana", - // image: - // "https://iguanas.mystagingwebsite.com/wp-content/uploads/2023/12/img-NRXmr7k1jH9kZqXr029CEKt4.png", - // description: "Fire Fighter Iguana", - // }, - // { - // productId: "soccer", - // qty: 5, - // name: "Soccer Iguana", - // image: - // "https://iguanas.mystagingwebsite.com/wp-content/uploads/2023/12/img-msXHlIXmyy6IhDaMkP2Dp0HY.png", - // description: "Soccer Iguana", - // } + { + productId: "lab", + qty: 3, + name: "Lab Iguana", + image: + "https://iguanas.mystagingwebsite.com/wp-content/uploads/2023/12/img-IsR4OA7a9IStLeQ9cPo75tII.png", + description: "Lab Iguana", + }, + { + productId: "baseball", + qty: 2, + name: "Baseball Iguana", + image: + "https://iguanas.mystagingwebsite.com/wp-content/uploads/2023/12/img-tGcvA5pnoUAA2oNANHpA5CXB.png", + description: "Baseball Iguana", + }, + { + productId: "firefighter", + qty: 1, + name: "Fire Fighter Iguana", + image: + "https://iguanas.mystagingwebsite.com/wp-content/uploads/2023/12/img-NRXmr7k1jH9kZqXr029CEKt4.png", + description: "Fire Fighter Iguana", + }, + { + productId: "soccer", + qty: 5, + name: "Soccer Iguana", + image: + "https://iguanas.mystagingwebsite.com/wp-content/uploads/2023/12/img-msXHlIXmyy6IhDaMkP2Dp0HY.png", + description: "Soccer Iguana", + } ]; const useParams = () => {