Skip to content

Commit

Permalink
Improve product page price display (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
Winston-Hsiao authored Oct 18, 2024
1 parent 67c9819 commit 0e6fd9d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/pages/StompyMini.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const StompyMini: React.FC = () => {
"Active community for support and ideas",
"Regular firmware updates",
],
price: 350,
price: 35000,
productId: "prod_R1IAtdBONHzXCb",
};

Expand All @@ -38,7 +38,7 @@ const StompyMini: React.FC = () => {
description={productInfo.description}
features={productInfo.features}
keyFeatures={productInfo.specs}
price={productInfo.price.toString()}
price={productInfo.price}
/>
);
};
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/pages/StompyPro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const StompyPro: React.FC = () => {
"Expandable functionality through apps",
"Regular software updates",
],
price: 15000,
price: 1600000,
productId: "prod_R0n3nkCO4aQdlg",
};

Expand All @@ -38,7 +38,7 @@ const StompyPro: React.FC = () => {
description={productInfo.description}
features={productInfo.features}
keyFeatures={productInfo.specs}
price={productInfo.price.toString()}
price={productInfo.price}
/>
);
};
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/products/ProductPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from "react";

import Container from "@/components/Container";
import CheckoutButton from "@/components/stripe/CheckoutButton";
import { formatPrice } from "@/lib/utils/formatNumber";

interface Props {
productId: string;
Expand All @@ -10,7 +11,7 @@ interface Props {
description: string;
features: string[];
keyFeatures: string[];
price: string;
price: number;
images: string[];
}

Expand Down Expand Up @@ -175,16 +176,16 @@ const ProductPage = ({

{isFixed && (
<div className="fixed bottom-0 left-0 right-0 bg-white shadow-md p-4 transition-all duration-300 ease-in-out z-10">
<div className="max-w-7xl mx-auto flex justify-between items-center">
<p className="text-3xl font-bold">${price}</p>
<div className="max-w-7xl mx-auto flex justify-between items-center px-6">
<p className="text-2xl font-semibold">{formatPrice(price)}</p>
<CheckoutButton productId={productId} label={checkoutLabel} />
</div>
</div>
)}

<div className="relative left-0 right-0 bg-white shadow-md p-4 transition-all duration-300 ease-in-out rounded-lg">
<div className="max-w-7xl mx-auto flex justify-between items-center">
<p className="text-3xl font-bold">${price}</p>
<p className="text-2xl font-semibold">{formatPrice(price)}</p>
<CheckoutButton productId={productId} label={checkoutLabel} />
</div>
</div>
Expand Down

0 comments on commit 0e6fd9d

Please sign in to comment.