Skip to content

Instantly share code, notes, and snippets.

@aakashns
Created May 25, 2016 19:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aakashns/fcbaad68c605ff2fd6364cfcc89372ca to your computer and use it in GitHub Desktop.
Save aakashns/fcbaad68c605ff2fd6364cfcc89372ca to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import {
View,
Text,
StyleSheet,
Image,
TouchableHighlight,
TouchableOpacity,
Dimensions,
} from 'react-native';
const AlbumArt = ({
url,
onPress
}) => (
<View style={styles.container}>
<TouchableOpacity onPress={onPress}>
<Image
style={styles.image}
source={{uri: url}}
/>
</TouchableOpacity>
</View>
);
export default AlbumArt;
const { width, height } = Dimensions.get('window');
const imageSize = width - 48;
const styles = StyleSheet.create({
container: {
paddingLeft: 24,
paddingRight: 24,
},
image: {
width: imageSize,
height: imageSize,
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment