Add play icon to the Play button for media #220

Merged
akinwale merged 1 commit from play-icon into master 2018-08-08 16:53:10 +02:00
3 changed files with 17 additions and 14 deletions

View file

@ -1,5 +1,6 @@
import React from 'react';
import { NativeModules, Text, View, TouchableOpacity } from 'react-native';
import Button from '../button';
import fileDownloadButtonStyle from '../../styles/fileDownloadButton';
class FileDownloadButton extends React.PureComponent {
@ -64,17 +65,17 @@ class FileDownloadButton extends React.PureComponent {
);
}
return (
<TouchableOpacity style={[style, fileDownloadButtonStyle.container]} onPress={() => {
if (NativeModules.Mixpanel) {
NativeModules.Mixpanel.track('Purchase Uri', { Uri: uri });
}
purchaseUri(uri);
if (isPlayable && onPlay) {
this.props.onPlay();
}
}}>
<Text style={fileDownloadButtonStyle.text}>{isPlayable ? 'Play' : 'Download'}</Text>
</TouchableOpacity>
<Button icon={isPlayable ? 'play' : null}
text={isPlayable ? 'Play' : 'Download'}
style={[style, fileDownloadButtonStyle.container]} onPress={() => {
if (NativeModules.Mixpanel) {
NativeModules.Mixpanel.track('Purchase Uri', { Uri: uri });
}
purchaseUri(uri);
if (isPlayable && onPlay) {
this.props.onPlay();
}
}} />
);
} else if (fileInfo && fileInfo.download_path) {
return (

View file

@ -5,13 +5,14 @@ const buttonStyle = StyleSheet.create({
borderRadius: 24,
padding: 8,
paddingLeft: 12,
paddingRight: 12
paddingRight: 12,
alignItems: 'center',
justifyContent: 'center'
},
disabled: {
backgroundColor: '#999999'
},
row: {
alignSelf: 'flex-start',
flexDirection: 'row',
},
icon: {

View file

@ -20,7 +20,8 @@ const walletStyle = StyleSheet.create({
width: '85%'
},
button: {
backgroundColor: Colors.LbryGreen
backgroundColor: Colors.LbryGreen,
alignSelf: 'flex-start'
},
historyList: {
backgroundColor: '#ffffff'