Now let's move to writing the product's page component. The code is similar to the products page that we wrote in Chapter 4, Frontend with React.js. Let's open the ProductsCards.js file, then write the following code:
import React from 'react';class Card extends React.Component { render() { const priceColor = (this.props.promo)? "text-danger" : "text-dark"; const sellPrice = (this.props.promo)?this.props.promotion:this.props.price; return ( <div className="col-md-6 col-lg-4 d-flex align-items-stretch"> <div className="card mb-3"> <img className="card-img-top" src={this.props.img} alt={this.props.imgalt} /> <div className="card-body"> <h4 className="card-title">{this.props.productname}</h4> Price: <strong ...