-
-
Save aakashns/fcbaad68c605ff2fd6364cfcc89372ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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