Commit 5b4f2f7d authored by Shaphen's avatar Shaphen

[AFP-47 Shaphen Pangburn]: Add input field for quantity next to Add to Cart button

parent 94de113b
...@@ -53,13 +53,16 @@ export default class ProductMarket extends Component { ...@@ -53,13 +53,16 @@ export default class ProductMarket extends Component {
<p id="promo-show-text"> <p id="promo-show-text">
${ this.calculateDiscount(prod.price, prod.promo) } ${ this.calculateDiscount(prod.price, prod.promo) }
</p> </p>
</div> : prod.price } </div> : "$" + prod.price }
</p> </p>
{prod.promo ? {prod.promo ?
<p id="prod-promotion"> <p id="prod-promotion">
{ "Save " + prod.promo + "% on your order!"} { "Save " + prod.promo + "% on your order!"}
</p> : ""} </p> : ""}
<button id="add-to-cart-button">Add to Cart</button> <div className="add-cart-and-quantity">
<input id="order-quantity" type="number" placeholder="Qty" />
<span id="add-to-cart-button">Add to Cart</span>
</div>
</div> </div>
: :
<div className="product-item"> <div className="product-item">
......
...@@ -100,6 +100,15 @@ ...@@ -100,6 +100,15 @@
#add-to-cart-button { #add-to-cart-button {
cursor: pointer; cursor: pointer;
margin-bottom: 10px; margin-bottom: 10px;
padding: 5px 40px;
border-radius: 5px;
border: 1px solid black;
font-size: 15px;
transition: all 0.3s;
}
#add-to-cart-button:hover {
background-color: rgb(207, 205, 205);
} }
#prod-not-available { #prod-not-available {
...@@ -127,4 +136,22 @@ ...@@ -127,4 +136,22 @@
#promo-show-text { #promo-show-text {
font-size: 18px; font-size: 18px;
padding-top: 2px; padding-top: 2px;
}
#order-quantity {
width: 23px;
height: 13px;
border-radius: 5px;
margin: 1px 5px;
padding: 6px;
}
.add-cart-and-quantity {
display: flex;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment