improve markdown display
This commit is contained in:
parent
00dfc205a5
commit
8519b561b3
1 changed files with 23 additions and 4 deletions
|
@ -109,6 +109,7 @@ class FilePage extends React.PureComponent {
|
||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
StatusBar.setHidden(false);
|
StatusBar.setHidden(false);
|
||||||
|
console.log('fileComponent Focused...');
|
||||||
NativeModules.Firebase.setCurrentScreen('File').then(result => {
|
NativeModules.Firebase.setCurrentScreen('File').then(result => {
|
||||||
DeviceEventEmitter.addListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
DeviceEventEmitter.addListener('onStoragePermissionGranted', this.handleStoragePermissionGranted);
|
||||||
DeviceEventEmitter.addListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
DeviceEventEmitter.addListener('onStoragePermissionRefused', this.handleStoragePermissionRefused);
|
||||||
|
@ -652,13 +653,13 @@ class FilePage extends React.PureComponent {
|
||||||
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||||
const isViewable = mediaType === 'image' || mediaType === 'text';
|
const isViewable = mediaType === 'image' || mediaType === 'text';
|
||||||
|
|
||||||
const { permanent_url: uri } = claim;
|
const purchaseUrl = this.getPurchaseUrl();
|
||||||
NativeModules.Firebase.track('purchase_uri', { uri: uri });
|
NativeModules.Firebase.track('purchase_uri', { uri: purchaseUrl });
|
||||||
|
|
||||||
if (!isPlayable) {
|
if (!isPlayable) {
|
||||||
this.checkStoragePermissionForDownload();
|
this.checkStoragePermissionForDownload();
|
||||||
} else {
|
} else {
|
||||||
this.confirmPurchaseUri(uri, costInfo, !isPlayable);
|
this.confirmPurchaseUri(purchaseUrl, costInfo, !isPlayable);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (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 = () => {
|
onDownloadPressed = () => {
|
||||||
this.checkStoragePermissionForDownload();
|
this.checkStoragePermissionForDownload();
|
||||||
};
|
};
|
||||||
|
@ -796,6 +810,11 @@ class FilePage extends React.PureComponent {
|
||||||
'<html>' +
|
'<html>' +
|
||||||
' <head>' +
|
' <head>' +
|
||||||
' <meta charset="utf-8"/>' +
|
' <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>' +
|
' </head>' +
|
||||||
' <body>' +
|
' <body>' +
|
||||||
' <div id="content"></div>' +
|
' <div id="content"></div>' +
|
||||||
|
@ -842,7 +861,7 @@ class FilePage extends React.PureComponent {
|
||||||
<View style={filePageStyle.pageContainer}>
|
<View style={filePageStyle.pageContainer}>
|
||||||
<UriBar value={uri} navigation={navigation} />
|
<UriBar value={uri} navigation={navigation} />
|
||||||
{isResolvingUri && (
|
{isResolvingUri && (
|
||||||
<View stylebuildWeb={filePageStyle.busyContainer}>
|
<View style={filePageStyle.busyContainer}>
|
||||||
<ActivityIndicator size="large" color={Colors.NextLbryGreen} />
|
<ActivityIndicator size="large" color={Colors.NextLbryGreen} />
|
||||||
<Text style={filePageStyle.infoText}>{__('Loading decentralized data...')}</Text>
|
<Text style={filePageStyle.infoText}>{__('Loading decentralized data...')}</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
Loading…
Reference in a new issue