Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
[RelatedArtists] Artist images use fixed width and height parameters …
Browse files Browse the repository at this point in the history
…instead of aspectRatio prop
  • Loading branch information
sarahscott committed May 6, 2016
1 parent de84dac commit 64cb2ea
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion lib/components/artist/related_artists/index.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ class RelatedArtists extends React.Component {
<View style={styles.container}>
<SerifText style={styles.heading}>Related Artists</SerifText>
<View style={styles.artistContainer}>
{ artists.map(artist => <RelatedArtist styles={{margin: 10}} key={artist.id} artist={artist} /> )}
{ artists.map(artist => <RelatedArtist key={artist.id} artist={artist} /> )}
</View>
</View>
);
@@ -33,7 +33,10 @@ const styles = StyleSheet.create({
artistContainer: {
flexWrap: 'wrap',
flexDirection: 'row',
justifyContent: 'space-around',
marginTop: 20,
marginLeft: -10,
marginRight: -10,
},
heading: {
marginTop: 20,
6 changes: 2 additions & 4 deletions lib/components/artist/related_artists/related_artist.js
Original file line number Diff line number Diff line change
@@ -15,11 +15,9 @@ class RelatedArtist extends React.Component {
const {height, width} = Dimensions.get('window');
const imageWidth = (width - 60)/2;
const imageAspectRatio = 1.5;
console.log(imageWidth, width);
return (
<View style={{ width: imageWidth }}>
<ImageView style={{ height: imageWidth/1.5 }}
aspectRatio={1.5}
<View style={{paddingBottom: 30, width: imageWidth}}>
<ImageView style={{ width: imageWidth, height: imageWidth/imageAspectRatio }}
imageURL={artist.image.url} />
<Text style={styles.sansSerifText}>{artist.name.toUpperCase()}</Text>
<Text style={styles.serifText}>{this.artworksString(artist.counts)}</Text>

0 comments on commit 64cb2ea

Please sign in to comment.