Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8519b561b3 | ||
|
|
00dfc205a5 | ||
|
|
b6ab92a700 | ||
|
|
561aa0db9c |
No files matched your search
+23
-4
@@ -109,6 +109,7 @@ class FilePage extends React.PureComponent {
|
||||
|
||||
onComponentFocused = () => {
|
||||
StatusBar.setHidden(false);
|
||||
console.log('fileComponent Focused...');
|
||||
NativeModules.Firebase.setCurrentScreen('File').then(result => {
|
||||
DeviceEventEmitter.addListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
||||
DeviceEventEmitter.addListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
||||
@@ -652,13 +653,13 @@ class FilePage extends React.PureComponent {
|
||||
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||
const isViewable = mediaType === 'image' || mediaType === 'text';
|
||||
|
||||
const { permanent_url: uri } = claim;
|
||||
NativeModules.Firebase.track('purchase_uri', { uri: uri });
|
||||
const purchaseUrl = this.getPurchaseUrl();
|
||||
NativeModules.Firebase.track('purchase_uri', { uri: purchaseUrl });
|
||||
|
||||
if (!isPlayable) {
|
||||
this.checkStoragePermissionForDownload();
|
||||
} else {
|
||||
this.confirmPurchaseUri(uri, costInfo, !isPlayable);
|
||||
this.confirmPurchaseUri(purchaseUrl, costInfo, !isPlayable);
|
||||
}
|
||||
|
||||
if (isPlayable) {
|
||||
@@ -671,6 +672,19 @@ class FilePage extends React.PureComponent {
|
||||
}
|
||||
};
|
||||
|
||||
getPurchaseUrl = () => {
|
||||
const { claim, navigation } = this.props;
|
||||
const { permanent_url: permanentUrl } = claim;
|
||||
|
||||
let purchaseUrl;
|
||||
if (navigation.state.params) {
|
||||
const { uri, fullUri } = navigation.state.params;
|
||||
purchaseUrl = fullUri || uri || permanentUrl;
|
||||
}
|
||||
|
||||
return purchaseUrl;
|
||||
};
|
||||
|
||||
onDownloadPressed = () => {
|
||||
this.checkStoragePermissionForDownload();
|
||||
};
|
||||
@@ -796,6 +810,11 @@ class FilePage extends React.PureComponent {
|
||||
'<html>' +
|
||||
' <head>' +
|
||||
' <meta charset="utf-8"/>' +
|
||||
' <meta name="viewport" content="width=device-width, user-scalable=no"/>' +
|
||||
' <style type="text/css">' +
|
||||
' body { margin: 16px }' +
|
||||
' img { width: 100%; }' +
|
||||
' </style>' +
|
||||
' </head>' +
|
||||
' <body>' +
|
||||
' <div id="content"></div>' +
|
||||
@@ -842,7 +861,7 @@ class FilePage extends React.PureComponent {
|
||||
<View style={filePageStyle.pageContainer}>
|
||||
<UriBar value={uri} navigation={navigation} />
|
||||
{isResolvingUri && (
|
||||
<View stylebuildWeb={filePageStyle.busyContainer}>
|
||||
<View style={filePageStyle.busyContainer}>
|
||||
<ActivityIndicator size="large" color={Colors.NextLbryGreen} />
|
||||
<Text style={filePageStyle.infoText}>{__('Loading decentralized data...')}</Text>
|
||||
</View>
|
||||
|
||||
@@ -24,6 +24,8 @@ const Colors = {
|
||||
StatsAudio: '#f6a637',
|
||||
StatsImage: '#ff4a7d',
|
||||
StatsOther: '#26bcf7',
|
||||
|
||||
ThumbnailPlaceholder: '#d5d5d5',
|
||||
};
|
||||
|
||||
export default Colors;
|
||||
@@ -32,6 +32,7 @@ const fileListStyle = StyleSheet.create({
|
||||
color: Colors.White,
|
||||
},
|
||||
thumbnail: {
|
||||
backgroundColor: Colors.ThumbnailPlaceholder,
|
||||
width: thumbnailWidth,
|
||||
height: thumbnailHeight,
|
||||
marginRight: screenWidthPixels <= 720 ? 10 : 12,
|
||||
|
||||
@@ -65,7 +65,6 @@ const filePageStyle = StyleSheet.create({
|
||||
titleRow: {
|
||||
flexDirection: 'row',
|
||||
marginTop: 12,
|
||||
marginBottom: 2,
|
||||
marginLeft: 12,
|
||||
marginRight: 12,
|
||||
alignItems: 'center',
|
||||
|
||||
@@ -46,8 +46,8 @@ const floatingButtonStyle = StyleSheet.create({
|
||||
fontSize: 16,
|
||||
},
|
||||
bottomRight: {
|
||||
right: 10,
|
||||
bottom: 10,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
},
|
||||
rewardIcon: {
|
||||
color: Colors.White,
|
||||
|
||||
Reference in new issue
Block a user