Skip to content

Instantly share code, notes, and snippets.

@kilmc
Created August 14, 2018 01:36
Show Gist options
  • Select an option

  • Save kilmc/4bc70b7941b8f5cf7653d666d17e1145 to your computer and use it in GitHub Desktop.

Select an option

Save kilmc/4bc70b7941b8f5cf7653d666d17e1145 to your computer and use it in GitHub Desktop.
const audioArr = [
{
albumName: 'Time Management',
artwork: 'image.jpg',
releaseDate: '2015-10-02',
soundCloudLink: 'http://soundcloud.com/stuff',
spotifyLink: 'http://spotify.com',
iTunesLink: 'itunes.com'
},
{
albumName: 'I don\'t need anything from anybody (single)',
artwork: 'image.jpg',
releaseDate: '2015-03-30',
soundCloudLink: 'http://soundcloud.com/stuff',
spotifyLink: 'http://spotify.com',
iTunesLink: 'itunes.com'
},
{
albumName: 'Process',
artwork: 'image.jpg',
releaseDate: '2015-10-02',
soundCloudLink: 'http://soundcloud.com/stuff',
spotifyLink: 'http://spotify.com',
iTunesLink: 'itunes.com'
}
]
const Release = ({
albumName,
artwork,
releaseDate,
soundCloudLink,
spotifyLink,
iTunesLink
}) => {
return (
<div>
<img src={artwork}/>
<h3>{albumName}</h3>
<time>{releaseDate}</time>
<div>
{soundCloudLink}
</div>
<div>
<a href={spotifyLink}>Spotify</a>
<a href={iTunesLink}>iTunes</a>
</div>
</div>
)
}
const Audio = ({ releases }) => {
return (
releases.map(release => {
return (
<Release
albumName={release.albumName}
artwork={release.artwork}
releaseDate={release.releaseDate}
soundCloudLink={release.soundCloudLink}
spotifyLink={release.spotifyLink}
iTunesLink={release.iTunesLink}
/>
)
})
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment