File indexing completed on 2025-01-26 05:27:59
0001 import React, { Component } from 'react'; 0002 import Product from './Product'; 0003 class ProductsContainer extends React.Component { 0004 constructor(props){ 0005 super(props); 0006 } 0007 render(){ 0008 let container; 0009 if (this.props.products){ 0010 const products = this.props.products.map((product,index) => ( 0011 <li key={index}> 0012 <Product product={product} baseUrlStore={this.props.baseUrlStore}/> 0013 </li> 0014 )); 0015 container = <ul>{products}</ul> 0016 } 0017 let header; 0018 if(this.props.cat) 0019 { 0020 header = <div className="title"><a href={this.props.baseUrlStore+"/browse/cat/"+this.props.cat+"/order/latest/"}>{this.props.title}</a></div> 0021 }else{ 0022 header = <div className="title">{this.props.title}</div> 0023 } 0024 return ( 0025 <div className="panelContainer"> 0026 {header} 0027 {container} 0028 </div> 0029 ) 0030 } 0031 } 0032 0033 export default ProductsContainer;