Skip to content

Commit

Permalink
fix: remove redundant Price component (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
tetianaman authored Oct 14, 2024
1 parent c95629f commit 802f5f1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
1 change: 1 addition & 0 deletions app/routes/cart/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const mockCartItem: cart.LineItem = {
quantity: 1,
image: 'https://static.wixstatic.com/media/c837a6_18152edaef9940ca88f446ae94b48a47~mv2.jpg/v1/fill/w_824,h_1098,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/c837a6_18152edaef9940ca88f446ae94b48a47~mv2.jpg',
price: { formattedConvertedAmount: '$5.50' },
fullPrice: { formattedConvertedAmount: '$7.50' },
};

const noop = () => {};
Expand Down
6 changes: 3 additions & 3 deletions src/components/cart/cart-item/cart-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { TrashIcon, ImagePlaceholderIcon, ErrorIcon } from '~/components/icons';
import classNames from 'classnames';
import debounce from 'lodash.debounce';
import { useMemo, useState } from 'react';
import { Price } from '~/components/price/price';

import styles from './cart-item.module.scss';
import { Spinner } from '~/components/spinner/spinner';
import { ProductPrice } from '~/components/product-price/product-price';

export interface CartItemProps {
item: cart.LineItem;
Expand Down Expand Up @@ -62,8 +62,8 @@ export const CartItem = ({
<div className={styles.productNameAndPrice}>
<div className={styles.productName}>{productName}</div>
{item.fullPrice?.formattedConvertedAmount && (
<Price
fullPrice={item.fullPrice?.formattedConvertedAmount}
<ProductPrice
price={item.fullPrice?.formattedConvertedAmount}
discountedPrice={item.price?.formattedConvertedAmount}
/>
)}
Expand Down
10 changes: 0 additions & 10 deletions src/components/price/price.module.scss

This file was deleted.

17 changes: 0 additions & 17 deletions src/components/price/price.tsx

This file was deleted.

0 comments on commit 802f5f1

Please sign in to comment.