Compare commits
23
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50cab8722f | ||
|
|
ab97be6a4d | ||
|
|
e39f5907a8 | ||
|
|
c203aa914c | ||
|
|
f0a3eec80b | ||
|
|
47bb996342 | ||
|
|
aba0b860e8 | ||
|
|
b135ca36a3 | ||
|
|
46b99e769f | ||
|
|
b5dad6b5fb | ||
|
|
31d4d46742 | ||
|
|
5d86b68a3e | ||
|
|
62ac844084 | ||
|
|
eebb25dba0 | ||
|
|
88e450eb08 | ||
|
|
ca8670e23c | ||
|
|
1b4c023c92 | ||
|
|
9aabad56a2 | ||
|
|
3051deb7c7 | ||
|
|
f2f5cd9ad5 | ||
|
|
f800f22277 | ||
|
|
2558f0c392 | ||
|
|
02d8107b50 |
No files matched your search
Generated
+4
-4
@@ -5640,8 +5640,8 @@
|
||||
}
|
||||
},
|
||||
"lbry-redux": {
|
||||
"version": "github:lbryio/lbry-redux#d44cd9ca56dee784dba42c0cc13061ae75cbd46c",
|
||||
"from": "github:lbryio/lbry-redux#d44cd9ca56dee784dba42c0cc13061ae75cbd46c",
|
||||
"version": "github:lbryio/lbry-redux#7ec72a737bcd336f000c5f5085891643110298c3",
|
||||
"from": "github:lbryio/lbry-redux#7ec72a737bcd336f000c5f5085891643110298c3",
|
||||
"requires": {
|
||||
"proxy-polyfill": "0.1.6",
|
||||
"reselect": "^3.0.0",
|
||||
@@ -5649,8 +5649,8 @@
|
||||
}
|
||||
},
|
||||
"lbryinc": {
|
||||
"version": "github:lbryio/lbryinc#d250096a6fc5df16be4f82812ecce28d6e558b6e",
|
||||
"from": "github:lbryio/lbryinc#d250096a6fc5df16be4f82812ecce28d6e558b6e",
|
||||
"version": "github:lbryio/lbryinc#c55a2c98ab92c72149c824ee5906aed4404fd89b",
|
||||
"from": "github:lbryio/lbryinc#c55a2c98ab92c72149c824ee5906aed4404fd89b",
|
||||
"requires": {
|
||||
"reselect": "^3.0.0"
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@
|
||||
"base-64": "^0.1.0",
|
||||
"@expo/vector-icons": "^8.1.0",
|
||||
"gfycat-style-urls": "^1.0.3",
|
||||
"lbry-redux": "lbryio/lbry-redux#d44cd9ca56dee784dba42c0cc13061ae75cbd46c",
|
||||
"lbryinc": "lbryio/lbryinc#d250096a6fc5df16be4f82812ecce28d6e558b6e",
|
||||
"lbry-redux": "lbryio/lbry-redux#7ec72a737bcd336f000c5f5085891643110298c3",
|
||||
"lbryinc": "lbryio/lbryinc#c55a2c98ab92c72149c824ee5906aed4404fd89b",
|
||||
"lodash": ">=4.17.11",
|
||||
"merge": ">=1.2.1",
|
||||
"moment": "^2.22.1",
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import { connect } from 'react-redux';
|
||||
import ChannelRewardsDriver from './view';
|
||||
|
||||
export default connect()(ChannelRewardsDriver);
|
||||
@@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import { Text, TouchableOpacity } from 'react-native';
|
||||
import Colors from 'styles/colors';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
import publishStyle from 'styles/publish';
|
||||
|
||||
class ChannelRewardsDriver extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { navigation } = this.props;
|
||||
|
||||
return (
|
||||
<TouchableOpacity style={publishStyle.rewardDriverCard} onPress={() => navigation.navigate('Rewards')}>
|
||||
<Icon name="award" size={16} style={publishStyle.rewardIcon} />
|
||||
<Text style={publishStyle.rewardDriverText}>Earn some credits to be able to create your channel.</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ChannelRewardsDriver;
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { CLAIM_VALUES, isURIValid } from 'lbry-redux';
|
||||
import { CLAIM_VALUES, isNameValid } from 'lbry-redux';
|
||||
import { ActivityIndicator, Picker, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
||||
import Button from 'component/button';
|
||||
import Colors from 'styles/colors';
|
||||
@@ -85,7 +85,7 @@ export default class ChannelSelector extends React.PureComponent {
|
||||
newChannelName = newChannelName.slice(1);
|
||||
}
|
||||
|
||||
if (newChannelName.trim().length > 0 && !isURIValid(newChannelName)) {
|
||||
if (newChannelName.trim().length > 0 && !isNameValid(newChannelName)) {
|
||||
newChannelNameError = 'Your channel name contains invalid characters.';
|
||||
} else if (this.channelExists(newChannelName)) {
|
||||
newChannelNameError = 'You have already created a channel with the same name.';
|
||||
@@ -120,7 +120,7 @@ export default class ChannelSelector extends React.PureComponent {
|
||||
const { balance, createChannel, onChannelChange, notify } = this.props;
|
||||
const { newChannelBid, newChannelName } = this.state;
|
||||
|
||||
if (newChannelName.trim().length === 0 || !isURIValid(newChannelName.substr(1), false)) {
|
||||
if (newChannelName.trim().length === 0 || !isNameValid(newChannelName.substr(1), false)) {
|
||||
notify({ message: 'Your channel name contains invalid characters.' });
|
||||
return;
|
||||
}
|
||||
@@ -167,12 +167,14 @@ export default class ChannelSelector extends React.PureComponent {
|
||||
|
||||
channelExists = name => {
|
||||
const { channels = [] } = this.props;
|
||||
for (let channel of channels) {
|
||||
if (
|
||||
name.toLowerCase() === channel.name.toLowerCase() ||
|
||||
`@${name}`.toLowerCase() === channel.name.toLowerCase()
|
||||
) {
|
||||
return true;
|
||||
if (channels) {
|
||||
for (let channel of channels) {
|
||||
if (
|
||||
name.toLowerCase() === channel.name.toLowerCase() ||
|
||||
`@${name}`.toLowerCase() === channel.name.toLowerCase()
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import { connect } from 'react-redux';
|
||||
import ModalSuggestedSubscriptions from './view';
|
||||
|
||||
export default connect()(ModalSuggestedSubscriptions);
|
||||
@@ -0,0 +1,26 @@
|
||||
import React from 'react';
|
||||
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
||||
import modalStyle from 'styles/modal';
|
||||
import subscriptionsStyle from 'styles/subscriptions';
|
||||
import Button from 'component/button';
|
||||
import Colors from 'styles/colors';
|
||||
import SuggestedSubscriptions from 'component/suggestedSubscriptions';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
|
||||
export default class ModalSuggestedSubcriptions extends React.PureComponent {
|
||||
render() {
|
||||
const { navigation, onDonePress, onOverlayPress } = this.props;
|
||||
|
||||
return (
|
||||
<TouchableOpacity style={modalStyle.overlay} activeOpacity={1} onPress={onOverlayPress}>
|
||||
<TouchableOpacity style={[modalStyle.container, subscriptionsStyle.modalContainer]} activeOpacity={1}>
|
||||
<SuggestedSubscriptions inModal navigation={navigation} />
|
||||
<View style={modalStyle.buttons}>
|
||||
<Button style={modalStyle.doneButton} text={'Done'} onPress={onDonePress} />
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import Colors from 'styles/colors';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
import publishStyle from 'styles/publish';
|
||||
|
||||
class PublishRewadsDriver extends React.PureComponent<Props> {
|
||||
class PublishRewardsDriver extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { navigation } = this.props;
|
||||
|
||||
@@ -17,4 +17,4 @@ class PublishRewadsDriver extends React.PureComponent<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default PublishRewadsDriver;
|
||||
export default PublishRewardsDriver;
|
||||
@@ -1,6 +1,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doClaimSearch, selectFetchingClaimSearch, selectClaimSearchByQuery, selectFollowedTags } from 'lbry-redux';
|
||||
import { selectSuggestedChannels, selectIsFetchingSuggested } from 'lbryinc';
|
||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||
import SuggestedSubscriptions from './view';
|
||||
|
||||
const select = state => ({
|
||||
@@ -8,6 +9,7 @@ const select = state => ({
|
||||
suggested: selectSuggestedChannels(state),
|
||||
loading: selectIsFetchingSuggested(state) || selectFetchingClaimSearch(state),
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
showNsfwContent: selectShowNsfw(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { ActivityIndicator, FlatList, SectionList, Text, View } from 'react-native';
|
||||
import { createNormalizedClaimSearchKey, normalizeURI } from 'lbry-redux';
|
||||
import { ActivityIndicator, SectionList, Text, View } from 'react-native';
|
||||
import { MATURE_TAGS, createNormalizedClaimSearchKey, normalizeURI } from 'lbry-redux';
|
||||
import { __, navigateToUri } from 'utils/helper';
|
||||
import SubscribeButton from 'component/subscribeButton';
|
||||
import SuggestedSubscriptionItem from 'component/suggestedSubscriptionItem';
|
||||
@@ -16,13 +16,16 @@ class SuggestedSubscriptions extends React.PureComponent {
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
const { claimSearch, followedTags } = this.props;
|
||||
const { claimSearch, followedTags, showNsfwContent } = this.props;
|
||||
const options = {
|
||||
any_tags: _.shuffle(followedTags.map(tag => tag.name)).slice(0, 3),
|
||||
page: 1,
|
||||
no_totals: true,
|
||||
claim_type: 'channel',
|
||||
};
|
||||
if (!showNsfwContent) {
|
||||
options.not_tags = MATURE_TAGS;
|
||||
}
|
||||
this.setState({ options });
|
||||
claimSearch(options);
|
||||
}
|
||||
@@ -35,7 +38,7 @@ class SuggestedSubscriptions extends React.PureComponent {
|
||||
const suggestedUris = suggested ? suggested.map(suggested => suggested.uri) : [];
|
||||
return [
|
||||
{
|
||||
title: __('Tags you follow'),
|
||||
title: __('Suggested channels'),
|
||||
data: claimSearchUris ? claimSearchUris.filter(uri => !suggestedUris.includes(uri)) : [],
|
||||
},
|
||||
{
|
||||
@@ -46,7 +49,7 @@ class SuggestedSubscriptions extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { suggested, loading, navigation } = this.props;
|
||||
const { suggested, inModal, loading, navigation } = this.props;
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
@@ -58,8 +61,10 @@ class SuggestedSubscriptions extends React.PureComponent {
|
||||
|
||||
return (
|
||||
<SectionList
|
||||
style={subscriptionsStyle.scrollContainer}
|
||||
contentContainerStyle={subscriptionsStyle.suggestedScrollPadding}
|
||||
style={inModal ? subscriptionsStyle.modalScrollContainer : subscriptionsStyle.scrollContainer}
|
||||
contentContainerStyle={
|
||||
inModal ? subscriptionsStyle.modalSuggestedScrollContent : subscriptionsStyle.suggestedScrollContent
|
||||
}
|
||||
renderItem={({ item, index, section }) => (
|
||||
<SuggestedSubscriptionItem key={item} uri={normalizeURI(item)} navigation={navigation} />
|
||||
)}
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ const compressor = createCompressor();
|
||||
const authFilter = createFilter('auth', ['authToken']);
|
||||
const contentFilter = createFilter('content', ['positions']);
|
||||
const saveClaimsFilter = createFilter('claims', ['claimsByUri']);
|
||||
const subscriptionsFilter = createFilter('subscriptions', ['enabledChannelNotifications', 'subscriptions']);
|
||||
const subscriptionsFilter = createFilter('subscriptions', ['enabledChannelNotifications', 'subscriptions', 'latest']);
|
||||
const settingsFilter = createFilter('settings', ['clientSettings']);
|
||||
const tagsFilter = createFilter('tags', ['followedTags']);
|
||||
const walletFilter = createFilter('wallet', ['receiveAddress']);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { CLAIM_VALUES, isURIValid, regexInvalidURI } from 'lbry-redux';
|
||||
import { CLAIM_VALUES, isNameValid, regexInvalidURI } from 'lbry-redux';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
Alert,
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
import { navigateToUri, uploadImageAsset } from 'utils/helper';
|
||||
import Button from 'component/button';
|
||||
import ChannelIconItem from 'component/channelIconItem';
|
||||
import ChannelRewardsDriver from 'component/channelRewardsDriver';
|
||||
import Colors from 'styles/colors';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import EmptyStateView from 'component/emptyStateView';
|
||||
@@ -101,11 +102,13 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
generateAutoStyles = size => {
|
||||
const { channels = [] } = this.props;
|
||||
const autoStyles = [];
|
||||
for (let i = 0; i < size && i < channels.length; i++) {
|
||||
// seed generator using the claim_id
|
||||
const rng = seedrandom(channels[i].permanent_url); // is this efficient?
|
||||
const index = Math.floor(rng.quick() * ChannelIconItem.AUTO_THUMB_STYLES.length);
|
||||
autoStyles.push(ChannelIconItem.AUTO_THUMB_STYLES[index]);
|
||||
if (channels) {
|
||||
for (let i = 0; i < size && i < channels.length; i++) {
|
||||
// seed generator using the claim_id
|
||||
const rng = seedrandom(channels[i].permanent_url); // is this efficient?
|
||||
const index = Math.floor(rng.quick() * ChannelIconItem.AUTO_THUMB_STYLES.length);
|
||||
autoStyles.push(ChannelIconItem.AUTO_THUMB_STYLES[index]);
|
||||
}
|
||||
}
|
||||
return autoStyles;
|
||||
};
|
||||
@@ -158,7 +161,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
if (!fetchingChannels) {
|
||||
fetchChannelListMine();
|
||||
}
|
||||
if (balance > 0.1) {
|
||||
if (balance >= 0.1) {
|
||||
this.setState({ canSave: true });
|
||||
}
|
||||
|
||||
@@ -336,7 +339,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
newChannelName = newChannelName.slice(1);
|
||||
}
|
||||
|
||||
if (newChannelName.trim().length > 0 && !isURIValid(newChannelName)) {
|
||||
if (newChannelName.trim().length > 0 && !isNameValid(newChannelName)) {
|
||||
newChannelNameError = 'Your channel name contains invalid characters.';
|
||||
} else if (this.channelExists(newChannelName)) {
|
||||
newChannelNameError = 'You have already created a channel with the same name.';
|
||||
@@ -389,7 +392,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
website,
|
||||
} = this.state;
|
||||
|
||||
if (newChannelName.trim().length === 0 || !isURIValid(newChannelName.substr(1), false)) {
|
||||
if (newChannelName.trim().length === 0 || !isNameValid(newChannelName.substr(1), false)) {
|
||||
notify({ message: 'Your channel name contains invalid characters.' });
|
||||
return;
|
||||
}
|
||||
@@ -453,8 +456,8 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
return { name: tag };
|
||||
}),
|
||||
website,
|
||||
cover: coverImageUrl,
|
||||
thumbnail: thumbnailUrl,
|
||||
coverUrl: coverImageUrl,
|
||||
thumbnailUrl: thumbnailUrl,
|
||||
};
|
||||
|
||||
if (this.state.editMode) {
|
||||
@@ -478,12 +481,14 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
|
||||
channelExists = name => {
|
||||
const { channels = [] } = this.props;
|
||||
for (let channel of channels) {
|
||||
if (
|
||||
name.toLowerCase() === channel.name.toLowerCase() ||
|
||||
`@${name}`.toLowerCase() === channel.name.toLowerCase()
|
||||
) {
|
||||
return true;
|
||||
if (channels) {
|
||||
for (let channel of channels) {
|
||||
if (
|
||||
name.toLowerCase() === channel.name.toLowerCase() ||
|
||||
`@${name}`.toLowerCase() === channel.name.toLowerCase()
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,9 +528,9 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
};
|
||||
|
||||
handleNewChannelPress = () => {
|
||||
const { pushDrawerStack } = this.props;
|
||||
const { balance, pushDrawerStack } = this.props;
|
||||
pushDrawerStack(Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM);
|
||||
this.setState({ currentPhase: Constants.PHASE_CREATE });
|
||||
this.setState({ canSave: balance >= 0.1, currentPhase: Constants.PHASE_CREATE });
|
||||
};
|
||||
|
||||
handleCreateCancel = () => {
|
||||
@@ -557,8 +562,8 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
newChannelBidError: '',
|
||||
createChannelError: undefined,
|
||||
showCreateChannel: false,
|
||||
thumbnailUrl: null,
|
||||
coverImageUrl: null,
|
||||
thumbnailUrl: '',
|
||||
coverImageUrl: '',
|
||||
avatarImagePickerOpen: false,
|
||||
coverImagePickerOpen: false,
|
||||
|
||||
@@ -600,16 +605,17 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
};
|
||||
|
||||
prepareEdit = channel => {
|
||||
const { pushDrawerStack } = this.props;
|
||||
const { balance, pushDrawerStack } = this.props;
|
||||
const { value } = channel;
|
||||
|
||||
pushDrawerStack(Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM);
|
||||
this.setState({
|
||||
canSave: balance >= 0.1,
|
||||
claimId: channel.claim_id,
|
||||
currentPhase: Constants.PHASE_CREATE,
|
||||
displayName: value && value.title ? value.title : channel.name.substring(1),
|
||||
editMode: true,
|
||||
coverImageUrl: value && value.cover ? value.cover.url : null,
|
||||
coverImageUrl: value && value.cover ? value.cover.url : '',
|
||||
currentChannelName: channel.name.substring(1),
|
||||
newChannelName: channel.name.substring(1),
|
||||
newChannelTitle: value ? value.title : null,
|
||||
@@ -618,7 +624,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
email: value ? value.email : null,
|
||||
website: value ? value.website_url : null,
|
||||
tags: value && value.tags ? value.tags : [],
|
||||
thumbnailUrl: value && value.thumbnail ? value.thumbnail.url : null,
|
||||
thumbnailUrl: value && value.thumbnail ? value.thumbnail.url : '',
|
||||
showOptionalFields: value && (value.description || value.email || value.website_url || value.tags),
|
||||
});
|
||||
};
|
||||
@@ -724,7 +730,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { abandoningClaimIds, fetchingChannels, updatingChannel, channels = [], navigation } = this.props;
|
||||
const { abandoningClaimIds, balance, fetchingChannels, updatingChannel, channels = [], navigation } = this.props;
|
||||
const {
|
||||
autoStyle,
|
||||
autoStyles,
|
||||
@@ -868,7 +874,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
source={{ uri: thumbnailUrl }}
|
||||
/>
|
||||
)}
|
||||
{(thumbnailUrl === null || thumbnailUrl.trim().length === 0) && newChannelName.length > 1 && (
|
||||
{(thumbnailUrl === null || thumbnailUrl.trim().length === 0) && newChannelName.length > 0 && (
|
||||
<Text style={channelIconStyle.autothumbCharacter}>
|
||||
{newChannelName.substring(0, 1).toUpperCase()}
|
||||
</Text>
|
||||
@@ -880,6 +886,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
{balance < 0.1 && <ChannelRewardsDriver navigation={navigation} />}
|
||||
|
||||
<View style={channelCreatorStyle.card}>
|
||||
<View style={channelCreatorStyle.textInputLayout}>
|
||||
@@ -907,7 +914,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
<View>
|
||||
<Text style={channelCreatorStyle.channelAt}>@</Text>
|
||||
<TextInput
|
||||
editable={canSave && !creatingChannel && !updatingChannel}
|
||||
editable={canSave && !editMode && !creatingChannel && !updatingChannel}
|
||||
style={channelCreatorStyle.channelNameInput}
|
||||
value={this.state.newChannelName}
|
||||
onChangeText={value => this.handleNewChannelNameChange(value, true)}
|
||||
@@ -921,6 +928,10 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
{newChannelNameError.length > 0 && (
|
||||
<Text style={channelCreatorStyle.inlineError}>{newChannelNameError}</Text>
|
||||
)}
|
||||
{editMode && (
|
||||
<Text style={channelCreatorStyle.helpText}>The channel name cannot be changed while editing.</Text>
|
||||
)}
|
||||
|
||||
<View style={channelCreatorStyle.bidRow}>
|
||||
<Text style={channelCreatorStyle.label}>Deposit</Text>
|
||||
<TextInput
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
selectSubscriptionClaims,
|
||||
selectUnreadSubscriptions,
|
||||
} from 'lbryinc';
|
||||
import { doPushDrawerStack } from 'redux/actions/drawer';
|
||||
import { doSetClientSetting, doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
||||
import { makeSelectClientSetting, selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
@@ -37,6 +38,7 @@ const perform = dispatch => ({
|
||||
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
||||
fetchSubscriptions: () => dispatch(doFetchMySubscriptions()),
|
||||
fileList: () => dispatch(doFileList()),
|
||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_DISCOVER)),
|
||||
removeUnreadSubscriptions: () => dispatch(doRemoveUnreadSubscriptions()),
|
||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
||||
|
||||
+53
-46
@@ -38,8 +38,6 @@ class DiscoverPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
NativeModules.Firebase.setCurrentScreen('Your tags');
|
||||
|
||||
// Track the total time taken if this is the first launch
|
||||
AsyncStorage.getItem('firstLaunchTime').then(startTime => {
|
||||
if (startTime !== null && !isNaN(parseInt(startTime, 10))) {
|
||||
@@ -63,17 +61,39 @@ class DiscoverPage extends React.PureComponent {
|
||||
}
|
||||
});
|
||||
|
||||
const { sortByItem, fetchRewardedContent, fetchSubscriptions, fileList, followedTags } = this.props;
|
||||
const { sortByItem, fetchRewardedContent, fileList, followedTags } = this.props;
|
||||
|
||||
this.buildTagCollection(followedTags);
|
||||
fetchRewardedContent();
|
||||
fetchSubscriptions();
|
||||
fileList();
|
||||
|
||||
this.handleSortByItemSelected(sortByItem);
|
||||
this.showRatingReminder();
|
||||
|
||||
this.onComponentFocused();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { currentRoute: prevRoute, followedTags: prevFollowedTags } = this.props;
|
||||
const { currentRoute, followedTags } = nextProps;
|
||||
|
||||
if (Constants.DRAWER_ROUTE_DISCOVER === currentRoute && currentRoute !== prevRoute) {
|
||||
this.onComponentFocused();
|
||||
}
|
||||
|
||||
if (!_.isEqual(followedTags, prevFollowedTags)) {
|
||||
this.buildTagCollection(followedTags);
|
||||
}
|
||||
}
|
||||
|
||||
onComponentFocused = () => {
|
||||
const { fetchSubscriptions, pushDrawerStack } = this.props;
|
||||
// pushDrawerStack();
|
||||
NativeModules.Firebase.setCurrentScreen('Your tags').then(result => {
|
||||
fetchSubscriptions();
|
||||
});
|
||||
};
|
||||
|
||||
handleSortByItemSelected = item => {
|
||||
const { setSortByItem } = this.props;
|
||||
setSortByItem(item);
|
||||
@@ -104,56 +124,43 @@ class DiscoverPage extends React.PureComponent {
|
||||
return null;
|
||||
};
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { followedTags: prevFollowedTags } = this.props;
|
||||
const { followedTags } = nextProps;
|
||||
if (!_.isEqual(followedTags, prevFollowedTags)) {
|
||||
this.buildTagCollection(followedTags);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
const { unreadSubscriptions, enabledChannelNotifications } = this.props;
|
||||
|
||||
const utility = NativeModules.UtilityModule;
|
||||
if (utility) {
|
||||
const hasUnread =
|
||||
prevProps.unreadSubscriptions &&
|
||||
prevProps.unreadSubscriptions.length !== unreadSubscriptions.length &&
|
||||
unreadSubscriptions.length > 0;
|
||||
const hasUnread =
|
||||
prevProps.unreadSubscriptions &&
|
||||
prevProps.unreadSubscriptions.length !== unreadSubscriptions.length &&
|
||||
unreadSubscriptions.length > 0;
|
||||
|
||||
if (hasUnread) {
|
||||
unreadSubscriptions.map(({ channel, uris }) => {
|
||||
const { claimName: channelName } = parseURI(channel);
|
||||
if (hasUnread) {
|
||||
unreadSubscriptions.map(({ channel, uris }) => {
|
||||
const { claimName: channelName } = parseURI(channel);
|
||||
|
||||
// check if notifications are enabled for the channel
|
||||
if (enabledChannelNotifications.indexOf(channelName) > -1) {
|
||||
uris.forEach(uri => {
|
||||
Lbry.resolve({ urls: uri }).then(result => {
|
||||
const sub = result[uri].claim;
|
||||
if (sub && sub.value && sub.value.stream) {
|
||||
let isPlayable = false;
|
||||
const source = sub.value.stream.source;
|
||||
const metadata = sub.value.stream.metadata;
|
||||
if (source) {
|
||||
isPlayable =
|
||||
source.contentType && ['audio', 'video'].indexOf(source.contentType.substring(0, 5)) > -1;
|
||||
}
|
||||
if (metadata) {
|
||||
utility.showNotificationForContent(
|
||||
uri,
|
||||
metadata.title,
|
||||
channelName,
|
||||
metadata.thumbnail,
|
||||
isPlayable
|
||||
);
|
||||
}
|
||||
// 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
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doAbandonClaim,
|
||||
doFetchFileInfo,
|
||||
doFetchChannelListMine,
|
||||
doFetchClaimListMine,
|
||||
@@ -73,6 +74,7 @@ const select = (state, props) => {
|
||||
};
|
||||
|
||||
const perform = dispatch => ({
|
||||
abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)),
|
||||
claimEligibleRewards: () => dispatch(doClaimEligiblePurchaseRewards()),
|
||||
deleteFile: (fileInfo, deleteFromDevice, abandonClaim) => {
|
||||
dispatch(doDeleteFile(fileInfo, deleteFromDevice, abandonClaim));
|
||||
|
||||
+20
-3
@@ -6,6 +6,7 @@ import {
|
||||
Alert,
|
||||
DeviceEventEmitter,
|
||||
Dimensions,
|
||||
Linking,
|
||||
NativeModules,
|
||||
ScrollView,
|
||||
StatusBar,
|
||||
@@ -240,7 +241,7 @@ class FilePage extends React.PureComponent {
|
||||
};
|
||||
|
||||
onDeletePressed = () => {
|
||||
const { claim, deleteFile, deletePurchasedUri, fileInfo, navigation } = this.props;
|
||||
const { abandonClaim, claim, deleteFile, deletePurchasedUri, myClaimUris, fileInfo, navigation } = this.props;
|
||||
|
||||
Alert.alert(
|
||||
'Delete file',
|
||||
@@ -262,6 +263,16 @@ class FilePage extends React.PureComponent {
|
||||
mediaLoaded: false,
|
||||
stopDownloadConfirmed: false,
|
||||
});
|
||||
|
||||
if (claim) {
|
||||
const fullUri = normalizeURI(`${claim.name}#${claim.claim_id}`);
|
||||
const ownedClaim = myClaimUris.includes(fullUri);
|
||||
if (ownedClaim) {
|
||||
const { txid, nout } = claim;
|
||||
abandonClaim(txid, nout);
|
||||
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_PUBLISHES });
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -874,11 +885,11 @@ class FilePage extends React.PureComponent {
|
||||
/>
|
||||
)}
|
||||
|
||||
{completed && (
|
||||
{(completed || canEdit) && (
|
||||
<Button
|
||||
style={filePageStyle.actionButton}
|
||||
theme={'light'}
|
||||
icon={'trash'}
|
||||
icon={'trash-alt'}
|
||||
text={'Delete'}
|
||||
onPress={this.onDeletePressed}
|
||||
/>
|
||||
@@ -958,6 +969,12 @@ class FilePage extends React.PureComponent {
|
||||
onPress={this.onSaveFilePressed}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
style={[filePageStyle.actionButton, filePageStyle.reportButton]}
|
||||
theme={'light'}
|
||||
icon={'flag'}
|
||||
onPress={() => Linking.openURL(`https://lbry.com/dmca?claim_id=${claim.claim_id}`)}
|
||||
/>
|
||||
<Button
|
||||
style={[filePageStyle.actionButton, filePageStyle.tipButton]}
|
||||
theme={'light'}
|
||||
|
||||
@@ -46,7 +46,7 @@ class SkipAccountPage extends React.PureComponent {
|
||||
</View>
|
||||
<Text style={firstRunStyle.rowParagraph}>
|
||||
I understand that by uninstalling LBRY I will lose any balances or published content with no recovery
|
||||
option.
|
||||
option if it is not backed up manually (see wallet page)
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -80,13 +80,15 @@ class FirstRunScreen extends React.PureComponent {
|
||||
}
|
||||
|
||||
if (this.state.syncApplyStarted && !syncApplyIsPending) {
|
||||
this.setState({ syncApplyStarted: false });
|
||||
if (syncApplyErrorMessage && syncApplyErrorMessage.trim().length > 0) {
|
||||
notify({ message: syncApplyErrorMessage, isError: true });
|
||||
notify({ message: syncApplyErrorMessage, syncApplyStarted: false, isError: true });
|
||||
this.setState({ showBottomContainer: true });
|
||||
} else {
|
||||
// password successfully verified
|
||||
NativeModules.UtilityModule.setSecureValue(Constants.KEY_FIRST_RUN_PASSWORD, this.state.walletPassword);
|
||||
NativeModules.UtilityModule.setSecureValue(
|
||||
Constants.KEY_FIRST_RUN_PASSWORD,
|
||||
this.state.walletPassword ? this.state.walletPassword : ''
|
||||
);
|
||||
setDefaultAccount(
|
||||
() => {
|
||||
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
|
||||
@@ -233,6 +235,7 @@ class FirstRunScreen extends React.PureComponent {
|
||||
|
||||
closeFinalPage() {
|
||||
// Final page. Let the app know that first run experience is completed.
|
||||
this.setState({ syncApplyStarted: false });
|
||||
if (NativeModules.FirstRun) {
|
||||
NativeModules.FirstRun.firstRunCompleted();
|
||||
}
|
||||
|
||||
+34
-29
@@ -547,7 +547,7 @@ class PublishPage extends React.PureComponent {
|
||||
this.setState({ documentPickerOpen: false, thumbnailImagePickerOpen: false }, () => {
|
||||
const currentMedia = {
|
||||
id: -1,
|
||||
filePath: fileUrl,
|
||||
filePath: evt.path,
|
||||
duration: 0,
|
||||
};
|
||||
this.setCurrentMedia(currentMedia);
|
||||
@@ -870,6 +870,7 @@ class PublishPage extends React.PureComponent {
|
||||
const {
|
||||
allThumbnailsChecked,
|
||||
canUseCamera,
|
||||
showCameraOverlay,
|
||||
currentPhase,
|
||||
checkedThumbnails,
|
||||
loadingVideos,
|
||||
@@ -882,7 +883,9 @@ class PublishPage extends React.PureComponent {
|
||||
content = (
|
||||
<View style={publishStyle.gallerySelector}>
|
||||
<View style={publishStyle.actionsView}>
|
||||
{canUseCamera && <RNCamera style={publishStyle.cameraPreview} type={RNCamera.Constants.Type.back} />}
|
||||
{canUseCamera && !showCameraOverlay && (
|
||||
<RNCamera captureAudio={false} style={publishStyle.cameraPreview} type={RNCamera.Constants.Type.back} />
|
||||
)}
|
||||
<View style={publishStyle.actionsSubView}>
|
||||
<TouchableOpacity
|
||||
style={[
|
||||
@@ -1236,34 +1239,36 @@ class PublishPage extends React.PureComponent {
|
||||
{false && Constants.PHASE_SELECTOR !== this.state.currentPhase && (
|
||||
<FloatingWalletBalance navigation={navigation} />
|
||||
)}
|
||||
{this.state.canUseCamera && this.state.showCameraOverlay && (
|
||||
{this.state.showCameraOverlay && (
|
||||
<View style={publishStyle.cameraOverlay}>
|
||||
<RNCamera
|
||||
captureAudio={this.state.videoRecordingMode}
|
||||
style={publishStyle.fullCamera}
|
||||
ref={ref => {
|
||||
this.camera = ref;
|
||||
}}
|
||||
type={this.state.cameraType}
|
||||
flashMode={RNCamera.Constants.FlashMode.off}
|
||||
androidCameraPermissionOptions={{
|
||||
title: 'Camera',
|
||||
message: 'Please grant access to make use of your camera',
|
||||
buttonPositive: 'OK',
|
||||
buttonNegative: 'Cancel',
|
||||
}}
|
||||
androidRecordAudioPermissionOptions={{
|
||||
title: 'Audio',
|
||||
message: 'Please grant access to record audio',
|
||||
buttonPositive: 'OK',
|
||||
buttonNegative: 'Cancel',
|
||||
}}
|
||||
notAuthorizedView={
|
||||
<View style={publishStyle.fullCentered}>
|
||||
<Text style={publishStyle.cameraInfo}>Camera not authorized</Text>
|
||||
</View>
|
||||
}
|
||||
/>
|
||||
{this.state.canUseCamera && (
|
||||
<RNCamera
|
||||
captureAudio={this.state.videoRecordingMode}
|
||||
style={publishStyle.fullCamera}
|
||||
ref={ref => {
|
||||
this.camera = ref;
|
||||
}}
|
||||
type={this.state.cameraType}
|
||||
flashMode={RNCamera.Constants.FlashMode.off}
|
||||
androidCameraPermissionOptions={{
|
||||
title: __('Camera'),
|
||||
message: __('Please grant access to make use of your camera'),
|
||||
buttonPositive: __('OK'),
|
||||
buttonNegative: __('Cancel'),
|
||||
}}
|
||||
androidRecordAudioPermissionOptions={{
|
||||
title: __('Audio'),
|
||||
message: __('Please grant access to record audio'),
|
||||
buttonPositive: __('OK'),
|
||||
buttonNegative: __('Cancel'),
|
||||
}}
|
||||
notAuthorizedView={
|
||||
<View style={publishStyle.fullCentered}>
|
||||
<Text style={publishStyle.cameraInfo}>Camera not authorized</Text>
|
||||
</View>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<View
|
||||
style={[
|
||||
publishStyle.cameraControls,
|
||||
|
||||
+26
-22
@@ -98,7 +98,7 @@ class SplashScreen extends React.PureComponent {
|
||||
// user is authenticated, navigate to the main view
|
||||
if (user.has_verified_email) {
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => {
|
||||
if (walletPassword && walletPassword.trim().length > 0) {
|
||||
if (walletPassword) {
|
||||
getSync(walletPassword);
|
||||
}
|
||||
this.navigateToMain();
|
||||
@@ -137,24 +137,28 @@ class SplashScreen extends React.PureComponent {
|
||||
filteredOutpointsSubscribe();
|
||||
checkSubscriptionsInit();
|
||||
|
||||
// get user settings interval
|
||||
this.getUserSettings();
|
||||
setInterval(() => this.getUserSettings(), SETTINGS_GET_INTERVAL);
|
||||
NativeModules.Firebase.getMessagingToken().then(fcmToken => {
|
||||
console.log('fcmtoken=' + fcmToken);
|
||||
|
||||
if (user && user.id && user.has_verified_email) {
|
||||
// user already authenticated
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => {
|
||||
if (walletPassword) {
|
||||
getSync(walletPassword);
|
||||
}
|
||||
this.navigateToMain();
|
||||
});
|
||||
} else {
|
||||
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||
this.setState({ shouldAuthenticate: true });
|
||||
authenticate(appVersion, Platform.OS);
|
||||
});
|
||||
}
|
||||
// get user settings interval
|
||||
this.getUserSettings();
|
||||
setInterval(() => this.getUserSettings(), SETTINGS_GET_INTERVAL);
|
||||
|
||||
if (user && user.id && user.has_verified_email) {
|
||||
// user already authenticated
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => {
|
||||
if (walletPassword) {
|
||||
getSync(walletPassword);
|
||||
}
|
||||
this.navigateToMain();
|
||||
});
|
||||
} else {
|
||||
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||
this.setState({ shouldAuthenticate: true });
|
||||
authenticate(appVersion, Platform.OS);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -164,7 +168,10 @@ 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;
|
||||
|
||||
// At the minimum, wallet should be started and blocks_behind equal to 0 before calling resolve
|
||||
const hasStarted = startupStatus.stream_manager && startupStatus.wallet && status.wallet.blocks_behind <= 0;
|
||||
if (hasStarted) {
|
||||
@@ -180,7 +187,7 @@ class SplashScreen extends React.PureComponent {
|
||||
|
||||
// For now, automatically unlock the wallet if a password is set so that downloads work
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(password => {
|
||||
if (password) {
|
||||
if (walletStatus.is_locked) {
|
||||
this.setState({
|
||||
message: 'Unlocking account',
|
||||
details: 'Decrypting wallet',
|
||||
@@ -208,9 +215,6 @@ class SplashScreen extends React.PureComponent {
|
||||
return;
|
||||
}
|
||||
|
||||
const blockchainHeaders = status.blockchain_headers;
|
||||
const walletStatus = status.wallet;
|
||||
|
||||
if (blockchainHeaders) {
|
||||
this.setState({
|
||||
isDownloadingHeaders: blockchainHeaders.downloading_headers,
|
||||
|
||||
@@ -25,6 +25,7 @@ import FileItem from 'component/fileItem';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
import Link from 'component/link';
|
||||
import ModalPicker from 'component/modalPicker';
|
||||
import ModalSuggestedSubscriptions from 'component/modalSuggestedSubscriptions';
|
||||
import SubscribedChannelList from 'component/subscribedChannelList';
|
||||
import SuggestedSubscriptions from 'component/suggestedSubscriptions';
|
||||
import UriBar from 'component/uriBar';
|
||||
@@ -34,6 +35,7 @@ class SubscriptionsPage extends React.PureComponent {
|
||||
showingSuggestedSubs: false,
|
||||
showSortPicker: false,
|
||||
showTimePicker: false,
|
||||
showModalSuggestedSubs: false,
|
||||
orderBy: ['release_time'],
|
||||
filteredChannels: [],
|
||||
currentSortByItem: Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1], // should always default to sorting subscriptions by new
|
||||
@@ -122,7 +124,7 @@ class SubscriptionsPage extends React.PureComponent {
|
||||
unreadSubscriptions,
|
||||
navigation,
|
||||
} = this.props;
|
||||
const { currentSortByItem, filteredChannels, showSortPicker, showTimePicker } = this.state;
|
||||
const { currentSortByItem, filteredChannels, showModalSuggestedSubs, showSortPicker, showTimePicker } = this.state;
|
||||
|
||||
const numberOfSubscriptions = subscribedChannels ? subscribedChannels.length : 0;
|
||||
const hasSubscriptions = numberOfSubscriptions > 0;
|
||||
@@ -151,23 +153,31 @@ class SubscriptionsPage extends React.PureComponent {
|
||||
</View>
|
||||
{!this.state.showingSuggestedSubs && hasSubscriptions && (
|
||||
<View style={subscriptionsStyle.pickerRow}>
|
||||
<TouchableOpacity
|
||||
style={subscriptionsStyle.tagSortBy}
|
||||
onPress={() => this.setState({ showSortPicker: true })}
|
||||
>
|
||||
<Text style={subscriptionsStyle.tagSortText}>{currentSortByItem.label.split(' ')[0]}</Text>
|
||||
<Icon style={subscriptionsStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||
</TouchableOpacity>
|
||||
|
||||
{Constants.SORT_BY_TOP === currentSortByItem.name && (
|
||||
<View style={subscriptionsStyle.leftPickerRow}>
|
||||
<TouchableOpacity
|
||||
style={subscriptionsStyle.tagSortBy}
|
||||
onPress={() => this.setState({ showTimePicker: true })}
|
||||
onPress={() => this.setState({ showSortPicker: true })}
|
||||
>
|
||||
<Text style={subscriptionsStyle.tagSortText}>{timeItem.label}</Text>
|
||||
<Text style={subscriptionsStyle.tagSortText}>{currentSortByItem.label.split(' ')[0]}</Text>
|
||||
<Icon style={subscriptionsStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
||||
{Constants.SORT_BY_TOP === currentSortByItem.name && (
|
||||
<TouchableOpacity
|
||||
style={subscriptionsStyle.tagSortBy}
|
||||
onPress={() => this.setState({ showTimePicker: true })}
|
||||
>
|
||||
<Text style={subscriptionsStyle.tagSortText}>{timeItem.label}</Text>
|
||||
<Icon style={subscriptionsStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
</View>
|
||||
|
||||
<Link
|
||||
style={subscriptionsStyle.suggestedLink}
|
||||
text={'Suggested'}
|
||||
onPress={() => this.setState({ showModalSuggestedSubs: true })}
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
{!this.state.showingSuggestedSubs && hasSubscriptions && !loading && (
|
||||
@@ -223,7 +233,9 @@ class SubscriptionsPage extends React.PureComponent {
|
||||
</View>
|
||||
)}
|
||||
|
||||
{!showSortPicker && !showTimePicker && <FloatingWalletBalance navigation={navigation} />}
|
||||
{!showSortPicker && !showTimePicker && !showModalSuggestedSubs && (
|
||||
<FloatingWalletBalance navigation={navigation} />
|
||||
)}
|
||||
{showSortPicker && (
|
||||
<ModalPicker
|
||||
title={__('Sort content by')}
|
||||
@@ -242,6 +254,13 @@ class SubscriptionsPage extends React.PureComponent {
|
||||
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
|
||||
/>
|
||||
)}
|
||||
{showModalSuggestedSubs && (
|
||||
<ModalSuggestedSubscriptions
|
||||
navigation={navigation}
|
||||
onOverlayPress={() => this.setState({ showModalSuggestedSubs: false })}
|
||||
onDonePress={() => this.setState({ showModalSuggestedSubs: false })}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -68,27 +68,37 @@ class SyncVerifyPage extends React.PureComponent {
|
||||
);
|
||||
}
|
||||
setDefaultAccount(
|
||||
() => {
|
||||
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
|
||||
|
||||
// unlock the wallet
|
||||
Lbry.account_unlock({ password: this.state.password ? this.state.password : '' })
|
||||
.then(() => navigation.goBack())
|
||||
.catch(err =>
|
||||
notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' })
|
||||
);
|
||||
},
|
||||
() => this.finishSync(true),
|
||||
err => {
|
||||
notify({
|
||||
message:
|
||||
'The account restore operation could not be completed successfully. Please restart the app and try again.',
|
||||
});
|
||||
// fail silently and still finish
|
||||
this.finishSync();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
finishSync = (notifyUnlockFailed = false) => {
|
||||
const { navigation, notify, setClientSetting } = this.props;
|
||||
|
||||
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
|
||||
|
||||
// unlock the wallet (if locked)
|
||||
Lbry.status().then(status => {
|
||||
if (status.wallet.is_locked) {
|
||||
Lbry.account_unlock({ password: this.state.password ? this.state.password : '' })
|
||||
.then(() => navigation.goBack())
|
||||
.catch(err => {
|
||||
if (notifyUnlockFailed) {
|
||||
notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
navigation.goBack();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
handleChangeText = text => {
|
||||
// save the value to the state email
|
||||
const { onPasswordChanged } = this.props;
|
||||
|
||||
@@ -45,6 +45,7 @@ const channelCreatorStyle = StyleSheet.create({
|
||||
helpText: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 12,
|
||||
color: Colors.DescriptionGrey,
|
||||
},
|
||||
channelTitleInput: {
|
||||
marginBottom: 4,
|
||||
@@ -104,11 +105,12 @@ const channelCreatorStyle = StyleSheet.create({
|
||||
avatarImageContainer: {
|
||||
position: 'absolute',
|
||||
left: screenWidth / 2 - 80 / 2,
|
||||
bottom: -16,
|
||||
bottom: -8,
|
||||
width: 80,
|
||||
height: 80,
|
||||
borderRadius: 160,
|
||||
overflow: 'hidden',
|
||||
zIndex: 50,
|
||||
},
|
||||
avatarTouchArea: {
|
||||
width: 80,
|
||||
|
||||
@@ -322,6 +322,9 @@ const filePageStyle = StyleSheet.create({
|
||||
saveFileButton: {
|
||||
marginRight: 8,
|
||||
},
|
||||
reportButton: {
|
||||
marginRight: 8,
|
||||
},
|
||||
tagContainer: {
|
||||
marginLeft: 12,
|
||||
marginRight: 12,
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import { StyleSheet } from 'react-native';
|
||||
import Colors from './colors';
|
||||
|
||||
const modalPickerStyle = StyleSheet.create({
|
||||
overlay: {
|
||||
backgroundColor: '#00000055',
|
||||
flex: 1,
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
zIndex: 300,
|
||||
},
|
||||
overlayTouchArea: {
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
},
|
||||
container: {
|
||||
position: 'absolute',
|
||||
left: 8,
|
||||
right: 8,
|
||||
bottom: 8,
|
||||
borderRadius: 8,
|
||||
backgroundColor: Colors.White,
|
||||
overflow: 'hidden',
|
||||
},
|
||||
paddedContatiner: {
|
||||
padding: 12,
|
||||
},
|
||||
buttons: {
|
||||
marginTop: 16,
|
||||
left: 8,
|
||||
bottom: 8,
|
||||
position: 'absolute',
|
||||
},
|
||||
doneButton: {
|
||||
alignSelf: 'flex-start',
|
||||
backgroundColor: Colors.LbryGreen,
|
||||
paddingLeft: 16,
|
||||
paddingRight: 16,
|
||||
},
|
||||
});
|
||||
|
||||
export default modalPickerStyle;
|
||||
@@ -436,6 +436,11 @@ const publishStyle = StyleSheet.create({
|
||||
fontSize: 14,
|
||||
color: Colors.DescriptionGrey,
|
||||
},
|
||||
helpText: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 12,
|
||||
color: Colors.DescriptionGrey,
|
||||
},
|
||||
publishesFooter: {
|
||||
marginTop: 2,
|
||||
marginLeft: 16,
|
||||
|
||||
@@ -13,7 +13,7 @@ const subscriptionsStyle = StyleSheet.create({
|
||||
suggestedSubsContainer: {
|
||||
flex: 1,
|
||||
},
|
||||
suggestedScrollPadding: {
|
||||
suggestedScrollContent: {
|
||||
paddingTop: 8,
|
||||
},
|
||||
button: {
|
||||
@@ -159,6 +159,7 @@ const subscriptionsStyle = StyleSheet.create({
|
||||
pickerRow: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
marginLeft: 16,
|
||||
marginRight: 16,
|
||||
marginTop: 8,
|
||||
@@ -245,6 +246,24 @@ const subscriptionsStyle = StyleSheet.create({
|
||||
marginRight: 4,
|
||||
marginBottom: 4,
|
||||
},
|
||||
leftPickerRow: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
},
|
||||
suggestedLink: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
},
|
||||
modalContainer: {
|
||||
height: '80%',
|
||||
backgroundColor: Colors.PageBackground,
|
||||
},
|
||||
modalScrollContainer: {
|
||||
marginBottom: 50,
|
||||
},
|
||||
modalSuggestedScrollContent: {
|
||||
paddingTop: 16,
|
||||
},
|
||||
});
|
||||
|
||||
export default subscriptionsStyle;
|
||||
Reference in new issue
Block a user