diff --git a/src/page/discover/view.js b/src/page/discover/view.js
index 683deb2..59275ea 100644
--- a/src/page/discover/view.js
+++ b/src/page/discover/view.js
@@ -86,11 +86,9 @@ class DiscoverPage extends React.PureComponent {
}
onComponentFocused = () => {
- const { fetchSubscriptions, pushDrawerStack } = this.props;
+ const { pushDrawerStack } = this.props;
// pushDrawerStack();
- NativeModules.Firebase.setCurrentScreen('Your tags').then(result => {
- fetchSubscriptions();
- });
+ NativeModules.Firebase.setCurrentScreen('Your tags');
};
handleSortByItemSelected = item => {
@@ -123,46 +121,6 @@ class DiscoverPage extends React.PureComponent {
return null;
};
- componentDidUpdate(prevProps, prevState) {
- const { unreadSubscriptions, enabledChannelNotifications } = this.props;
-
- const utility = NativeModules.UtilityModule;
- const hasUnread =
- prevProps.unreadSubscriptions &&
- prevProps.unreadSubscriptions.length !== unreadSubscriptions.length &&
- unreadSubscriptions.length > 0;
-
- if (hasUnread) {
- unreadSubscriptions.map(({ channel, uris }) => {
- const { claimName: channelName } = parseURI(channel);
-
- // check if notifications are enabled for the channel
- if (enabledChannelNotifications.includes(channelName)) {
- uris.forEach(uri => {
- Lbry.resolve({ urls: uri }).then(result => {
- const sub = result[uri];
-
- if (sub && sub.value) {
- const { source, title, thumbnail } = sub.value;
- const isPlayable =
- source && source.media_type && ['audio', 'video'].includes(source.media_type.substring(0, 5));
- if (title) {
- utility.showNotificationForContent(
- uri,
- title,
- channelName,
- thumbnail ? thumbnail.url : null,
- isPlayable
- );
- }
- }
- });
- });
- }
- });
- }
- }
-
showRatingReminder = () => {
const { ratingReminderDisabled, ratingReminderLastShown, setClientSetting } = this.props;
diff --git a/src/page/file/view.js b/src/page/file/view.js
index ca60296..23c6af4 100644
--- a/src/page/file/view.js
+++ b/src/page/file/view.js
@@ -597,6 +597,18 @@ class FilePage extends React.PureComponent {
setPlayerVisible();
};
+ onDownloadPressed = () => {
+ const { claim, costInfo, purchaseUri } = this.props;
+ this.setState(
+ {
+ downloadPressed: true,
+ autoPlayMedia: false,
+ stopDownloadConfirmed: false,
+ },
+ () => purchaseUri(claim.permanent_url, costInfo, true)
+ );
+ };
+
onBackButtonPressed = () => {
const { navigation, drawerStack, popDrawerStack } = this.props;
navigateBack(navigation, drawerStack, popDrawerStack);
@@ -819,7 +831,7 @@ class FilePage extends React.PureComponent {
{!this.state.fullscreenMode && }
{this.state.showWebView && isWebViewable && (
-
+
)}
{this.state.showImageViewer && (
@@ -938,48 +950,8 @@ class FilePage extends React.PureComponent {
/>
)}
- {showActions && showFileActions && (
-
- {showFileActions && (
-
- {canEdit && (
-
- )}
-
- {(completed || canEdit) && (
-
- )}
- {!completed &&
- fileInfo &&
- !fileInfo.stopped &&
- fileInfo.written_bytes < fileInfo.total_bytes &&
- !this.state.stopDownloadConfirmed && (
-
- )}
-
- )}
-
- )}
{
@@ -1015,13 +987,50 @@ class FilePage extends React.PureComponent {
{__('Tip')}
- Linking.openURL(`https://lbry.com/dmca/${claim.claim_id}`)}
- >
-
- {__('Report')}
-
+
+ {!isPlayable && !fileInfo && (
+
+
+ {__('Download')}
+
+ )}
+
+ {!completed &&
+ fileInfo &&
+ !fileInfo.stopped &&
+ fileInfo.written_bytes > 0 &&
+ fileInfo.written_bytes < fileInfo.total_bytes &&
+ !this.state.stopDownloadConfirmed && (
+
+
+ {__('Stop')}
+
+ )}
+
+
+ {!canEdit && (
+ Linking.openURL(`https://lbry.com/dmca/${claim.claim_id}`)}
+ >
+
+ {__('Report')}
+
+ )}
+
+ {canEdit && (
+
+
+ {__('Edit')}
+
+ )}
+
+ {(completed || canEdit) && (
+
+
+ {__('Delete')}
+
+ )}
diff --git a/src/styles/filePage.js b/src/styles/filePage.js
index 77ff2a0..078b53b 100644
--- a/src/styles/filePage.js
+++ b/src/styles/filePage.js
@@ -381,10 +381,19 @@ const filePageStyle = StyleSheet.create({
backButtonIcon: {
color: Colors.White,
},
+ sharedLargeButton: {
+ alignItems: 'center',
+ justifyContent: 'center',
+ marginRight: 36,
+ },
+ innerLargeButton: {
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
largeButton: {
alignItems: 'center',
justifyContent: 'center',
- marginRight: 48,
+ marginRight: 36,
},
largeButtonIcon: {
color: Colors.DescriptionGrey,