Instantly share code, notes, and snippets.

@aakashns /AlbumArt.jsx Secret
Created May 25, 2016

Embed
What would you like to do?
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