-
-
Save vfonic/fb0cde967abd3e55b4ac70e44f8e5c7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import moment from 'moment'; | |
import LazyLoad from 'react-lazyload'; | |
import './albums.css' | |
export default (props)=>{ | |
function formatDate(date, format){ | |
return moment(date).format(format); | |
}; | |
return( | |
<ul className="album"> | |
<li className="imgs album-item"> | |
<a href={props.link} target="blank" className="link"> | |
<LazyLoad height={200} > | |
<img className="album-img"src={props.image} alt={'itunes'+Math.random()} /> | |
</LazyLoad> | |
</a> | |
</li> | |
<li className="title album-item"> | |
<a href={props.link} target="blank" className="link"> | |
{props.title.slice(0,20)}..</a></li> | |
<li className="price album-item">Price:{props.price}</li> | |
<li className="date album-item">Released:{formatDate(props.date,"MMM Do YY")}</li> | |
</ul> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment