Merge pull request #220 from lbryio/play-icon

Add play icon to the Play button for media
This commit is contained in:
Akinwale Ariwodola 2018-08-08 15:53:09 +01:00 committed by GitHub
commit 2672144dbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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'