Files
Iris/src/js/components/AlbumGrid.js

33 lines
679 B
JavaScript
Raw Normal View History

import React, { PropTypes } from 'react'
2016-10-25 14:09:53 +13:00
import GridItem from './GridItem'
export default class AlbumGrid extends React.Component{
constructor(props) {
super(props);
}
render(){
2016-10-25 21:36:33 +13:00
if( this.props.albums ){
2016-10-26 08:51:28 +13:00
var className = "grid album-grid"
if( this.props.className ) className += ' '+this.props.className
return (
2016-10-26 08:51:28 +13:00
<div className={className}>
{
2016-10-25 21:36:33 +13:00
this.props.albums.map(
(album, index) => {
2016-10-25 14:09:53 +13:00
var link = album.uri;
if( album.album ) link = album.album.uri;
return <GridItem item={album} key={index} link={'/album/'+link} />
}
)
}
2016-10-26 08:51:28 +13:00
</div>
);
}
return null;
}
}