Skip to content

Commit

Permalink
Merge pull request #18 from Electrium-Mobility/Fix-duplicate-add-to-cart
Browse files Browse the repository at this point in the history
Fix duplicate add to cart
  • Loading branch information
z4ab authored Jan 30, 2025
2 parents ffe1151 + c21d3e2 commit 0635956
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions app/products/[productId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,6 @@ export default async function ProductPage({ params }: ProductPageProps) {

<CartAdd bike={bike}/>

<div className="flex items-center gap-4 mb-6">
<input type="number" defaultValue={1} min={1} max={bike.amount_stocked}
className="border p-2 w-16 text-center text-gray-800" />
<button className="bg-green-600 text-white px-6 py-2 rounded hover:bg-green-500">
{bike.for_rent ? 'Rent Now' : 'Add to Cart'}
</button>
</div>

<div className="mb-8">
{bike.for_rent ? (
<>
Expand All @@ -109,4 +101,4 @@ export default async function ProductPage({ params }: ProductPageProps) {
</main>
</div>
);
}
}

0 comments on commit 0635956

Please sign in to comment.