diff --git a/app/src/component/AppNavigator.js b/app/src/component/AppNavigator.js index 92bc1e60..266683d6 100644 --- a/app/src/component/AppNavigator.js +++ b/app/src/component/AppNavigator.js @@ -66,6 +66,7 @@ const discoverStack = createStackNavigator({ navigationOptions: ({ navigation }) => ({ title: 'Discover', headerLeft: menuNavigationButton(navigation), + headerTitleStyle: discoverStyle.titleText }) }, File: { @@ -78,7 +79,8 @@ const discoverStack = createStackNavigator({ Search: { screen: SearchPage, navigationOptions: ({ navigation }) => ({ - drawerLockMode: 'locked-closed' + drawerLockMode: 'locked-closed', + headerTitleStyle: discoverStyle.titleText }) } }, { @@ -91,6 +93,7 @@ const trendingStack = createStackNavigator({ navigationOptions: ({ navigation }) => ({ title: 'Trending', headerLeft: menuNavigationButton(navigation), + headerTitleStyle: discoverStyle.titleText }) } }); @@ -101,6 +104,7 @@ const myLbryStack = createStackNavigator({ navigationOptions: ({ navigation }) => ({ title: 'My LBRY', headerLeft: menuNavigationButton(navigation), + headerTitleStyle: discoverStyle.titleText }) } }); @@ -111,6 +115,7 @@ const rewardsStack = createStackNavigator({ navigationOptions: ({ navigation }) => ({ title: 'Rewards', headerLeft: menuNavigationButton(navigation), + headerTitleStyle: discoverStyle.titleText }) } }); @@ -121,13 +126,15 @@ const walletStack = createStackNavigator({ navigationOptions: ({ navigation }) => ({ title: 'Wallet', headerLeft: menuNavigationButton(navigation), + headerTitleStyle: discoverStyle.titleText }) }, TransactionHistory: { screen: TransactionHistoryPage, navigationOptions: { title: 'Transaction History', - drawerLockMode: 'locked-closed' + drawerLockMode: 'locked-closed', + headerTitleStyle: discoverStyle.titleText } } }, { @@ -162,7 +169,8 @@ const drawer = createDrawerNavigator({ drawerWidth: 300, headerMode: 'none', contentOptions: { - activeTintColor: Colors.LbryGreen + activeTintColor: Colors.LbryGreen, + labelStyle: discoverStyle.menuText } }); diff --git a/app/src/component/walletSend/index.js b/app/src/component/walletSend/index.js index e57233ea..080f0a66 100644 --- a/app/src/component/walletSend/index.js +++ b/app/src/component/walletSend/index.js @@ -8,15 +8,15 @@ import { } from 'lbry-redux'; import WalletSend from './view'; -const perform = dispatch => ({ - sendToAddress: (address, amount) => dispatch(doSendDraftTransaction(address, amount)), - notify: (data) => dispatch(doToast(data)) -}); - const select = state => ({ balance: selectBalance(state), draftTransaction: selectDraftTransaction(state), transactionError: selectDraftTransactionError(state), }); +const perform = dispatch => ({ + sendToAddress: (address, amount) => dispatch(doSendDraftTransaction(address, amount)), + notify: (data) => dispatch(doToast(data)) +}); + export default connect(select, perform)(WalletSend); diff --git a/app/src/constants.js b/app/src/constants.js index 003ec2d0..47645200 100644 --- a/app/src/constants.js +++ b/app/src/constants.js @@ -6,6 +6,11 @@ const Constants = { ACTION_DELETE_COMPLETED_BLOBS: "DELETE_COMPLETED_BLOBS", ACTION_FIRST_RUN_PAGE_CHANGED: "FIRST_RUN_PAGE_CHANGED", + + PAGE_REWARDS: 'rewards', + PAGE_SETTINGS: 'settings', + PAGE_TRENDING: 'trending', + PAGE_WALLET: 'wallet' }; export default Constants; diff --git a/app/src/page/about/index.js b/app/src/page/about/index.js index e389db20..fd767ed9 100644 --- a/app/src/page/about/index.js +++ b/app/src/page/about/index.js @@ -1,4 +1,5 @@ import { connect } from 'react-redux'; +import { doToast } from 'lbry-redux'; import { doFetchAccessToken, selectAccessToken, selectUserEmail } from 'lbryinc'; import AboutPage from './view'; @@ -9,6 +10,7 @@ const select = state => ({ const perform = dispatch => ({ fetchAccessToken: () => dispatch(doFetchAccessToken()), + notify: data => dispatch(doToast(data)), }); export default connect(select, perform)(AboutPage); \ No newline at end of file diff --git a/app/src/page/about/view.js b/app/src/page/about/view.js index 190fe3f1..d67b586a 100644 --- a/app/src/page/about/view.js +++ b/app/src/page/about/view.js @@ -33,7 +33,7 @@ class AboutPage extends React.PureComponent { } render() { - const { accessToken, navigation, userEmail } = this.props; + const { accessToken, navigation, notify, userEmail } = this.props; const loading = 'Loading...'; const ver = this.state.versionInfo ? this.state.versionInfo : null; @@ -75,7 +75,7 @@ class AboutPage extends React.PureComponent { @@ -102,6 +102,21 @@ class AboutPage extends React.PureComponent { {this.state.lbryId ? this.state.lbryId : loading} + + + Logs + + { + if (NativeModules.UtilityModule) { + NativeModules.UtilityModule.shareLogFile((error) => { + if (error) { + notify(error); + } + }); + } + }} /> + + ); diff --git a/app/src/page/file/index.js b/app/src/page/file/index.js index 36256b1b..888a2695 100644 --- a/app/src/page/file/index.js +++ b/app/src/page/file/index.js @@ -3,6 +3,7 @@ import { doFetchFileInfo, doFetchCostInfoForUri, doResolveUri, + doSendTip, doToast, makeSelectIsUriResolving, makeSelectCostInfoForUri, @@ -10,6 +11,7 @@ import { makeSelectClaimForUri, makeSelectContentTypeForUri, makeSelectMetadataForUri, + selectBalance, selectBlackListedOutpoints, } from 'lbry-redux'; import { selectRewardContentClaimIds } from 'lbryinc'; @@ -19,6 +21,7 @@ import FilePage from './view'; const select = (state, props) => { const selectProps = { uri: props.navigation.state.params.uri }; return { + balance: selectBalance(state), blackListedOutpoints: selectBlackListedOutpoints(state), claim: makeSelectClaimForUri(selectProps.uri)(state), isResolvingUri: makeSelectIsUriResolving(selectProps.uri)(state), @@ -40,6 +43,7 @@ const perform = dispatch => ({ fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)), notify: data => dispatch(doToast(data)), resolveUri: uri => dispatch(doResolveUri(uri)), + sendTip: (amount, claimId, uri, successCallback, errorCallback) => dispatch(doSendTip(amount, claimId, uri, successCallback, errorCallback)), stopDownload: (uri, fileInfo) => dispatch(doStopDownloadingFile(uri, fileInfo)), }); diff --git a/app/src/page/file/view.js b/app/src/page/file/view.js index b6f2d928..66dd066c 100644 --- a/app/src/page/file/view.js +++ b/app/src/page/file/view.js @@ -37,6 +37,8 @@ class FilePage extends React.PureComponent { title: '' }; + tipAmountInput = null; + playerBackground = null; startTime = null; @@ -55,8 +57,10 @@ class FilePage extends React.PureComponent { pageSuspended: false, showImageViewer: false, showWebView: false, + showTipView: false, playerBgHeight: 0, playerHeight: 0, + tipAmount: null, uri: null, stopDownloadConfirmed: false }; @@ -310,6 +314,21 @@ class FilePage extends React.PureComponent { this.setState({ fileViewLogged: true }); } + handleSendTip = () => { + const { claim, balance, navigation, notify, sendTip } = this.props; + const { uri } = navigation.state.params; + const { tipAmount } = this.state; + + if (tipAmount > balance) { + notify({ + message: 'Insufficient credits', + }); + return; + } + + sendTip(tipAmount, claim.claim_id, uri, () => { this.setState({ tipAmount: 0, showTipView: false }) }); + } + render() { const { claim, @@ -378,12 +397,12 @@ class FilePage extends React.PureComponent { const mediaType = Lbry.getMediaType(contentType); const isPlayable = mediaType === 'video' || mediaType === 'audio'; const { height, channel_name: channelName, value } = claim; - const showActions = !this.state.fullscreenMode && - !this.state.showImageViewer && - !this.state.showWebView && - (completed || (fileInfo && !fileInfo.stopped && fileInfo.written_bytes < fileInfo.total_bytes)); + const showActions = !this.state.fullscreenMode && !this.state.showImageViewer && !this.state.showWebView; + const showFileActions = (completed || (fileInfo && !fileInfo.stopped && fileInfo.written_bytes < fileInfo.total_bytes)); const channelClaimId = value && value.publisherSignature && value.publisherSignature.certificateId; + const canSendTip = this.state.tipAmount > 0; + const playerStyle = [filePageStyle.player, this.state.isLandscape ? filePageStyle.containedPlayerLandscape : @@ -473,21 +492,29 @@ class FilePage extends React.PureComponent { onPlaybackStarted={this.onPlaybackStarted} />} - {fileInfo && showActions && + {showActions && - {completed &&