Commit a7be7aaa authored by Shaphen's avatar Shaphen

[AFP-47 Shaphen Pangburn]: Modify promo display to better show savings

parent 88e3674e
...@@ -42,14 +42,21 @@ export default class ProductMarket extends Component { ...@@ -42,14 +42,21 @@ export default class ProductMarket extends Component {
<img id="prod-img" src={ prod.productImageUrl ? prod.productImageUrl : "-no photo-" } /> <img id="prod-img" src={ prod.productImageUrl ? prod.productImageUrl : "-no photo-" } />
<p id="prod-name">{ prod.productName }</p> <p id="prod-name">{ prod.productName }</p>
<p id="prod-description">{ prod.productDescription }</p> <p id="prod-description">{ prod.productDescription }</p>
<p id="prod-price">${ prod.price }</p> <p id="prod-price">
<p id="prod-promotion"> { prod.promo ?
{ prod.promo ? "Order now for " <div id="promo-show">
+ prod.promo <p id="promo-show-text-original">
+ "% off, making it " ${ prod.price }
+ this.calculateDiscount(prod.price, prod.promo) </p>
+ "!" : "" } <p id="promo-show-text">
${ this.calculateDiscount(prod.price, prod.promo) }
</p>
</div> : prod.price }
</p> </p>
{prod.promo ?
<p id="prod-promotion">
{ "Save " + prod.promo + "% on your order!"}
</p> : ""}
<button id="add-to-cart-button">Add to Cart</button> <button id="add-to-cart-button">Add to Cart</button>
</div> </div>
: :
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
text-align: center; text-align: center;
font-size: 30px; font-size: 30px;
margin: 15px 0px 10px; margin: 15px 0px 10px;
cursor: default;
} }
...@@ -45,12 +46,19 @@ ...@@ -45,12 +46,19 @@
height: 200px; height: 200px;
} }
#prod-name, #prod-description, #prod-price { #prod-name,
#prod-description,
#prod-price,
#prod-promotion {
width: 100%; width: 100%;
text-align: center; text-align: center;
cursor: default; cursor: default;
} }
#prod-promotion {
color: red;
}
#add-to-cart-button { #add-to-cart-button {
cursor: pointer; cursor: pointer;
margin-bottom: 10px; margin-bottom: 10px;
...@@ -60,4 +68,22 @@ ...@@ -60,4 +68,22 @@
text-align: center; text-align: center;
color: gray; color: gray;
cursor: default; cursor: default;
}
#promo-show {
display: flex;
justify-content: center;
}
#promo-show-text, #promo-show-text-original {
margin: 0px 3px;
}
#promo-show-text-original {
text-decoration: line-through;
color: gray;
}
#promo-show-text {
} }
\ 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