diff --git a/src/page/file/view.js b/src/page/file/view.js index 23cec0e..7bfdbb6 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); @@ -963,7 +975,7 @@ class FilePage extends React.PureComponent { - Share + {__('Share')} this.setState({ showTipView: true })} > - Tip + {__('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 + {__('Edit')} )} {(completed || canEdit) && ( - Delete - - )} - - {!completed && - fileInfo && - !fileInfo.stopped && - fileInfo.written_bytes < fileInfo.total_bytes && - !this.state.stopDownloadConfirmed && ( - - - Stop Download + {__('Delete')} )} diff --git a/src/styles/filePage.js b/src/styles/filePage.js index 54f2058..078b53b 100644 --- a/src/styles/filePage.js +++ b/src/styles/filePage.js @@ -381,6 +381,15 @@ 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',