Compare commits

..
12 Commits
54 changed files with 355 additions and 1027 deletions

No files matched your search

-242
View File
@@ -1,242 +0,0 @@
{
"Waiting for name resolution": "Waiting for name resolution",
"Starting up": "Starting up",
"Connecting": "Connecting",
"Unlocking account": "Unlocking account",
"Decrypting wallet": "Decrypting wallet",
"Your Tags": "Your Tags",
"Customize": "Customize",
"Find content": "Find content",
"Your content": "Your content",
"Wallet": "Wallet",
"All tags you follow": "All tags you follow",
"FREE": "FREE",
"Delete": "Delete",
"Share": "Share",
"Tip": "Tip",
"Report": "Report",
"View": "View",
"Follow": "Follow",
"Fetching cost info...": "Fetching cost info...",
"Play": "Play",
"Channels you follow": "Channels you follow",
"Suggested": "Suggested",
"ALL": "ALL",
"No content to display at this time. Please check back later.": "No content to display at this time. Please check back later.",
"All Content": "All Content",
"Create a channel": "Create a channel",
"Title": "Title",
"Channel": "Channel",
"Deposit": "Deposit",
"This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.": "This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.",
"Show optional fields": "Show optional fields",
"Cancel": "Cancel",
"Create": "Create",
"Description": "Description",
"Website": "Website",
"Email": "Email",
"Tags": "Tags",
"Hide optional fields": "Hide optional fields",
"Mature tags": "Mature tags",
"Other": "Other",
"Publish something new": "Publish something new",
"Record": "Record",
"Take a photo": "Take a photo",
"Upload a file": "Upload a file",
"Please wait while we load your videos...": "Please wait while we load your videos...",
"Price": "Price",
"Your content will be free. Press the toggle to set a price.": "Your content will be free. Press the toggle to set a price.",
"Content address": "Content address",
"The address where people can find your content (ex. lbry://myvideo). ": "The address where people can find your content (ex. lbry://myvideo). ",
"This LBC remains yours and the deposit can be undone at any time.": "This LBC remains yours and the deposit can be undone at any time.",
"Show extra fields": "Show extra fields",
"Publish": "Publish",
"Additional Options": "Additional Options",
"Language": "Language",
"License": "License",
"None": "None",
"Public Domain": "Public Domain",
"Copyrighted...": "Copyrighted...",
"Other...": "Other...",
"Hide extra fields": "Hide extra fields",
"Balance": "Balance",
"You currently have": "You currently have",
"Receive Credits": "Receive Credits",
"Use this wallet address to receive credits sent by another user (or yourself).": "Use this wallet address to receive credits sent by another user (or yourself).",
"Get new address": "Get new address",
"You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.": "You can generate a new address at any time, and any previous addresses will continue to work. Using multiple addresses can be helpful for keeping track of incoming payments from multiple sources.",
"Send Credits": "Send Credits",
"Recipient address": "Recipient address",
"Amount": "Amount",
"View All": "View All",
"Looks like you don't have any recent transactions.": "Looks like you don't have any recent transactions.",
"Wallet Sync": "Wallet Sync",
"Sync status": "Sync status",
"On": "On",
"Connected email": "Connected email",
"Manual backup": "Manual backup",
"Fetching transactions...": "Fetching transactions...",
"Loading transactions...": "Loading transactions...",
"The transaction URL could not be opened": "The transaction URL could not be opened",
"LBRY credits allow you to purchase content, publish content, and influence the network.": "LBRY credits allow you to purchase content, publish content, and influence the network.",
"You get credits for free for providing an email address and taking other basic actions.": "You get credits for free for providing an email address and taking other basic actions.",
"Learn more": "Learn more",
"Not interested": "Not interested",
"Get started": "Get started",
"Fetching rewards...": "Fetching rewards...",
"Custom Code": "Custom Code",
"Are you a supermodel or rockstar that received a custom reward code? Claim it here.": "Are you a supermodel or rockstar that received a custom reward code? Claim it here.",
"Settings": "Settings",
"Content": "Content",
"Enable background media playback": "Enable background media playback",
"Enable this option to play audio or video in the background when the app is suspended.": "Enable this option to play audio or video in the background when the app is suspended.",
"Choose language": "Choose language",
"Show mature content": "Show mature content",
"Notifications": "Notifications",
"Choose the notifications you would like to receive.": "Choose the notifications you would like to receive.",
"Subscriptions": "Subscriptions",
"Rewards": "Rewards",
"Content Interests": "Content Interests",
"Search": "Search",
"Show URL suggestions": "Show URL suggestions",
"Keep the SDK background service running after closing the app": "Keep the SDK background service running after closing the app",
"Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date.": "Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date.",
"Loading...": "Loading...",
"LBRY is a free, open, and community-run digital marketplace. It is a decentralized peer-to-peer content distribution platform for creators to upload and share content, and earn LBRY credits for their effort. Users will be able to find a wide selection of videos, music, ebooks and other digital content they are interested in.": "LBRY is a free, open, and community-run digital marketplace. It is a decentralized peer-to-peer content distribution platform for creators to upload and share content, and earn LBRY credits for their effort. Users will be able to find a wide selection of videos, music, ebooks and other digital content they are interested in.",
"What is LBRY?": "What is LBRY?",
"Android App Basics": "Android App Basics",
"Frequently Asked Questions": "Frequently Asked Questions",
"You can interact with the LBRY team and members of the community on Discord, Facebook, Instagram, Twitter or Reddit.": "You can interact with the LBRY team and members of the community on Discord, Facebook, Instagram, Twitter or Reddit.",
"App info": "App info",
"Update mailing preferences": "Update mailing preferences",
"App version": "App version",
"LBRY SDK": "LBRY SDK",
"Platform": "Platform",
"Installation ID": "Installation ID",
"Logs": "Logs",
"Send log": "Send log",
"Testing network": "Testing network",
"Spanish": "Spanish",
"Portuguese": "Portuguese",
"Polish": "Polish",
"Malay": "Malay",
"Please wait while we get some things ready...": "Please wait while we get some things ready...",
"LBRY is a community-controlled content platform where you can find and publish videos, music, books, and more.": "LBRY is a community-controlled content platform where you can find and publish videos, music, books, and more.",
"Continue": "Continue",
"Setup account": "Setup account",
"An account will allow you to earn rewards and keep your account and settings synced.": "An account will allow you to earn rewards and keep your account and settings synced.",
"This information is disclosed only to LBRY, Inc. and not to the LBRY network.": "This information is disclosed only to LBRY, Inc. and not to the LBRY network.",
"No, thanks": "No, thanks",
"Use LBRY": "Use LBRY",
"Are you sure?": "Are you sure?",
"Without an account, you will not receive rewards, sync and backup services, or security updates.": "Without an account, you will not receive rewards, sync and backup services, or security updates.",
"I understand that by uninstalling LBRY I will lose any balances or published content with no recovery option if it is not backed up manually (see wallet page)": "I understand that by uninstalling LBRY I will lose any balances or published content with no recovery option if it is not backed up manually (see wallet page)",
"Change email": "Change email",
"Your email address was successfully verified.": "Your email address was successfully verified.",
"Retrieving your account information...": "Retrieving your account information...",
"Synchronizing": "Synchronizing",
"Validating password": "Validating password",
"Invalid password specified. Please enter the password for your previously synchronised wallet.": "Invalid password specified. Please enter the password for your previously synchronised wallet.",
"Please enter the password you used to secure your wallet.": "Please enter the password you used to secure your wallet.",
"If you did not provide a password, please press Use LBRY to continue.": "If you did not provide a password, please press Use LBRY to continue.",
"Note: for wallet security purposes, LBRY is unable to reset your password.": "Note: for wallet security purposes, LBRY is unable to reset your password.",
"More tags you follow": "More tags you follow",
"Blockchain Sync": "Blockchain Sync",
"Network Loading": "Network Loading",
"Initializing LBRY service": "Initializing LBRY service",
"Sign In": "Sign In",
"SIGN IN": "SIGN IN",
"You have not created a channel.\nStart now by creating a new channel!": "You have not created a channel.\nStart now by creating a new channel!",
"Send verification email": "Send verification email",
"You do not have any\ndownloaded content on this device.": "You do not have any\ndownloaded content on this device.",
"It looks like you have not\npublished any content to LBRY yet.": "It looks like you have not\npublished any content to LBRY yet.",
"An account with LBRY Inc. allows you to earn rewards, backup your wallet, and keep everything synced.": "An account with LBRY Inc. allows you to earn rewards, backup your wallet, and keep everything synced.",
"Without an account, you assume all responsibility for securing your wallet and LBRY data.": "Without an account, you assume all responsibility for securing your wallet and LBRY data.",
"Skip Account": "Skip Account",
"Sign Up": "Sign Up",
"Indonesian": "Indonesian",
"Hindi": "Hindi",
"Verify Email": "Verify Email",
"Resend": "Resend",
"Edit": "Edit",
"Please follow the instructions in the email sent to your address to continue.": "Please follow the instructions in the email sent to your address to continue.",
"Please enter a password to secure your account and wallet.": "Please enter a password to secure your account and wallet.",
"Anonymous": "Anonymous",
"Connecting...": "Connecting...",
"Gujarati": "Gujarati",
"Turkish": "Turkish",
"Italian": "Italian",
"English": "English",
"Use device language": "Use device language",
"Tags you follow": "Tags you follow",
"Everyone": "Everyone",
"Greek": "Greek",
"Romanian": "Romanian",
"Norwegian": "Norwegian",
"Korean": "Korean",
"Cambodian": "Cambodian",
"Croatian": "Croatian",
"Czech": "Czech",
"Arabic": "Arabic",
"Thai": "Thai",
"Vietnamese": "Vietnamese",
"Dutch": "Dutch",
"Russian": "Russian",
"Japanese": "Japanese",
"German": "German",
"Trending": "Trending",
"Channels": "Channels",
"Library": "Library",
"Publishes": "Publishes",
"New Publish": "New Publish",
"About": "About",
"Sort content by": "Sort content by",
"Trending content": "Trending content",
"New content": "New content",
"Top content": "Top content",
"Search movies, music, and more": "Search movies, music, and more",
"Please provide a valid email address to continue.": "Please provide a valid email address to continue.",
"A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.": "A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.",
"%num% blocks behind": "%num% blocks behind",
"Catching up with the blockchain ($%progress%%)": "Catching up with the blockchain ($%progress%%)",
"Catching up with the blockchain (%progress%%)": "Catching up with the blockchain (%progress%%)",
"Get %amount% free credits after creating an account.": "Get %amount% free credits after creating an account.",
"Off": "Off",
"Sync FAQ": "Sync FAQ",
"Please provide an email address.": "Please provide an email address.",
"An email has been sent to": "An email has been sent to",
"Please click the link in the message to complete signing in.": "Please click the link in the message to complete signing in.",
"%amount% free credits available in rewards.": "%amount% free credits available in rewards.",
"Tap to learn more.": "Tap to learn more.",
"password": "password",
"Enable sync": "Enable sync",
"Disable wallet sync": "Disable wallet sync",
"Are you sure you want to turn off wallet sync?": "Are you sure you want to turn off wallet sync?",
"No": "No",
"Yes": "Yes",
"Wallet sync was successfully disabled.": "Wallet sync was successfully disabled.",
"more": "more",
"Related Content": "Related Content",
"There are no results to display for \"%query%\". Please try a different search term.": "There are no results to display for \"%query%\". Please try a different search term.",
"Download": "Download",
"This content is Not Safe For Work. To view adult content, please change your Settings.": "This content is Not Safe For Work. To view adult content, please change your Settings.",
"Stop": "Stop",
"%progress%% complete": "%progress%% complete",
"Customize your tags": "Customize your tags",
"Done": "Done",
"Search for more tags": "Search for more tags",
"Send": "Send",
"Recent Transactions": "Recent Transactions",
"Nothing here. Publish something!": "Nothing here. Publish something!",
"CONTENT": "CONTENT",
"ABOUT": "ABOUT",
"New": "New",
"Content Freedom": "Content Freedom",
"Get Social": "Get Social",
"used": "used",
"Stats": "Stats",
"Welcome to LBRY.": "Welcome to LBRY.",
"Account Recommended": "Account Recommended",
"%amount% available credits": "%amount% available credits",
"%amount% available credit": "%amount% available credit"
}
+2 -2
View File
@@ -5640,8 +5640,8 @@
}
},
"lbry-redux": {
"version": "github:lbryio/lbry-redux#9b11cfed62af7f0f8eb6fa3c88a1f8d2cce46afc",
"from": "github:lbryio/lbry-redux#9b11cfed62af7f0f8eb6fa3c88a1f8d2cce46afc",
"version": "github:lbryio/lbry-redux#8ac92e3abfa0a9aacdb2fa4a144c3fadc4da6b11",
"from": "github:lbryio/lbry-redux#8ac92e3abfa0a9aacdb2fa4a144c3fadc4da6b11",
"requires": {
"proxy-polyfill": "0.1.6",
"reselect": "^3.0.0",
+1 -1
View File
@@ -12,7 +12,7 @@
"base-64": "^0.1.0",
"@expo/vector-icons": "^8.1.0",
"gfycat-style-urls": "^1.0.3",
"lbry-redux": "lbryio/lbry-redux#9b11cfed62af7f0f8eb6fa3c88a1f8d2cce46afc",
"lbry-redux": "lbryio/lbry-redux#8ac92e3abfa0a9aacdb2fa4a144c3fadc4da6b11",
"lbryinc": "lbryio/lbryinc#9ffb883cc11e36d55a729c65b70c405a4a56d35e",
"lodash": ">=4.17.11",
"merge": ">=1.2.1",
+2 -11
View File
@@ -1,5 +1,5 @@
import React from 'react';
import { CLAIM_VALUES, formatCredits, isNameValid } from 'lbry-redux';
import { CLAIM_VALUES, isNameValid } from 'lbry-redux';
import { ActivityIndicator, NativeModules, Picker, Text, TextInput, TouchableOpacity, View } from 'react-native';
import { logPublish } from 'utils/helper';
import Button from 'component/button';
@@ -14,7 +14,6 @@ export default class ChannelSelector extends React.PureComponent {
super(props);
this.state = {
creditsInputFocused: false,
currentSelectedValue: Constants.ITEM_ANONYMOUS,
newChannelName: '',
newChannelBid: 0.1,
@@ -189,7 +188,7 @@ export default class ChannelSelector extends React.PureComponent {
render() {
const channel = this.state.addingChannel ? 'new' : this.props.channel;
const { balance, enabled, fetchingChannels, channels = [] } = this.props;
const { enabled, fetchingChannels, channels = [] } = this.props;
const pickerItems = [Constants.ITEM_ANONYMOUS, Constants.ITEM_CREATE_A_CHANNEL].concat(
channels ? channels.map(ch => ch.name) : []
);
@@ -245,19 +244,11 @@ export default class ChannelSelector extends React.PureComponent {
style={channelSelectorStyle.bidAmountInput}
value={String(newChannelBid)}
onChangeText={this.handleNewChannelBidChange}
onFocus={() => this.setState({ creditsInputFocused: true })}
onBlur={() => this.setState({ creditsInputFocused: false })}
placeholder={'0.00'}
keyboardType={'number-pad'}
underlineColorAndroid={Colors.NextLbryGreen}
/>
<Text style={channelSelectorStyle.currency}>LBC</Text>
<View style={channelSelectorStyle.balance}>
{this.state.creditsInputFocused && <Icon name="coins" size={12} />}
{this.state.creditsInputFocused && (
<Text style={channelSelectorStyle.balanceText}>{formatCredits(parseFloat(balance), 1, true)}</Text>
)}
</View>
</View>
<Text style={channelSelectorStyle.helpText}>
{__('This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.')}
+1 -1
View File
@@ -147,7 +147,7 @@ class ClaimList extends React.PureComponent {
renderMorePlaceholder = () => {
return (
<TouchableOpacity style={discoverStyle.fileItemMore} onPress={this.onMorePressed}>
<Text style={discoverStyle.moreText}>{__('more')}</Text>
<Text style={discoverStyle.moreText}>more</Text>
<Icon style={discoverStyle.moreIcon} name={'angle-double-down'} color={Colors.White} size={16} />
</TouchableOpacity>
);
+1 -1
View File
@@ -74,7 +74,7 @@ class CustomRewardCard extends React.PureComponent<Props> {
/>
<Button
style={rewardStyle.redeemButton}
text={__('Redeem')}
text={'Redeem'}
disabled={!this.state.rewardCode || this.state.rewardCode.trim().length === 0 || rewardIsPending}
onPress={() => {
if (!rewardIsPending) {
+4 -2
View File
@@ -50,7 +50,7 @@ class FileDownloadButton extends React.PureComponent {
if ((fileInfo && !fileInfo.stopped) || loading || downloading) {
const progress = fileInfo && fileInfo.written_bytes ? (fileInfo.written_bytes / fileInfo.total_bytes) * 100 : 0,
label = fileInfo ? __('%progress%% complete', { progress: progress.toFixed(0) }) : __('Connecting...');
label = fileInfo ? progress.toFixed(0) + '% complete' : __('Connecting...');
return (
<View style={[style, fileDownloadButtonStyle.container]}>
@@ -73,7 +73,9 @@ class FileDownloadButton extends React.PureComponent {
onLayout={onButtonLayout}
style={[style, fileDownloadButtonStyle.container]}
onPress={() => {
NativeModules.Firebase.track('purchase_uri', { uri: uri });
if (NativeModules.Firebase) {
NativeModules.Firebase.track('purchase_uri', { uri: uri });
}
purchaseUri(uri, costInfo, !isPlayable);
if (NativeModules.UtilityModule) {
NativeModules.UtilityModule.checkDownloads();
-18
View File
@@ -1,18 +0,0 @@
import { connect } from 'react-redux';
import { doSendTip, doToast, selectBalance } from 'lbry-redux';
import ModalTipView from './view';
const select = state => ({
balance: selectBalance(state),
});
const perform = dispatch => ({
notify: data => dispatch(doToast(data)),
sendTip: (amount, claimId, isSupport, successCallback, errorCallback) =>
dispatch(doSendTip(amount, claimId, isSupport, successCallback, errorCallback)),
});
export default connect(
select,
perform
)(ModalTipView);
-139
View File
@@ -1,139 +0,0 @@
import React from 'react';
import { ActivityIndicator, Alert, Text, TextInput, TouchableOpacity, View } from 'react-native';
import { formatCredits } from 'lbry-redux';
import modalStyle from 'styles/modal';
import modalTipStyle from 'styles/modalTip';
import Button from 'component/button';
import Colors from 'styles/colors';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import Icon from 'react-native-vector-icons/FontAwesome5';
import Link from 'component/link';
export default class ModalTipView extends React.PureComponent {
state = {
creditsInputFocused: false,
sendTipStarted: false,
tipAmount: null,
};
handleSendTip = () => {
const { claim, balance, notify, onSendTipFailed, onSendTipSuccessful, sendTip } = this.props;
const { tipAmount } = this.state;
if (tipAmount > balance) {
notify({
message: 'Insufficient credits',
});
return;
}
const amount = parseInt(tipAmount, 10);
const message =
amount === 1
? __('Are you sure you want to tip %amount% credit', { amount })
: __('Are you sure you want to tip %amount% credits', { amount });
Alert.alert(
__('Send tip'),
message,
[
{ text: __('No') },
{
text: __('Yes'),
onPress: () => {
this.setState({ sendTipStarted: true }, () =>
sendTip(
tipAmount,
claim.claim_id,
false,
() => {
// success
this.setState({ tipAmount: null, sendTipStarted: false });
if (onSendTipSuccessful) onSendTipSuccessful();
},
() => {
// error
if (onSendTipFailed) onSendTipFailed();
}
)
);
},
},
],
{ cancelable: true }
);
};
render() {
const { balance, channelName, contentName, onCancelPress, onOverlayPress } = this.props;
const canSendTip = this.state.tipAmount > 0;
return (
<TouchableOpacity style={modalStyle.overlay} activeOpacity={1} onPress={onOverlayPress}>
<TouchableOpacity style={modalStyle.container} activeOpacity={1}>
<View style={modalTipStyle.container}>
<Text style={modalTipStyle.title} numberOfLines={1}>
{channelName ? __('Send a tip to %channel%', { channel: channelName }) : __('Send a tip')}
</Text>
<View style={modalTipStyle.row}>
<View style={modalTipStyle.amountRow}>
<TextInput
editable={!this.state.sendTipStarted}
ref={ref => (this.tipAmountInput = ref)}
onChangeText={value => this.setState({ tipAmount: value })}
underlineColorAndroid={Colors.NextLbryGreen}
keyboardType={'numeric'}
onFocus={() => this.setState({ creditsInputFocused: true })}
onBlur={() => this.setState({ creditsInputFocused: false })}
placeholder={'0'}
value={this.state.tipAmount}
selectTextOnFocus
style={modalTipStyle.tipAmountInput}
/>
<Text style={modalTipStyle.currency}>LBC</Text>
<View style={modalTipStyle.balance}>
{this.state.creditsInputFocused && <Icon name="coins" size={12} />}
{this.state.creditsInputFocused && (
<Text style={modalTipStyle.balanceText}>{formatCredits(parseFloat(balance), 1, true)}</Text>
)}
</View>
</View>
{this.state.sendTipStarted && <ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />}
</View>
<View style={modalTipStyle.info}>
<Text style={modalTipStyle.infoText}>
{__(
'This will appear as a tip for %content%, which will boost its ability to be discovered while active.',
{ content: contentName }
)}
</Text>
<Link
style={modalTipStyle.learnMoreLink}
text={__('Learn more.')}
href={'https://lbry.com/faq/tipping'}
/>
</View>
<View style={modalTipStyle.buttonRow}>
<Link
style={modalTipStyle.cancelTipLink}
text={__('Cancel')}
onPress={() => {
if (onCancelPress) onCancelPress();
}}
/>
<Button
text={__('Send')}
style={modalTipStyle.button}
disabled={!canSendTip || this.state.sendTipStarted}
onPress={this.handleSendTip}
/>
</View>
</View>
</TouchableOpacity>
</TouchableOpacity>
);
}
}
+1 -1
View File
@@ -28,7 +28,7 @@ export default class RelatedContent extends React.PureComponent {
return (
<View style={relatedContentStyle.container}>
<Text style={relatedContentStyle.title}>{__('Related Content')}</Text>
<Text style={relatedContentStyle.title}>Related Content</Text>
{recommendedContent &&
recommendedContent
.filter(recommendedUri => recommendedUri !== normalizeURI(fullUri))
+1 -4
View File
@@ -35,10 +35,7 @@ class RewardEnrolment extends React.Component {
<View style={rewardStyle.enrollContainer}>
<View style={rewardStyle.summaryRow}>
<Icon name="award" size={36} color={Colors.White} />
<Text style={rewardStyle.summaryText}>
{unclaimedRewardAmount === 1 && __('%amount% available credit', { amount: unclaimedRewardAmount })}
{unclaimedRewardAmount !== 1 && __('%amount% available credits', { amount: unclaimedRewardAmount })}
</Text>
<Text style={rewardStyle.summaryText}>{unclaimedRewardAmount} available credits</Text>
</View>
<View style={rewardStyle.onboarding}>
+2 -2
View File
@@ -75,10 +75,10 @@ class StorageStatsCard extends React.PureComponent {
<View style={[storageStatsStyle.row, storageStatsStyle.totalSizeContainer]}>
<View style={storageStatsStyle.summary}>
<Text style={storageStatsStyle.totalSize}>{formatBytes(this.state.totalBytes, 2)}</Text>
<Text style={storageStatsStyle.annotation}>{__('used')}</Text>
<Text style={storageStatsStyle.annotation}>used</Text>
</View>
<View style={[storageStatsStyle.row, storageStatsStyle.toggleStatsContainer]}>
<Text style={storageStatsStyle.statsText}>{__('Stats')}</Text>
<Text style={storageStatsStyle.statsText}>Stats</Text>
<Switch
style={storageStatsStyle.statsToggle}
value={this.state.showStats}
+1 -1
View File
@@ -74,7 +74,7 @@ export default class TagSearch extends React.PureComponent {
<TextInput
editable={editable}
style={tagStyle.searchInput}
placeholder={__('Search for more tags')}
placeholder={'Search for more tags'}
underlineColorAndroid={Colors.NextLbryGreen}
value={this.state.tag}
numberOfLines={1}
+1 -1
View File
@@ -26,7 +26,7 @@ class TransactionListRecent extends React.PureComponent<Props> {
return (
<View style={walletStyle.transactionsCard}>
<View style={[walletStyle.row, walletStyle.transactionsHeader]}>
<Text style={walletStyle.transactionsTitle}>{__('Recent Transactions')}</Text>
<Text style={walletStyle.transactionsTitle}>Recent Transactions</Text>
<Link style={walletStyle.link} navigation={navigation} text={__('View All')} href={'#TransactionHistory'} />
</View>
{fetchingTransactions && <Text style={walletStyle.infoText}>{__('Fetching transactions...')}</Text>}
+1 -2
View File
@@ -1,10 +1,9 @@
import { connect } from 'react-redux';
import { selectUnclaimedRewardValue, selectUser } from 'lbryinc';
import { selectUnclaimedRewardValue } from 'lbryinc';
import WalletRewardsDriver from './view';
const select = state => ({
unclaimedRewardAmount: selectUnclaimedRewardValue(state),
user: selectUser(state),
});
export default connect(select)(WalletRewardsDriver);
+5 -21
View File
@@ -5,31 +5,15 @@ import walletStyle from 'styles/wallet';
class WalletRewardsDriver extends React.PureComponent<Props> {
render() {
const { navigation, unclaimedRewardAmount, user } = this.props;
const signedIn = user && user.has_verified_email;
const { navigation, unclaimedRewardAmount } = this.props;
return (
<TouchableOpacity style={walletStyle.rewardDriverCard} onPress={() => navigation.navigate('Rewards')}>
<Icon name="award" size={16} style={walletStyle.rewardIcon} />
{signedIn && (
<Text style={walletStyle.rewardDriverText}>
{unclaimedRewardAmount === 0 && __('Free credits available in rewards.')}
{unclaimedRewardAmount === 1 &&
__('%amount% free credit available in rewards.', { amount: unclaimedRewardAmount })}
{unclaimedRewardAmount > 1 &&
__('%amount% free credits available in rewards.', { amount: unclaimedRewardAmount })}{' '}
{__('Tap to learn more.')}
</Text>
)}
{!signedIn && (
<Text style={walletStyle.rewardDriverText}>
{unclaimedRewardAmount === 1 &&
__('Get %amount% free credit after creating an account.', { amount: unclaimedRewardAmount })}
{unclaimedRewardAmount !== 1 &&
__('Get %amount% free credits after creating an account.', { amount: unclaimedRewardAmount })}
</Text>
)}
<Text style={walletStyle.rewardDriverText}>
Get {unclaimedRewardAmount > 0 ? unclaimedRewardAmount : ''} free credit
{unclaimedRewardAmount === 1 ? '' : 's'} after creating an account.
</Text>
</TouchableOpacity>
);
}
+2 -12
View File
@@ -1,10 +1,9 @@
// @flow
import React from 'react';
import { formatCredits, regexAddress } from 'lbry-redux';
import { regexAddress } from 'lbry-redux';
import { Alert, Clipboard, TextInput, Text, View } from 'react-native';
import Button from 'component/button';
import Colors from 'styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome5';
import walletStyle from 'styles/wallet';
type DraftTransaction = {
@@ -25,7 +24,6 @@ class WalletSend extends React.PureComponent<Props> {
address: null,
addressChanged: false,
addressValid: false,
creditsInputFocused: false,
};
componentWillUpdate(nextProps) {
@@ -120,8 +118,6 @@ class WalletSend extends React.PureComponent<Props> {
<TextInput
ref={ref => (this.amountInput = ref)}
onChangeText={value => this.setState({ amount: value })}
onFocus={() => this.setState({ creditsInputFocused: true })}
onBlur={() => this.setState({ creditsInputFocused: false })}
keyboardType={'numeric'}
placeholder={'0'}
underlineColorAndroid={Colors.NextLbryGreen}
@@ -129,15 +125,9 @@ class WalletSend extends React.PureComponent<Props> {
style={[walletStyle.input, walletStyle.amountInput]}
/>
<Text style={[walletStyle.text, walletStyle.currency]}>LBC</Text>
<View style={walletStyle.balanceFocus}>
{this.state.creditsInputFocused && <Icon name="coins" size={12} />}
{this.state.creditsInputFocused && (
<Text style={walletStyle.balanceText}>{formatCredits(parseFloat(balance), 1, true)}</Text>
)}
</View>
</View>
<Button
text={__('Send')}
text={'Send'}
style={[walletStyle.button, walletStyle.sendButton]}
disabled={!canSend}
onPress={this.handleSend}
+4 -2
View File
@@ -29,12 +29,14 @@ class WalletSignIn extends React.Component {
return (
<View style={walletStyle.signInContainer}>
<View style={walletStyle.signInSummaryRow}>
<Text style={walletStyle.signInTitle}>{__('Account Recommended')}</Text>
<Text style={walletStyle.signInTitle}>Account Recommended</Text>
</View>
<View style={walletStyle.onboarding}>
<Text style={walletStyle.onboardingText}>
{__('A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.')}
{__(
'An account with LBRY Inc. allows you to earn rewards, backup your wallet, and keep everything synced.'
)}
{'\n\n'}
{__('Without an account, you assume all responsibility for securing your wallet and LBRY data.')}
</Text>
+1 -6
View File
@@ -95,7 +95,6 @@ const Constants = {
FULL_ROUTE_NAME_WALLET: 'WalletStack',
ROUTE_FILE: 'File',
DRAWER_ROUTE_FILE_VIEW: 'FileView',
ITEM_CREATE_A_CHANNEL: 'Create a channel...',
ITEM_ANONYMOUS: 'Publish anonymously',
@@ -168,8 +167,4 @@ export const DrawerRoutes = [
];
// sub-pages for main routes
export const InnerDrawerRoutes = [
Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM,
Constants.DRAWER_ROUTE_PUBLISH_FORM,
Constants.DRAWER_ROUTE_FILE_VIEW,
];
export const InnerDrawerRoutes = [Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM, Constants.DRAWER_ROUTE_PUBLISH_FORM];
-2
View File
@@ -27,7 +27,6 @@ import {
homepageReducer,
rewardsReducer,
selectUserVerifiedEmail,
statsReducer,
subscriptionsReducer,
syncReducer,
userReducer,
@@ -141,7 +140,6 @@ const reducers = persistCombineReducers(persistOptions, {
rewards: rewardsReducer,
settings: settingsReducer,
search: searchReducer,
stats: statsReducer,
subscriptions: subscriptionsReducer,
sync: syncReducer,
tags: tagsReducer,
+2 -2
View File
@@ -74,7 +74,7 @@ class AboutPage extends React.PureComponent {
<View style={aboutStyle.container}>
<PageHeader title={'About LBRY'} onBackPressed={() => navigateBack(navigation, drawerStack, popDrawerStack)} />
<ScrollView style={aboutStyle.scrollContainer}>
<Text style={aboutStyle.title}>{__('Content Freedom')}</Text>
<Text style={aboutStyle.title}>Content Freedom</Text>
<Text style={aboutStyle.paragraph}>
{__(
'LBRY is a free, open, and community-run digital marketplace. It is a decentralized peer-to-peer content distribution platform for creators to upload and share content, and earn LBRY credits for their effort. Users will be able to find a wide selection of videos, music, ebooks and other digital content they are interested in.'
@@ -85,7 +85,7 @@ class AboutPage extends React.PureComponent {
<Link style={aboutStyle.link} href="https://lbry.com/faq/android-basics" text={__('Android App Basics')} />
<Link style={aboutStyle.link} href="https://lbry.com/faq" text={__('Frequently Asked Questions')} />
</View>
<Text style={aboutStyle.socialTitle}>{__('Get Social')}</Text>
<Text style={aboutStyle.socialTitle}>Get Social</Text>
<Text style={aboutStyle.paragraph}>
{__(
'You can interact with the LBRY team and members of the community on Discord, Facebook, Instagram, Twitter or Reddit.'
-3
View File
@@ -1,6 +1,5 @@
import { connect } from 'react-redux';
import { doAbandonClaim, doFetchChannelListMine, makeSelectClaimForUri, selectMyChannelClaims } from 'lbry-redux';
import { doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc';
import { doPopDrawerStack } from 'redux/actions/drawer';
import { doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
import { selectDrawerStack } from 'redux/selectors/drawer';
@@ -12,14 +11,12 @@ const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
drawerStack: selectDrawerStack(state),
sortByItem: selectSortByItem(state),
subCount: makeSelectSubCountForUri(props.uri)(state),
timeItem: selectTimeItem(state),
});
const perform = dispatch => ({
abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)),
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
fetchSubCount: claimId => dispatch(doFetchSubCount(claimId)),
popDrawerStack: () => dispatch(doPopDrawerStack()),
setSortByItem: item => dispatch(doSetSortByItem(item)),
setTimeItem: item => dispatch(doSetTimeItem(item)),
+16 -45
View File
@@ -23,7 +23,6 @@ import EmptyStateView from 'component/emptyStateView';
import Icon from 'react-native-vector-icons/FontAwesome5';
import Link from 'component/link';
import ModalPicker from 'component/modalPicker';
import ModalTipView from 'component/modalTipView';
import PageHeader from 'component/pageHeader';
import SubscribeButton from 'component/subscribeButton';
import SubscribeNotificationButton from 'component/subscribeNotificationButton';
@@ -37,10 +36,8 @@ class ChannelPage extends React.PureComponent {
autoStyle: null,
showSortPicker: false,
showTimePicker: false,
showTipView: false,
orderBy: ['release_time'], // sort by new by default
activeTab: Constants.CONTENT_TAB,
currentSortByItem: Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1], // should always default to sorting channel pages by new
};
componentWillMount() {
@@ -51,17 +48,16 @@ class ChannelPage extends React.PureComponent {
}
componentDidMount() {
const { claim, fetchChannelListMine, fetchSubCount } = this.props;
const { fetchChannelListMine, setSortByItem } = this.props;
NativeModules.Firebase.setCurrentScreen('Channel');
setSortByItem(Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1]); // sort by newest first
fetchChannelListMine();
if (claim) {
fetchSubCount(claim.claim_id);
}
}
handleSortByItemSelected = item => {
// sort by specific only to this component state
this.setState({ currentSortByItem: item, orderBy: getOrderBy(item), showSortPicker: false });
const { setSortByItem } = this.props;
setSortByItem(item);
this.setState({ orderBy: getOrderBy(item), showSortPicker: false });
};
handleTimeItemSelected = item => {
@@ -71,18 +67,17 @@ class ChannelPage extends React.PureComponent {
};
listHeader = () => {
const { timeItem } = this.props;
const { currentSortByItem } = this.state;
const { sortByItem, timeItem } = this.props;
return (
<View style={channelPageStyle.listHeader}>
<View style={discoverStyle.pickerRow}>
<View style={discoverStyle.leftPickerRow}>
<TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}>
<Text style={discoverStyle.tagSortText}>{__(currentSortByItem.label.split(' ')[0])}</Text>
<Text style={discoverStyle.tagSortText}>{__(sortByItem.label.split(' ')[0])}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity>
{Constants.SORT_BY_TOP === currentSortByItem.name && (
{Constants.SORT_BY_TOP === sortByItem.name && (
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
<Text style={discoverStyle.tagSortText}>{__(timeItem.label)}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
@@ -178,10 +173,6 @@ class ChannelPage extends React.PureComponent {
}
};
onTipPressed = () => {
this.setState({ showTipView: true });
};
onSharePressed = () => {
const { claim } = this.props;
if (claim) {
@@ -216,9 +207,9 @@ class ChannelPage extends React.PureComponent {
};
render() {
const { channels, claim, navigation, uri, drawerStack, popDrawerStack, subCount, timeItem } = this.props;
const { channels, claim, navigation, uri, drawerStack, popDrawerStack, sortByItem, timeItem } = this.props;
const { name, permanent_url: permanentUrl } = claim;
const { autoStyle, currentSortByItem, showSortPicker, showTimePicker, showTipView } = this.state;
const { autoStyle, showSortPicker, showTimePicker } = this.state;
const ownedChannel = channels ? channels.map(channel => channel.permanent_url).includes(permanentUrl) : false;
let thumbnailUrl,
@@ -261,10 +252,6 @@ class ChannelPage extends React.PureComponent {
<View style={channelPageStyle.channelHeader}>
<Text style={channelPageStyle.channelName}>{title && title.trim().length > 0 ? title : name}</Text>
<Text style={channelPageStyle.followerCount}>
{subCount === 1 && __('%follower% follower', { follower: subCount })}
{subCount > 1 && __('%follower% followers', { follower: subCount })}
</Text>
</View>
<View style={[channelPageStyle.avatarImageContainer, autoStyle]}>
@@ -284,7 +271,7 @@ class ChannelPage extends React.PureComponent {
style={channelPageStyle.actionButton}
theme={'light'}
icon={'edit'}
text={__('Edit')}
text={'Edit'}
onPress={this.onEditPressed}
/>
)}
@@ -293,7 +280,7 @@ class ChannelPage extends React.PureComponent {
style={[channelPageStyle.actionButton, channelPageStyle.deleteButton]}
theme={'light'}
icon={'trash-alt'}
text={__('Delete')}
text={'Delete'}
onPress={this.onDeletePressed}
/>
)}
@@ -303,14 +290,8 @@ class ChannelPage extends React.PureComponent {
icon={'share-alt'}
onPress={this.onSharePressed}
/>
<Button
style={[channelPageStyle.actionButton, channelPageStyle.tipButton]}
theme={'light'}
icon={'gift'}
onPress={this.onTipPressed}
/>
{!ownedChannel && <SubscribeButton style={channelPageStyle.subscribeButton} uri={fullUri} name={name} />}
{false && !ownedChannel && (
{!ownedChannel && (
<SubscribeNotificationButton
style={[channelPageStyle.subscribeButton, channelPageStyle.bellButton]}
uri={fullUri}
@@ -325,14 +306,14 @@ class ChannelPage extends React.PureComponent {
style={channelPageStyle.tab}
onPress={() => this.setState({ activeTab: Constants.CONTENT_TAB })}
>
<Text style={channelPageStyle.tabTitle}>{__('CONTENT')}</Text>
<Text style={channelPageStyle.tabTitle}>CONTENT</Text>
{Constants.CONTENT_TAB === this.state.activeTab && <View style={channelPageStyle.activeTabHint} />}
</TouchableOpacity>
<TouchableOpacity
style={channelPageStyle.tab}
onPress={() => this.setState({ activeTab: Constants.ABOUT_TAB })}
>
<Text style={channelPageStyle.tabTitle}>{__('ABOUT')}</Text>
<Text style={channelPageStyle.tabTitle}>ABOUT</Text>
{Constants.ABOUT_TAB === this.state.activeTab && <View style={channelPageStyle.activeTabHint} />}
</TouchableOpacity>
</View>
@@ -346,7 +327,7 @@ class ChannelPage extends React.PureComponent {
title={__('Sort content by')}
onOverlayPress={() => this.setState({ showSortPicker: false })}
onItemSelected={this.handleSortByItemSelected}
selectedItem={currentSortByItem}
selectedItem={sortByItem}
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
/>
)}
@@ -359,16 +340,6 @@ class ChannelPage extends React.PureComponent {
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
/>
)}
{showTipView && (
<ModalTipView
claim={claim}
channelName={claim.name}
contentName={title}
onCancelPress={() => this.setState({ showTipView: false })}
onOverlayPress={() => this.setState({ showTipView: false })}
onSendTipSuccessful={() => this.setState({ showTipView: false })}
/>
)}
</View>
);
}
+1 -10
View File
@@ -1,5 +1,5 @@
import React from 'react';
import { CLAIM_VALUES, formatCredits, isNameValid, regexInvalidURI } from 'lbry-redux';
import { CLAIM_VALUES, isNameValid, regexInvalidURI } from 'lbry-redux';
import {
ActivityIndicator,
Alert,
@@ -38,7 +38,6 @@ export default class ChannelCreator extends React.PureComponent {
autoStyle: null,
canSave: true,
claimId: null,
creditsInputFocused: false,
currentSelectedValue: Constants.ITEM_ANONYMOUS,
currentPhase: null,
displayName: null,
@@ -961,19 +960,11 @@ export default class ChannelCreator extends React.PureComponent {
style={channelCreatorStyle.bidAmountInput}
value={String(newChannelBid)}
onChangeText={this.handleNewChannelBidChange}
onFocus={() => this.setState({ creditsInputFocused: true })}
onBlur={() => this.setState({ creditsInputFocused: false })}
placeholder={'0.00'}
keyboardType={'number-pad'}
underlineColorAndroid={Colors.NextLbryGreen}
/>
<Text style={channelCreatorStyle.currency}>LBC</Text>
<View style={channelCreatorStyle.balance}>
{this.state.creditsInputFocused && <Icon name="coins" size={12} />}
{this.state.creditsInputFocused && (
<Text style={channelCreatorStyle.balanceText}>{formatCredits(parseFloat(balance), 1, true)}</Text>
)}
</View>
</View>
<Text style={channelCreatorStyle.helpText}>
{__('This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.')}
+44 -2
View File
@@ -86,9 +86,11 @@ class DiscoverPage extends React.PureComponent {
}
onComponentFocused = () => {
const { pushDrawerStack } = this.props;
const { fetchSubscriptions, pushDrawerStack } = this.props;
// pushDrawerStack();
NativeModules.Firebase.setCurrentScreen('Your tags');
NativeModules.Firebase.setCurrentScreen('Your tags').then(result => {
fetchSubscriptions();
});
};
handleSortByItemSelected = item => {
@@ -121,6 +123,46 @@ 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;
+1 -6
View File
@@ -33,9 +33,7 @@ import {
import {
doClaimEligiblePurchaseRewards,
doFetchCostInfoForUri,
doFetchViewCount,
makeSelectCostInfoForUri,
makeSelectViewCountForUri,
selectRewardContentClaimIds,
selectBlackListedOutpoints,
} from 'lbryinc';
@@ -46,7 +44,7 @@ import {
doDeleteFile,
doStopDownloadingFile,
} from 'redux/actions/file';
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
import { doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
import { doToggleFullscreenMode } from 'redux/actions/settings';
import { selectDrawerStack } from 'redux/selectors/drawer';
import FilePage from './view';
@@ -78,7 +76,6 @@ const select = (state, props) => {
title: makeSelectTitleForUri(contentUri)(state),
recommendedContent: makeSelectRecommendedContentForUri(contentUri)(state),
isSearchingRecommendContent: selectIsSearching(state),
viewCount: makeSelectViewCountForUri(contentUri)(state),
};
};
@@ -92,11 +89,9 @@ const perform = dispatch => ({
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
fetchMyClaims: () => dispatch(doFetchClaimListMine()),
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
fetchViewCount: claimId => dispatch(doFetchViewCount(claimId)),
fileGet: (uri, saveFile) => dispatch(doFileGet(uri, saveFile)),
notify: data => dispatch(doToast(data)),
popDrawerStack: () => dispatch(doPopDrawerStack()),
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
purchaseUri: (uri, costInfo, saveFile) => dispatch(doPurchaseUri(uri, costInfo, saveFile)),
deletePurchasedUri: uri => dispatch(doDeletePurchasedUri(uri)),
resolveUri: uri => dispatch(doResolveUri(uri)),
+166 -192
View File
@@ -1,5 +1,5 @@
import React from 'react';
import { Lbry, formatCredits, normalizeURI, parseURI } from 'lbry-redux';
import { Lbry, normalizeURI, parseURI } from 'lbry-redux';
import { Lbryio } from 'lbryinc';
import {
ActivityIndicator,
@@ -36,7 +36,6 @@ import FilePrice from 'component/filePrice';
import FloatingWalletBalance from 'component/floatingWalletBalance';
import Link from 'component/link';
import MediaPlayer from 'component/mediaPlayer';
import ModalTipView from 'component/modalTipView';
import RelatedContent from 'component/relatedContent';
import SubscribeButton from 'component/subscribeButton';
import SubscribeNotificationButton from 'component/subscribeNotificationButton';
@@ -45,13 +44,14 @@ import Video from 'react-native-video';
import FileRewardsDriver from 'component/fileRewardsDriver';
import filePageStyle from 'styles/filePage';
import uriBarStyle from 'styles/uriBar';
import _ from 'lodash';
class FilePage extends React.PureComponent {
static navigationOptions = {
title: '',
};
tipAmountInput = null;
playerBackground = null;
scrollView = null;
@@ -62,13 +62,10 @@ class FilePage extends React.PureComponent {
super(props);
this.state = {
attemptAutoGet: false,
autoOpened: false,
autoDownloadStarted: false,
autoPlayMedia: false,
creditsInputFocused: false,
autoDownloadStarted: false,
downloadButtonShown: false,
downloadPressed: false,
didSearchRecommended: false,
fileViewLogged: false,
fullscreenMode: false,
fileGetStarted: false,
@@ -84,11 +81,12 @@ class FilePage extends React.PureComponent {
showTipView: false,
playerBgHeight: 0,
playerHeight: 0,
tipAmount: null,
uri: null,
uriVars: null,
stopDownloadConfirmed: false,
streamingMode: false,
viewCountFetched: false,
didSearchRecommended: false,
};
}
@@ -115,7 +113,6 @@ class FilePage extends React.PureComponent {
this.fetchFileInfo(this.props);
this.fetchCostInfo(this.props);
fetchMyClaims();
if (NativeModules.Firebase) {
@@ -130,28 +127,15 @@ class FilePage extends React.PureComponent {
this.onComponentFocused();
}
difference = (object, base) => {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
result[key] = _.isObject(value) && _.isObject(base[key]) ? changes(value, base[key]) : value;
}
});
}
return changes(object, base);
};
componentWillReceiveProps(nextProps) {
const {
claim,
currentRoute,
failedPurchaseUris: prevFailedPurchaseUris,
fetchViewCount,
purchasedUris: prevPurchasedUris,
navigation,
contentType,
notify,
drawerStack: prevDrawerStack,
} = this.props;
const { uri } = navigation.state.params;
const {
@@ -161,7 +145,6 @@ class FilePage extends React.PureComponent {
purchasedUris,
purchaseUriErrorMessage,
streamingUrl,
drawerStack,
} = nextProps;
if (Constants.ROUTE_FILE === currentRoute && currentRoute !== prevRoute) {
@@ -201,21 +184,6 @@ class FilePage extends React.PureComponent {
this.setState({ streamingMode: true, currentStreamUrl: fileInfo.streaming_url });
}
}
if (
prevDrawerStack[prevDrawerStack.length - 1].route === Constants.DRAWER_ROUTE_FILE_VIEW &&
prevDrawerStack.length !== drawerStack.length
) {
this.setState({
downloadPressed: false,
showImageViewer: false,
showWebView: false,
});
}
if (claim && !this.state.viewCountFetched) {
this.setState({ viewCountFetched: true }, () => fetchViewCount(claim.claim_id));
}
}
componentDidUpdate(prevProps) {
@@ -582,6 +550,39 @@ class FilePage extends React.PureComponent {
}
};
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;
}
const suffix = 'credit' + (parseInt(tipAmount, 10) === 1 ? '' : 's');
Alert.alert(
'Send tip',
`Are you sure you want to tip ${tipAmount} ${suffix}?`,
[
{ text: 'No' },
{
text: 'Yes',
onPress: () => {
this.setState({ sendTipStarted: true }, () =>
sendTip(tipAmount, claim.claim_id, false, () => {
this.setState({ tipAmount: null, showTipView: false, sendTipStarted: false });
})
);
},
},
],
{ cancelable: true }
);
};
renderTags = tags => {
const { navigation } = this.props;
return tags.map((tag, i) => (
@@ -596,18 +597,6 @@ 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);
@@ -632,50 +621,6 @@ class FilePage extends React.PureComponent {
}
};
openFile = (localFileUri, mediaType) => {
const { pushDrawerStack } = this.props;
const isWebViewable = mediaType === 'text';
if (mediaType === 'image') {
// use image viewer
if (!this.state.showImageViewer) {
this.setState(
{
imageUrls: [
{
url: localFileUri,
},
],
showImageViewer: true,
},
() => pushDrawerStack(Constants.DRAWER_ROUTE_FILE_VIEW)
);
}
}
if (isWebViewable) {
// show webview
if (!this.state.showWebView) {
this.setState(
{
showWebView: true,
},
() => pushDrawerStack(Constants.DRAWER_ROUTE_FILE_VIEW)
);
}
}
};
onMediaContainerPressed = () => {
const { costInfo, contentType, purchaseUri } = this.props;
const { uri } = this.state;
const mediaType = Lbry.getMediaType(contentType);
const isPlayable = mediaType === 'video' || mediaType === 'audio';
purchaseUri(uri, costInfo, isPlayable);
if (isPlayable) {
this.onFileDownloadButtonPlayed();
}
};
render() {
const {
balance,
@@ -694,12 +639,10 @@ class FilePage extends React.PureComponent {
navigation,
position,
purchaseUri,
pushDrawerStack,
isSearchingRecommendContent,
recommendedContent,
thumbnail,
title,
viewCount,
} = this.props;
const { uri, autoplay } = navigation.state.params;
@@ -791,10 +734,10 @@ class FilePage extends React.PureComponent {
const description = metadata.description ? metadata.description : null;
const mediaType = Lbry.getMediaType(contentType);
const isPlayable = mediaType === 'video' || mediaType === 'audio';
const isWebViewable = mediaType === 'text';
const { height, signing_channel: signingChannel, value } = claim;
const channelName = signingChannel && signingChannel.name;
const channelClaimId = claim && claim.signing_channel && claim.signing_channel.claim_id;
const canSendTip = this.state.tipAmount > 0;
const fullUri = `${claim.name}#${claim.claim_id}`;
const canEdit = myClaimUris.includes(normalizeURI(fullUri));
const showActions =
@@ -829,10 +772,35 @@ class FilePage extends React.PureComponent {
(fileInfo && (fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes === fileInfo.total_bytes)); // 2MB = 1024*1024*2
const duration = claim && claim.value && claim.value.video ? claim.value.video.duration : null;
const isViewable = mediaType === 'image' || mediaType === 'text';
const isWebViewable = mediaType === 'text';
const canOpen = isViewable && completed;
const localFileUri = this.localUriForFileInfo(fileInfo);
const unsupported = !isPlayable && !canOpen;
const openFile = () => {
if (mediaType === 'image') {
// use image viewer
if (!this.state.showImageViewer) {
this.setState({
imageUrls: [
{
url: localFileUri,
},
],
showImageViewer: true,
});
}
}
if (isWebViewable) {
// show webview
if (!this.state.showWebView) {
this.setState({
showWebView: true,
});
}
}
};
if (fileInfo && !this.state.autoDownloadStarted && this.state.uriVars && this.state.uriVars.download === 'true') {
this.setState({ autoDownloadStarted: true }, () => {
purchaseUri(uri, costInfo, !isPlayable);
@@ -842,16 +810,16 @@ class FilePage extends React.PureComponent {
});
}
if (this.state.downloadPressed && canOpen && !this.state.autoOpened) {
if (this.state.downloadPressed && canOpen) {
// automatically open a web viewable or image file after the download button is pressed
this.setState({ autoOpened: true }, () => this.openFile(localFileUri, mediaType));
openFile();
}
return (
<View style={filePageStyle.pageContainer}>
{!this.state.fullscreenMode && <UriBar value={uri} navigation={navigation} />}
{this.state.showWebView && isWebViewable && (
<WebView allowFileAccess source={{ uri: localFileUri }} style={filePageStyle.viewer} />
<WebView source={{ uri: localFileUri }} style={filePageStyle.viewer} />
)}
{this.state.showImageViewer && (
@@ -869,11 +837,7 @@ class FilePage extends React.PureComponent {
}
onLayout={this.checkOrientation}
>
<TouchableOpacity
activeOpacity={0.5}
style={filePageStyle.mediaContainer}
onPress={this.onMediaContainerPressed}
>
<View style={filePageStyle.mediaContainer}>
{(canOpen || (!fileInfo || (isPlayable && !canLoadMedia)) || (!canOpen && fileInfo)) && (
<FileItemMedia
duration={duration}
@@ -913,7 +877,7 @@ class FilePage extends React.PureComponent {
<FileDownloadButton
uri={claim && claim.permanent_url ? claim.permanent_url : uri}
style={filePageStyle.downloadButton}
openFile={() => this.openFile(localFileUri, mediaType)}
openFile={openFile}
isPlayable={isPlayable}
isViewable={isViewable}
onPlay={this.onFileDownloadButtonPlayed}
@@ -932,7 +896,7 @@ class FilePage extends React.PureComponent {
<TouchableOpacity style={filePageStyle.backButton} onPress={this.onBackButtonPressed}>
<Icon name={'arrow-left'} size={18} style={filePageStyle.backButtonIcon} />
</TouchableOpacity>
</TouchableOpacity>
</View>
{(this.state.streamingMode || (canLoadMedia && fileInfo && isPlayable)) && (
<View
style={playerBgStyle}
@@ -974,8 +938,48 @@ class FilePage extends React.PureComponent {
/>
)}
{showActions && showFileActions && (
<View style={filePageStyle.actions}>
{showFileActions && (
<View style={filePageStyle.fileActions}>
{canEdit && (
<Button
style={[filePageStyle.actionButton, filePageStyle.editButton]}
theme={'light'}
icon={'edit'}
text={__('Edit')}
onPress={this.onEditPressed}
/>
)}
{(completed || canEdit) && (
<Button
style={filePageStyle.actionButton}
theme={'light'}
icon={'trash-alt'}
text={__('Delete')}
onPress={this.onDeletePressed}
/>
)}
{!completed &&
fileInfo &&
!fileInfo.stopped &&
fileInfo.written_bytes < fileInfo.total_bytes &&
!this.state.stopDownloadConfirmed && (
<Button
style={filePageStyle.actionButton}
icon={'stop'}
theme={'light'}
text={__('Stop Download')}
onPress={this.onStopDownloadPressed}
/>
)}
</View>
)}
</View>
)}
<ScrollView
style={filePageStyle.scrollContainer}
style={showActions ? filePageStyle.scrollContainerActions : filePageStyle.scrollContainer}
contentContainerstyle={showActions ? null : filePageStyle.scrollContent}
keyboardShouldPersistTaps={'handled'}
ref={ref => {
@@ -986,26 +990,20 @@ class FilePage extends React.PureComponent {
style={filePageStyle.titleTouch}
onPress={() => this.setState({ showDescription: !this.state.showDescription })}
>
<View style={filePageStyle.titleArea}>
<View style={filePageStyle.titleRow}>
<Text style={filePageStyle.title} selectable>
{title}
</Text>
{isRewardContent && <Icon name="award" style={filePageStyle.rewardIcon} size={16} />}
<View style={filePageStyle.descriptionToggle}>
<Icon name={this.state.showDescription ? 'caret-up' : 'caret-down'} size={24} />
</View>
</View>
<Text style={filePageStyle.viewCount}>
{viewCount === 1 && __('%view% view', { view: viewCount })}
{viewCount > 1 && __('%view% views', { view: viewCount })}
<View style={filePageStyle.titleRow}>
<Text style={filePageStyle.title} selectable>
{title}
</Text>
{isRewardContent && <Icon name="award" style={filePageStyle.rewardIcon} size={16} />}
<View style={filePageStyle.descriptionToggle}>
<Icon name={this.state.showDescription ? 'caret-up' : 'caret-down'} size={24} />
</View>
</View>
</TouchableWithoutFeedback>
<View style={filePageStyle.largeButtonsRow}>
<TouchableOpacity style={filePageStyle.largeButton} onPress={this.handleSharePress}>
<Icon name={'share-alt'} size={16} style={filePageStyle.largeButtonIcon} />
<Icon name={'share-alt'} size={20} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Share')}</Text>
</TouchableOpacity>
@@ -1013,64 +1011,17 @@ class FilePage extends React.PureComponent {
style={filePageStyle.largeButton}
onPress={() => this.setState({ showTipView: true })}
>
<Icon name={'gift'} size={16} style={filePageStyle.largeButtonIcon} />
<Icon name={'gift'} size={20} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Tip')}</Text>
</TouchableOpacity>
{!canEdit && !isPlayable && (
<View style={filePageStyle.sharedLargeButton}>
{!fileInfo ||
(fileInfo.written_bytes <= 0 && !completed && (
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onDownloadPressed}>
<Icon name={'download'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Download')}</Text>
</TouchableOpacity>
))}
{!completed &&
fileInfo &&
!fileInfo.stopped &&
fileInfo.written_bytes > 0 &&
fileInfo.written_bytes < fileInfo.total_bytes &&
!this.state.stopDownloadConfirmed && (
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onStopDownloadPressed}>
<Icon name={'stop'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Stop')}</Text>
</TouchableOpacity>
)}
{completed && fileInfo && fileInfo.written_bytes >= fileInfo.total_bytes && (
<TouchableOpacity style={filePageStyle.innerLargeButton} onPress={this.onOpenFilePressed}>
<Icon name={'folder-open'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Open')}</Text>
</TouchableOpacity>
)}
</View>
)}
{!canEdit && (
<TouchableOpacity
style={filePageStyle.largeButton}
onPress={() => Linking.openURL(`https://lbry.com/dmca/${claim.claim_id}`)}
>
<Icon name={'flag'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Report')}</Text>
</TouchableOpacity>
)}
{canEdit && (
<TouchableOpacity style={filePageStyle.largeButton} onPress={this.onEditPressed}>
<Icon name={'edit'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Edit')}</Text>
</TouchableOpacity>
)}
{(completed || canEdit) && (
<TouchableOpacity style={filePageStyle.largeButton} onPress={this.onDeletePressed}>
<Icon name={'trash-alt'} size={16} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Delete')}</Text>
</TouchableOpacity>
)}
<TouchableOpacity
style={filePageStyle.largeButton}
onPress={() => Linking.openURL(`https://lbry.com/dmca/${claim.claim_id}`)}
>
<Icon name={'flag'} size={20} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>{__('Report')}</Text>
</TouchableOpacity>
</View>
<View style={filePageStyle.channelRow}>
@@ -1123,7 +1074,7 @@ class FilePage extends React.PureComponent {
hideText={false}
/>
)}
{false && channelName && (
{channelName && (
<SubscribeNotificationButton
style={[filePageStyle.actionButton, filePageStyle.bellButton]}
uri={fullChannelUri}
@@ -1133,6 +1084,40 @@ class FilePage extends React.PureComponent {
</View>
</View>
{this.state.showTipView && <View style={filePageStyle.divider} />}
{this.state.showTipView && (
<View style={filePageStyle.tipCard}>
<View style={filePageStyle.row}>
<View style={filePageStyle.amountRow}>
<TextInput
editable={!this.state.sendTipStarted}
ref={ref => (this.tipAmountInput = ref)}
onChangeText={value => this.setState({ tipAmount: value })}
underlineColorAndroid={Colors.NextLbryGreen}
keyboardType={'numeric'}
placeholder={'0'}
value={this.state.tipAmount}
selectTextOnFocus
style={[filePageStyle.input, filePageStyle.tipAmountInput]}
/>
<Text style={[filePageStyle.text, filePageStyle.currency]}>LBC</Text>
</View>
{this.state.sendTipStarted && <ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />}
<Link
style={[filePageStyle.link, filePageStyle.cancelTipLink]}
text={__('Cancel')}
onPress={() => this.setState({ showTipView: false })}
/>
<Button
text={__('Send a tip')}
style={[filePageStyle.button, filePageStyle.sendButton]}
disabled={!canSendTip || this.state.sendTipStarted}
onPress={this.handleSendTip}
/>
</View>
</View>
)}
{this.state.showDescription && description && description.length > 0 && (
<View style={filePageStyle.divider} />
)}
@@ -1143,7 +1128,7 @@ class FilePage extends React.PureComponent {
</Text>
{tags && tags.length > 0 && (
<View style={filePageStyle.tagContainer}>
<Text style={filePageStyle.tagTitle}>{__('Tags')}</Text>
<Text style={filePageStyle.tagTitle}>Tags</Text>
<View style={filePageStyle.tagList}>{this.renderTags(tags)}</View>
</View>
)}
@@ -1165,20 +1150,9 @@ class FilePage extends React.PureComponent {
</ScrollView>
</View>
)}
{this.state.showTipView && (
<ModalTipView
claim={claim}
channelName={channelName}
contentName={title}
onCancelPress={() => this.setState({ showTipView: false })}
onOverlayPress={() => this.setState({ showTipView: false })}
onSendTipSuccessful={() => this.setState({ showTipView: false })}
/>
{!this.state.fullscreenMode && !this.state.showImageViewer && !this.state.showWebView && (
<FloatingWalletBalance navigation={navigation} />
)}
{!this.state.fullscreenMode &&
!this.state.showTipView &&
!this.state.showImageViewer &&
!this.state.showWebView && <FloatingWalletBalance navigation={navigation} />}
</View>
);
}
-2
View File
@@ -8,7 +8,6 @@ import {
doUserEmailNew,
doUserResendVerificationEmail,
selectAuthToken,
selectEmailAlreadyExists,
selectEmailNewErrorMessage,
selectEmailNewIsPending,
selectEmailToVerify,
@@ -29,7 +28,6 @@ const select = state => ({
authenticating: selectAuthenticationIsPending(state),
authToken: selectAuthToken(state),
emailToVerify: selectEmailToVerify(state),
emailAlreadyExists: selectEmailAlreadyExists(state),
emailNewErrorMessage: selectEmailNewErrorMessage(state),
emailNewPending: selectEmailNewIsPending(state),
hasSyncedWallet: selectHasSyncedWallet(state),
@@ -64,7 +64,7 @@ class EmailCollectPage extends React.PureComponent {
}}
/>
<Text style={firstRunStyle.paragraph}>
{__('A lbry.tv account allows you to earn rewards, backup your wallet, and keep everything in sync.')}
{__('An account will allow you to earn rewards and keep your account and settings synced.')}
</Text>
<Text style={firstRunStyle.infoParagraph}>
{__('This information is disclosed only to LBRY, Inc. and not to the LBRY network.')}
@@ -17,26 +17,24 @@ class EmailVerifyPage extends React.PureComponent {
};
render() {
const { onEmailViewLayout, email, emailAlreadyExists } = this.props;
const { onEmailViewLayout, email } = this.props;
const content = (
<View onLayout={() => onEmailViewLayout('verify')}>
<Text style={firstRunStyle.title}>{emailAlreadyExists ? __('Sign In') : __('Verify Email')}</Text>
<Text style={firstRunStyle.title}>Verify Email</Text>
<Text style={firstRunStyle.paragraph}>
{__('An email has been sent to')}
{'\n\n'}
{email}
{'\n\n'}
{emailAlreadyExists && __('Please click the link in the message to complete signing in')}
{!emailAlreadyExists && __('Please click the link in the message to verify your email address')}.
An email has been sent to{' '}
<Text style={firstRunStyle.nowrap} numberOfLines={1}>
{email}
</Text>
. Please follow the instructions in the message to verify your email address.
</Text>
<View style={firstRunStyle.buttonContainer}>
<Button
style={firstRunStyle.verificationButton}
theme={'light'}
text={__('Resend')}
text={'Resend'}
onPress={this.onResendPressed}
/>
</View>
+10 -1
View File
@@ -113,7 +113,7 @@ class WalletPage extends React.PureComponent {
// only display this view if it's not a new user (or auto-login has been attempted once)
content = (
<View onLayout={onWalletViewLayout}>
<Text style={firstRunStyle.title}>{__('Password')}</Text>
<Text style={firstRunStyle.title}>Password</Text>
<Text style={firstRunStyle.paragraph}>
{hasSyncedWallet
? __('Please enter the password you used to secure your wallet.')
@@ -146,6 +146,15 @@ class WalletPage extends React.PureComponent {
<Icon name={this.state.revealPassword ? 'eye-slash' : 'eye'} size={16} style={firstRunStyle.revealIcon} />
</TouchableOpacity>
</View>
{(!this.state.password || this.state.password.trim().length === 0) && (
<View style={firstRunStyle.passwordWarning}>
<Text style={firstRunStyle.passwordWarningText}>
{hasSyncedWallet
? __('If you did not provide a password, please press Use LBRY to continue.')
: __('You can proceed without a password, but this is not recommended.')}
</Text>
</View>
)}
{(!hasSyncedWallet && this.state.password && this.state.password.trim().length) > 0 && (
<View style={firstRunStyle.passwordStrength}>
+1 -1
View File
@@ -103,7 +103,7 @@ class WelcomePage extends React.PureComponent {
} else {
content = (
<View onLayout={onWelcomePageLayout}>
<Text style={firstRunStyle.title}>{__('Welcome to LBRY.')}</Text>
<Text style={firstRunStyle.title}>Welcome to LBRY.</Text>
<Text style={firstRunStyle.paragraph}>
{__(
'LBRY is a community-controlled content platform where you can find and publish videos, music, books, and more.'
+3 -13
View File
@@ -28,7 +28,6 @@ class FirstRunScreen extends React.PureComponent {
emailCollectTracked: false,
emailSubmitted: false,
enterPasswordTracked: false,
autoLoginTried: false,
isFirstRun: false,
launchUrl: null,
languageLoaded: false,
@@ -39,6 +38,7 @@ class FirstRunScreen extends React.PureComponent {
walletPassword: '',
syncApplyStarted: false,
syncApplyCompleted: false,
language: null,
};
componentDidMount() {
@@ -126,16 +126,8 @@ class FirstRunScreen extends React.PureComponent {
if (this.state.syncApplyStarted && !syncApplyIsPending) {
if (syncApplyErrorMessage && syncApplyErrorMessage.trim().length > 0) {
if (this.state.autoLoginTried) {
// don't show the error message for auto-login if it fails
notify({ message: __(syncApplyErrorMessage), isError: true });
}
this.setState({
autoLoginTried: true,
showBottomContainer: true,
syncApplyStarted: false,
syncApplyCompleted: false,
});
notify({ message: __(syncApplyErrorMessage), isError: true });
this.setState({ showBottomContainer: true, syncApplyStarted: false, syncApplyCompleted: false });
} else {
this.setState({ syncApplyCompleted: true });
// password successfully verified
@@ -387,7 +379,6 @@ class FirstRunScreen extends React.PureComponent {
authenticating,
authToken,
checkSync,
emailAlreadyExists,
emailNewErrorMessage,
emailNewPending,
emailToVerify,
@@ -429,7 +420,6 @@ class FirstRunScreen extends React.PureComponent {
<EmailVerifyPage
onEmailViewLayout={this.onEmailViewLayout}
email={this.state.email}
emailAlreadyExists={emailAlreadyExists}
notify={notify}
resendVerificationEmail={resendVerificationEmail}
/>
-10
View File
@@ -19,7 +19,6 @@ import {
isNameValid,
batchActions,
buildURI,
formatCredits,
normalizeURI,
parseURI,
regexInvalidURI,
@@ -84,7 +83,6 @@ class PublishPage extends React.PureComponent {
state = {
canPublish: true,
canUseCamera: false,
creditsInputFocused: false,
documentPickerOpen: false,
editMode: false,
titleFocused: false,
@@ -1135,16 +1133,8 @@ class PublishPage extends React.PureComponent {
keyboardType={'numeric'}
value={String(this.state.bid)}
onChangeText={this.handleBidChange}
onFocus={() => this.setState({ creditsInputFocused: true })}
onBlur={() => this.setState({ creditsInputFocused: false })}
/>
<Text style={publishStyle.currency}>LBC</Text>
<View style={publishStyle.balance}>
{this.state.creditsInputFocused && <Icon name="coins" size={12} />}
{this.state.creditsInputFocused && (
<Text style={publishStyle.balanceText}>{formatCredits(parseFloat(balance), 1, true)}</Text>
)}
</View>
</View>
<Text style={publishStyle.helpText}>
{__('This LBC remains yours and the deposit can be undone at any time.')}
+1 -1
View File
@@ -104,7 +104,7 @@ class RewardsPage extends React.PureComponent {
if (this.state.isEmailVerified && this.state.isIdentityVerified && !this.state.isRewardApproved) {
return (
<View style={[rewardStyle.card, rewardStyle.verification]}>
<Text style={rewardStyle.title}>{__('Manual Reward Verification')}</Text>
<Text style={rewardStyle.title}>Manual Reward Verification</Text>
<Text style={rewardStyle.text}>
__('You need to be manually verified before you can start claiming rewards.') Please request to be verified
on the{' '}
+2 -1
View File
@@ -109,7 +109,8 @@ class SearchPage extends React.PureComponent {
return (
<View style={searchStyle.noResults}>
<Text style={searchStyle.noResultsText}>
{__('There are no results to display for "%query%". Please try a different search term.', { query })}
There are no results to display for <Text style={searchStyle.boldText}>{query}</Text>. Please try a different
search term.
</Text>
</View>
);
+22 -30
View File
@@ -89,41 +89,33 @@ class SettingsPage extends React.PureComponent {
}
// check the local filesystem for the language first? Or download remote strings first?
if (language === 'en') {
// don't attempt to download English
NativeModules.UtilityModule.setNativeStringSetting(SETTINGS.LANGUAGE, language);
// update state and client setting
window.language = language;
setClientSetting(SETTINGS.LANGUAGE, value);
} else {
// download and save the language file
this.setState({ downloadingLanguage: true }, () => {
fetch('https://lbry.com/i18n/get/lbry-mobile/app-strings/' + language + '.json')
.then(r => r.json())
.then(j => {
window.i18n_messages[language] = j;
// download and save the language file
this.setState({ downloadingLanguage: true }, () => {
fetch('https://lbry.com/i18n/get/lbry-mobile/app-strings/' + language + '.json')
.then(r => r.json())
.then(j => {
window.i18n_messages[language] = j;
// write the language file to the filesystem
const langFilePath = RNFS.ExternalDirectoryPath + '/' + language + '.json';
RNFS.writeFile(langFilePath, JSON.stringify(j), 'utf8');
// write the language file to the filesystem
const langFilePath = RNFS.ExternalDirectoryPath + '/' + language + '.json';
RNFS.writeFile(langFilePath, JSON.stringify(j), 'utf8');
// save the setting outside redux because when the first component mounts, the redux value isn't loaded yet
// so we have to load it from native settings
NativeModules.UtilityModule.setNativeStringSetting(SETTINGS.LANGUAGE, language);
// save the setting outside redux because when the first component mounts, the redux value isn't loaded yet
// so we have to load it from native settings
NativeModules.UtilityModule.setNativeStringSetting(SETTINGS.LANGUAGE, value);
// update state and client setting
window.language = language;
setClientSetting(SETTINGS.LANGUAGE, value);
// update state and client setting
window.language = language;
setClientSetting(SETTINGS.LANGUAGE, value);
this.setState({ downloadingLanguage: false });
})
.catch(e => {
notify({ message: __('Failed to load %language% translations.', { language: language }), isError: true });
this.setState({ downloadingLanguage: false });
});
});
}
this.setState({ downloadingLanguage: false });
})
.catch(e => {
notify({ message: __('Failed to load %language% translations.', { language: language }), isError: true });
this.setState({ downloadingLanguage: false });
});
});
};
handleBackPressed = () => {
+8 -9
View File
@@ -171,6 +171,7 @@ class SplashScreen extends React.PureComponent {
_updateStatusCallback(status) {
const { fetchSubscriptions, getSync, setClientSetting } = this.props;
const blockchainHeaders = status.blockchain_headers;
const startupStatus = status.startup_status;
const walletStatus = status.wallet;
@@ -221,11 +222,10 @@ class SplashScreen extends React.PureComponent {
return;
}
const headerSyncProgress = walletStatus ? walletStatus.headers_synchronization_progress : null;
if (headerSyncProgress && headerSyncProgress < 100) {
if (blockchainHeaders) {
this.setState({
isDownloadingHeaders: true,
headersDownloadProgress: headerSyncProgress,
isDownloadingHeaders: blockchainHeaders.downloading_headers,
headersDownloadProgress: blockchainHeaders.download_progress,
});
} else {
// set downloading flag to false if blockchain_headers isn't in the status response
@@ -234,16 +234,15 @@ class SplashScreen extends React.PureComponent {
});
}
if (headerSyncProgress < 100) {
const downloadProgress = isNaN(parseInt(headerSyncProgress, 10)) ? '0' : headerSyncProgress || '0';
if (blockchainHeaders && blockchainHeaders.downloading_headers) {
const downloadProgress = blockchainHeaders.download_progress ? blockchainHeaders.download_progress : 0;
this.setState({
message: __('Blockchain Sync'),
details: __('Catching up with the blockchain (%progress%%)', { progress: downloadProgress }),
details: `Catching up with the blockchain (${downloadProgress}%)`, // TODO: i18n tokenization
});
} else if (walletStatus && walletStatus.blocks_behind > 0) {
const behind = walletStatus.blocks_behind;
const behindText =
behind === 1 ? __('%num% block behind', { num: behind }) : __('%num% blocks behind', { num: behind });
const behindText = behind + ' block' + (behind === 1 ? '' : 's') + ' behind'; // TODO: i18n tokenization
this.setState({
message: __('Blockchain Sync'),
details: behindText,
-2
View File
@@ -1,6 +1,5 @@
import { connect } from 'react-redux';
import {
doChannelUnsubscribe,
doFetchMySubscriptions,
doSetViewMode,
doFetchRecommendedSubscriptions,
@@ -37,7 +36,6 @@ const select = state => ({
});
const perform = dispatch => ({
channelUnsubscribe: subscription => dispatch(doChannelUnsubscribe(subscription)),
doFetchMySubscriptions: () => dispatch(doFetchMySubscriptions()),
doFetchRecommendedSubscriptions: () => dispatch(doFetchRecommendedSubscriptions()),
doSetViewMode: viewMode => dispatch(doSetViewMode(viewMode)),
+1 -13
View File
@@ -82,8 +82,6 @@ class SubscriptionsPage extends React.PureComponent {
if (Constants.DRAWER_ROUTE_SUBSCRIPTIONS === currentRoute && currentRoute !== prevRoute) {
this.onComponentFocused();
}
this.unsubscribeShortChannelUrls();
}
handleSortByItemSelected = item => {
@@ -111,16 +109,6 @@ class SubscriptionsPage extends React.PureComponent {
return [Constants.ALL_PLACEHOLDER].concat(channelUris);
};
// Added in 0.12.1. Can be dropped on or after 1 Feb 2020.
unsubscribeShortChannelUrls = () => {
// this should only have to happen once
const { subscribedChannels, channelUnsubscribe } = this.props;
const badSubs = subscribedChannels.filter(sub => sub.uri.split('#')[1].length < 5);
if (badSubs.length > 0) {
badSubs.forEach(sub => channelUnsubscribe(sub));
}
};
render() {
const {
suggestedChannels,
@@ -255,7 +243,7 @@ class SubscriptionsPage extends React.PureComponent {
title={__('Sort content by')}
onOverlayPress={() => this.setState({ showSortPicker: false })}
onItemSelected={this.handleSortByItemSelected}
selectedItem={currentSortByItem}
selectedItem={this.state.currentSortByItem}
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
/>
)}
-2
View File
@@ -14,7 +14,6 @@ import {
selectPhoneToVerify,
selectPhoneVerifyIsPending,
selectPhoneVerifyErrorMessage,
selectEmailAlreadyExists,
selectEmailNewErrorMessage,
selectEmailNewIsPending,
selectEmailToVerify,
@@ -33,7 +32,6 @@ import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import Verification from './view';
const select = state => ({
emailAlreadyExists: selectEmailAlreadyExists(state),
emailToVerify: selectEmailToVerify(state),
emailNewErrorMessage: selectEmailNewErrorMessage(state),
emailNewPending: selectEmailNewIsPending(state),
@@ -105,20 +105,16 @@ class EmailVerifyPage extends React.PureComponent {
};
render() {
const { emailAlreadyExists, emailNewPending } = this.props;
const { emailNewPending } = this.props;
return (
<View style={firstRunStyle.container}>
<Text style={rewardStyle.verificationTitle}>
{Constants.PHASE_COLLECTION === this.state.phase
? __('Email')
: emailAlreadyExists
? __('Sign In')
: __('Verify Email')}
{Constants.PHASE_COLLECTION === this.state.phase ? __('Email') : __('Verify Email')}
</Text>
{Constants.PHASE_COLLECTION === this.state.phase && (
<View>
<Text style={firstRunStyle.paragraph}>{__('Please provide an email address.')}</Text>
<Text style={firstRunStyle.paragraph}>Please provide an email address.</Text>
<TextInput
style={firstRunStyle.emailInput}
placeholder={this.state.placeholder}
@@ -142,7 +138,7 @@ class EmailVerifyPage extends React.PureComponent {
<Button
style={rewardStyle.verificationButton}
theme={'light'}
text={__('Continue')}
text={__('Send verification email')}
onPress={this.onSendVerificationPressed}
/>
)}
@@ -158,12 +154,8 @@ class EmailVerifyPage extends React.PureComponent {
{Constants.PHASE_VERIFICATION === this.state.phase && (
<View>
<Text style={firstRunStyle.paragraph}>
{__('An email has been sent to')}
{'\n\n'}
{this.state.email}
{'\n\n'}
{emailAlreadyExists && __('Please click the link in the message to complete signing in.')}
{!emailAlreadyExists && __('Please click the link in the message to verify your email address')}
An email has been sent to <Text style={firstRunStyle.nowrap}>{this.state.email}</Text>. Please follow the
instructions in the message to verify your email address.
</Text>
<View style={rewardStyle.buttonContainer}>
@@ -20,22 +20,22 @@ class ManualVerifyPage extends React.PureComponent {
render() {
return (
<View style={firstRunStyle.container}>
<Text style={rewardStyle.verificationTitle}>{__('Manual Reward Verification')}</Text>
<Text style={rewardStyle.verificationTitle}>Manual Reward Verification</Text>
<Text style={firstRunStyle.spacedParagraph}>
{__(
'This account must undergo review before you can participate in the rewards program. This can take anywhere from several minutes to several days.'
)}
</Text>
<Text style={firstRunStyle.spacedParagraph}>
{__('If you continue to see this message, please request to be verified on the')}{' '}
If you continue to see this message, please request to be verified on the{' '}
<Link
style={rewardStyle.underlinedTextLink}
href="https://discordapp.com/invite/Z3bERWA"
text={__('LBRY Discord server')}
text="LBRY Discord server"
/>
.
</Text>
<Text style={firstRunStyle.spacedParagraph}>{__('Please enjoy free content in the meantime!')}</Text>
<Text style={firstRunStyle.spacedParagraph}>Please enjoy free content in the meantime!</Text>
</View>
);
}
@@ -75,7 +75,7 @@ class PhoneVerifyPage extends React.PureComponent {
notify({ message: String(phoneVerifyErrorMessage) });
this.setState({ codeVerifyStarted: false, phoneVerifyFailed: true });
} else {
notify({ message: __('Your phone number was successfully verified.') });
notify({ message: 'Your phone number was successfully verified.' });
this.setState({ codeVerifySuccessful: true, phoneVerifyFailed: false });
if (onPhoneVerifySuccessful) {
onPhoneVerifySuccessful();
@@ -103,7 +103,7 @@ class PhoneVerifyPage extends React.PureComponent {
if (!this.phoneInput.isValidNumber()) {
return notify({
message: __('Please provide a valid telephone number.'),
message: 'Please provide a valid telephone number.',
});
}
@@ -145,7 +145,7 @@ class PhoneVerifyPage extends React.PureComponent {
return (
<View style={firstRunStyle.container}>
<Text style={rewardStyle.verificationTitle}>
{this.state.phase === Constants.PHASE_VERIFICATION ? __('Verify Phone Number') : __('Phone Number')}
{this.state.phase === Constants.PHASE_VERIFICATION ? 'Verify ' : ''}Phone Number
</Text>
<View style={rewardStyle.phoneVerificationContainer}>
@@ -169,7 +169,7 @@ class PhoneVerifyPage extends React.PureComponent {
<Button
style={[rewardStyle.verificationButton, rewardStyle.topMarginMedium]}
theme={'light'}
text={__('Send verification text')}
text={'Send verification text'}
onPress={this.onSendTextPressed}
/>
)}
@@ -187,7 +187,7 @@ class PhoneVerifyPage extends React.PureComponent {
{!phoneVerifyIsPending && !this.codeVerifyStarted && (
<View>
<Text style={[rewardStyle.bottomMarginSmall, firstRunStyle.paragraph]}>
{__('Please enter the verification code sent to %phone%', { phone })}.
Please enter the verification code sent to {phone}.
</Text>
<TextInput
style={rewardStyle.verificationCodeInput}
@@ -202,16 +202,16 @@ class PhoneVerifyPage extends React.PureComponent {
<Button
style={[rewardStyle.verificationButton, rewardStyle.topMarginSmall]}
theme={'light'}
text={__('Verify')}
text={'Verify'}
onPress={this.onVerifyPressed}
/>
<Link style={rewardStyle.verificationLink} text={__('Edit')} onPress={this.onEditPressed} />
<Link style={rewardStyle.verificationLink} text={'Edit'} onPress={this.onEditPressed} />
</View>
</View>
)}
{phoneVerifyIsPending && (
<View style={firstRunStyle.centered}>
<Text style={firstRunStyle.paragraph}>{__('Verifying your phone number...')}</Text>
<Text style={firstRunStyle.paragraph}>Verifying your phone number...</Text>
<ActivityIndicator
color={Colors.White}
size="small"
@@ -14,14 +14,13 @@ class SyncVerifyPage extends React.PureComponent {
state = {
checkSyncStarted: false,
password: null,
placeholder: __('password'),
placeholder: 'password',
syncApplyStarted: false,
syncApplyCompleted: false,
syncChecked: false,
revealPassword: false,
autoPassword: false,
autoLoginAttempted: false,
autoLoginTried: false,
autoLoginFlow: true,
};
@@ -68,10 +67,8 @@ class SyncVerifyPage extends React.PureComponent {
if (this.state.syncApplyStarted && !syncApplyIsPending) {
if (syncApplyErrorMessage && syncApplyErrorMessage.trim().length > 0) {
if (this.state.autoLoginTried) {
notify({ message: __(syncApplyErrorMessage), isError: true });
}
this.setState({ autoLoginTried: true, syncApplyStarted: false, autoLoginFlow: false });
notify({ message: __(syncApplyErrorMessage), isError: true });
this.setState({ syncApplyStarted: false, autoLoginFlow: false });
} else {
// password successfully verified
this.setState({ syncApplyCompleted: true });
@@ -185,7 +182,7 @@ class SyncVerifyPage extends React.PureComponent {
}}
onBlur={() => {
if (!this.state.password || this.state.password.length === 0) {
this.setState({ placeholder: __('password') });
this.setState({ placeholder: 'password' });
}
}}
/>
@@ -197,6 +194,16 @@ class SyncVerifyPage extends React.PureComponent {
</TouchableOpacity>
</View>
{(!this.state.password || this.state.password.trim().length === 0) && (
<View style={firstRunStyle.passwordWarning}>
<Text style={firstRunStyle.passwordWarningText}>
{hasSyncedWallet
? __('If you did not provide a password, please press Use LBRY to continue.')
: __('You can proceed without a password, but this is not recommended.')}
</Text>
</View>
)}
{(!hasSyncedWallet && this.state.password && this.state.password.trim().length) > 0 && (
<View style={firstRunStyle.passwordStrength}>
<BarPasswordStrengthDisplay
-2
View File
@@ -118,7 +118,6 @@ class VerificationScreen extends React.PureComponent {
addUserEmail,
checkSync,
emailNewErrorMessage,
emailAlreadyExists,
emailNewPending,
emailToVerify,
getSync,
@@ -149,7 +148,6 @@ class VerificationScreen extends React.PureComponent {
page = (
<EmailVerifyPage
addUserEmail={addUserEmail}
emailAlreadyExists={emailAlreadyExists}
emailNewErrorMessage={emailNewErrorMessage}
emailNewPending={emailNewPending}
emailToVerify={emailToVerify}
-10
View File
@@ -30,16 +30,6 @@ const channelCreatorStyle = StyleSheet.create({
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
},
balance: {
alignItems: 'center',
flexDirection: 'row',
marginLeft: 24,
},
balanceText: {
fontFamily: 'Inter-UI-SemiBold',
fontSize: 14,
marginLeft: 4,
},
channelNameInput: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
+1 -10
View File
@@ -145,7 +145,7 @@ const channelPageStyle = StyleSheet.create({
position: 'absolute',
overflow: 'hidden',
left: 24,
bottom: -24,
bottom: -40,
zIndex: 100,
alignItems: 'center',
justifyContent: 'center',
@@ -176,15 +176,6 @@ const channelPageStyle = StyleSheet.create({
marginLeft: 8,
marginRight: 8,
},
tipButton: {
marginRight: 8,
},
followerCount: {
fontFamily: 'Inter-UI-Regular',
fontSize: 12,
color: Colors.White,
marginTop: 2,
},
});
export default channelPageStyle;
-10
View File
@@ -24,16 +24,6 @@ const channelSelectorStyle = StyleSheet.create({
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
},
balance: {
alignItems: 'center',
flexDirection: 'row',
marginLeft: 24,
},
balanceText: {
fontFamily: 'Inter-UI-SemiBold',
fontSize: 14,
marginLeft: 4,
},
channelNameInput: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
+5 -30
View File
@@ -277,7 +277,6 @@ const filePageStyle = StyleSheet.create({
amountRow: {
flexDirection: 'row',
flex: 0.75,
alignItems: 'center',
},
button: {
backgroundColor: Colors.LbryGreen,
@@ -300,7 +299,9 @@ const filePageStyle = StyleSheet.create({
letterSpacing: 1,
},
currency: {
alignSelf: 'flex-start',
fontSize: 12,
marginTop: 15,
marginLeft: 4,
},
descriptionToggle: {
@@ -380,19 +381,10 @@ const filePageStyle = StyleSheet.create({
backButtonIcon: {
color: Colors.White,
},
sharedLargeButton: {
alignItems: 'center',
justifyContent: 'center',
flex: 0.2,
},
innerLargeButton: {
alignItems: 'center',
justifyContent: 'center',
},
largeButton: {
alignItems: 'center',
justifyContent: 'center',
flex: 0.2,
marginRight: 48,
},
largeButtonIcon: {
color: Colors.DescriptionGrey,
@@ -405,8 +397,8 @@ const filePageStyle = StyleSheet.create({
largeButtonsRow: {
flexDirection: 'row',
alignItems: 'center',
marginLeft: 16,
marginRight: 16,
marginLeft: 20,
marginRight: 20,
marginTop: 12,
marginBottom: 12,
},
@@ -446,23 +438,6 @@ const filePageStyle = StyleSheet.create({
relatedLoading: {
marginTop: 16,
},
viewCount: {
fontFamily: 'Inter-UI-Regular',
fontSize: 12,
color: Colors.DescriptionGrey,
marginLeft: 12,
marginRight: 12,
},
balance: {
alignItems: 'center',
flexDirection: 'row',
marginLeft: 24,
},
balanceText: {
fontFamily: 'Inter-UI-SemiBold',
fontSize: 14,
marginLeft: 4,
},
});
export default filePageStyle;
-71
View File
@@ -1,71 +0,0 @@
import { StyleSheet } from 'react-native';
import Colors from './colors';
const modalTipStyle = StyleSheet.create({
container: {
padding: 16,
},
title: {
fontFamily: 'Inter-UI-Regular',
fontSize: 24,
},
row: {
flexDirection: 'row',
flex: 1,
},
amountRow: {
flexDirection: 'row',
alignItems: 'center',
marginRight: 24,
},
tipAmountInput: {
fontFamily: 'Inter-UI-Regular',
fontSize: 14,
alignSelf: 'flex-start',
textAlign: 'right',
width: 80,
letterSpacing: 1,
},
currency: {
fontFamily: 'Inter-UI-Regular',
fontSize: 12,
marginLeft: 4,
},
buttonRow: {
alignItems: 'center',
flexDirection: 'row',
justifyContent: 'space-between',
marginTop: 16,
},
button: {
backgroundColor: Colors.LbryGreen,
},
cancelTipLink: {
color: Colors.Grey,
},
balance: {
alignItems: 'center',
flexDirection: 'row',
marginLeft: 24,
},
balanceText: {
fontFamily: 'Inter-UI-SemiBold',
fontSize: 14,
marginLeft: 4,
},
info: {
marginTop: 4,
},
infoText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 14,
color: Colors.DescriptionGrey,
},
learnMoreLink: {
fontFamily: 'Inter-UI-Regular',
fontSize: 14,
color: Colors.LbryGreen,
},
});
export default modalTipStyle;
-10
View File
@@ -466,16 +466,6 @@ const publishStyle = StyleSheet.create({
fontFamily: 'Inter-UI-SemiBold',
fontSize: 12,
},
balance: {
alignItems: 'center',
flexDirection: 'row',
marginLeft: 24,
},
balanceText: {
fontFamily: 'Inter-UI-SemiBold',
fontSize: 14,
marginLeft: 4,
},
});
export default publishStyle;
-10
View File
@@ -126,16 +126,6 @@ const walletStyle = StyleSheet.create({
marginLeft: 16,
marginBottom: 16,
},
balanceFocus: {
alignItems: 'center',
flexDirection: 'row',
marginLeft: 24,
},
balanceText: {
fontFamily: 'Inter-UI-SemiBold',
fontSize: 14,
marginLeft: 4,
},
infoText: {
color: '#aaaaaa',
fontFamily: 'Inter-UI-Regular',
-14
View File
@@ -155,14 +155,6 @@ export function navigateToUri(navigation, uri, additionalParams, isNavigatingBac
}
export function navigateBack(navigation, drawerStack, popDrawerStack) {
if (drawerStack[drawerStack.length - 1].route === Constants.DRAWER_ROUTE_FILE_VIEW) {
// inner file_view (web / image view) is handled differently
if (popDrawerStack) {
popDrawerStack();
}
return;
}
if (popDrawerStack) {
popDrawerStack();
}
@@ -194,12 +186,6 @@ export function navigateBack(navigation, drawerStack, popDrawerStack) {
}
export function dispatchNavigateBack(dispatch, nav, drawerStack) {
if (drawerStack[drawerStack.length - 1].route === Constants.DRAWER_ROUTE_FILE_VIEW) {
// inner file_view (web / image view) is handled differently
dispatch(doPopDrawerStack());
return;
}
dispatch(doPopDrawerStack());
const target = drawerStack[drawerStack.length > 1 ? drawerStack.length - 2 : 0];