-
-
Save aakashns/ac09a78c4f72619c81793509279c752d 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 TrackDetails = ({ | |
title, | |
artist, | |
onAddPress, | |
onMorePress, | |
onTitlePress, | |
onArtistPress, | |
}) => ( | |
<View style={styles.container}> | |
<TouchableOpacity onPress={onAddPress}> | |
<Image style={styles.button} | |
source={require('../img/ic_add_circle_outline_white.png')} /> | |
</TouchableOpacity> | |
<View style={styles.detailsWrapper}> | |
<Text style={styles.title} onPress={onTitlePress}>{title}</Text> | |
<Text style={styles.artist} onPress={onArtistPress}>{artist}</Text> | |
</View> | |
<TouchableOpacity onPress={onMorePress}> | |
<View style={styles.moreButton}> | |
<Image style={styles.moreButtonIcon} | |
source={require('../img/ic_more_horiz_white.png')} /> | |
</View> | |
</TouchableOpacity> | |
</View> | |
); | |
export default TrackDetails; | |
const styles = StyleSheet.create({ | |
container: { | |
paddingTop: 24, | |
flexDirection: 'row', | |
paddingLeft: 20, | |
alignItems: 'center', | |
paddingRight: 20, | |
}, | |
detailsWrapper: { | |
justifyContent: 'center', | |
alignItems: 'center', | |
flex: 1, | |
}, | |
title: { | |
fontSize: 16, | |
fontWeight: 'bold', | |
color: 'white', | |
textAlign: 'center', | |
}, | |
artist: { | |
color: 'rgba(255, 255, 255, 0.72)', | |
fontSize: 12, | |
marginTop: 4, | |
}, | |
button: { | |
opacity: 0.72, | |
}, | |
moreButton: { | |
borderColor: 'rgb(255, 255, 255)', | |
borderWidth: 2, | |
opacity: 0.72, | |
borderRadius: 10, | |
width: 20, | |
height: 20, | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
moreButtonIcon: { | |
height: 17, | |
width: 17, | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment