Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove redundant Price component #142

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.