Commit 77e70c65 authored by Shaphen's avatar Shaphen

[AFP-47 Shaphen Pangburn]: Add spacing and borders for each item. Add 'product...

[AFP-47 Shaphen Pangburn]: Add spacing and borders for each item. Add 'product no longer available' message for null products
parent d4481f05
...@@ -37,7 +37,7 @@ export default class ProductMarket extends Component { ...@@ -37,7 +37,7 @@ export default class ProductMarket extends Component {
{this.props.products.map(prod => { {this.props.products.map(prod => {
return ( return (
<div className="product-item-container" key={ prod.sku }> <div className="product-item-container" key={ prod.sku }>
{prod.productName ? { prod.productName ?
<div className="product-item"> <div className="product-item">
<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>
...@@ -52,7 +52,10 @@ export default class ProductMarket extends Component { ...@@ -52,7 +52,10 @@ export default class ProductMarket extends Component {
</p> </p>
<button id="add-to-cart-button">Add to Cart</button> <button id="add-to-cart-button">Add to Cart</button>
</div> </div>
: ""} :
<div className="product-item">
<p id="prod-not-available">This Product is No Longer Available</p>
</div> }
</div> </div>
) )
})} })}
......
...@@ -18,14 +18,19 @@ ...@@ -18,14 +18,19 @@
} }
.product-item-container { .product-item-container {
width: 25%; width: 330px;
height: 335px;
margin: 8px;
} }
.product-item { .product-item {
width: 100%; width: 100%;
height: 100%;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
align-items: center;
border: 1px solid gray;
} }
#prod-img { #prod-img {
...@@ -35,4 +40,9 @@ ...@@ -35,4 +40,9 @@
#prod-name, #prod-description, #prod-price { #prod-name, #prod-description, #prod-price {
width: 100%; width: 100%;
text-align: center; text-align: center;
}
#prod-not-available {
text-align: center;
color: gray;
} }
\ 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