Skip to content

Commit

Permalink
centered totalPrice at the buttom of the page
Browse files Browse the repository at this point in the history
  • Loading branch information
EsbenSE committed Mar 11, 2024
1 parent ab89776 commit b8d836d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/assets/scripts/basket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function Basket() {

return (
<>
<div>
{basketItems.length > 0 && (
<table className="shoppingCart">
<tbody>
Expand All @@ -51,7 +52,7 @@ function Basket() {
<th>Price per unit</th>
<th>Quantity</th>
<th>Total </th>
<th> Total price: {totalPrice.toFixed(2)}. {calculateDiscount(totalPrice)}</th>
<th> </th>
<th></th>
</tr>
{basketItems.map((product) => {
Expand All @@ -75,7 +76,9 @@ function Basket() {
</p>
)}
<div>
<h3></h3> {/*Should be moved*/}
<h3>Total price: {totalPrice.toFixed(2)} </h3>
<h3>{calculateDiscount(totalPrice)}</h3> {/*Should be moved*/}
</div>
</div>
</>
);
Expand Down

0 comments on commit b8d836d

Please sign in to comment.