Skip to content

Instantly share code, notes, and snippets.

@urielhdz
Created November 12, 2018 17:46
Show Gist options
  • Save urielhdz/2d61d5c7a2f0169a5a21d31e5e1ea55f to your computer and use it in GitHub Desktop.
Save urielhdz/2d61d5c7a2f0169a5a21d31e5e1ea55f to your computer and use it in GitHub Desktop.
import React from 'react';
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import CardMedia from '@material-ui/core/CardMedia';
import Typography from '@material-ui/core/Typography';
import { withStyles } from '@material-ui/core/styles';
function AlbumCard(props){
return(
<Card>
<CardMedia className={props.classes.media} image={props.album.coverPhotoBaseUrl} />
<CardContent>
<Typography variant="h5" component="h2" glutterbottom="true">{props.album.title}</Typography>
<Typography component="p">{props.album.mediaItemsCount} foto(s)</Typography>
</CardContent>
</Card>
);
}
export default withStyles({
media:{
minHeight: '200px'
}
})(AlbumCard);
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import AlbumCard from './AlbumCard';
function AlbumsList(props){
return(
{
props.albums.map((album,index)=>{
return(
<AlbumCard setAlbum={props.setAlbum} album={album} />
)
})
}
);
}
export default withStyles({})(AlbumsList);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment