2016-10-26 16:55:47 +13:00
|
|
|
|
|
|
|
|
import React, { PropTypes } from 'react'
|
|
|
|
|
import GridItem from './GridItem'
|
|
|
|
|
|
|
|
|
|
export default class CategoryGrid extends React.Component{
|
|
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
2016-11-08 13:36:13 +13:00
|
|
|
if( !this.props.categories ) return null
|
|
|
|
|
|
|
|
|
|
var className = "grid category-grid"
|
|
|
|
|
if( this.props.className ) className += ' '+this.props.className
|
|
|
|
|
return (
|
|
|
|
|
<div className={className}>
|
|
|
|
|
{
|
|
|
|
|
this.props.categories.map(
|
|
|
|
|
(category, index) => {
|
2016-12-21 15:24:07 +13:00
|
|
|
return <GridItem item={category} key={index} link={global.baseURL+'discover/categories/'+category.id} />
|
2016-11-08 13:36:13 +13:00
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2016-10-26 16:55:47 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|