Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4fad20ff1 | ||
|
|
682443d9ae | ||
|
|
b258654d60 | ||
|
|
342e022594 | ||
|
|
d16e4b7f69 | ||
|
|
648206b6a5 | ||
|
|
14994d2a30 | ||
|
|
ab97be6a4d | ||
|
|
e39f5907a8 | ||
|
|
c203aa914c | ||
|
|
f0a3eec80b | ||
|
|
b135ca36a3 |
No files matched your search
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017-2018 LBRY Inc
|
||||
Copyright (c) 2017-2019 LBRY Inc
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -5649,8 +5649,8 @@
|
||||
}
|
||||
},
|
||||
"lbryinc": {
|
||||
"version": "github:lbryio/lbryinc#67bb3e215be3f13605c5e3f9f2b0e2fb880724cf",
|
||||
"from": "github:lbryio/lbryinc#67bb3e215be3f13605c5e3f9f2b0e2fb880724cf",
|
||||
"version": "github:lbryio/lbryinc#c55a2c98ab92c72149c824ee5906aed4404fd89b",
|
||||
"from": "github:lbryio/lbryinc#c55a2c98ab92c72149c824ee5906aed4404fd89b",
|
||||
"requires": {
|
||||
"reselect": "^3.0.0"
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
"@expo/vector-icons": "^8.1.0",
|
||||
"gfycat-style-urls": "^1.0.3",
|
||||
"lbry-redux": "lbryio/lbry-redux#7ec72a737bcd336f000c5f5085891643110298c3",
|
||||
"lbryinc": "lbryio/lbryinc#67bb3e215be3f13605c5e3f9f2b0e2fb880724cf",
|
||||
"lbryinc": "lbryio/lbryinc#c55a2c98ab92c72149c824ee5906aed4404fd89b",
|
||||
"lodash": ">=4.17.11",
|
||||
"merge": ">=1.2.1",
|
||||
"moment": "^2.22.1",
|
||||
|
||||
@@ -9,7 +9,7 @@ class FileRewardsDriver extends React.PureComponent<Props> {
|
||||
|
||||
return (
|
||||
<TouchableOpacity style={filePageStyle.rewardDriverCard} onPress={() => navigation.navigate('Rewards')}>
|
||||
<Icon name="award" size={16} style={filePageStyle.rewardIcon} />
|
||||
<Icon name="award" size={16} style={filePageStyle.rewardDriverIcon} />
|
||||
<Text style={filePageStyle.rewardDriverText}>Earn some credits to access this content.</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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} />
|
||||
)}
|
||||
|
||||
@@ -138,6 +138,8 @@ const Constants = {
|
||||
MORE_PLACEHOLDER: '_more',
|
||||
|
||||
TRUE_STRING: 'true',
|
||||
|
||||
MINIMUM_TRANSACTION_BALANCE: 0.1,
|
||||
};
|
||||
|
||||
export default Constants;
|
||||
|
||||
+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']);
|
||||
|
||||
@@ -32,9 +32,11 @@ import channelIconStyle from 'styles/channelIcon';
|
||||
import seedrandom from 'seedrandom';
|
||||
|
||||
export default class ChannelCreator extends React.PureComponent {
|
||||
scrollView = null;
|
||||
|
||||
state = {
|
||||
autoStyle: null,
|
||||
canSave: false,
|
||||
canSave: true,
|
||||
claimId: null,
|
||||
currentSelectedValue: Constants.ITEM_ANONYMOUS,
|
||||
currentPhase: null,
|
||||
@@ -161,9 +163,6 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
if (!fetchingChannels) {
|
||||
fetchChannelListMine();
|
||||
}
|
||||
if (balance >= 0.1) {
|
||||
this.setState({ canSave: true });
|
||||
}
|
||||
|
||||
DeviceEventEmitter.addListener('onDocumentPickerFilePicked', this.onFilePicked);
|
||||
DeviceEventEmitter.addListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
||||
@@ -392,6 +391,16 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
website,
|
||||
} = this.state;
|
||||
|
||||
if (balance < Constants.MINIMUM_TRANSACTION_BALANCE) {
|
||||
notify({
|
||||
message: 'Creating a channel requires credits. Press the blue bar to get some for free.',
|
||||
});
|
||||
if (this.scrollView) {
|
||||
this.scrollView.scrollTo({ x: 0, y: 0, animated: true });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (newChannelName.trim().length === 0 || !isNameValid(newChannelName.substr(1), false)) {
|
||||
notify({ message: 'Your channel name contains invalid characters.' });
|
||||
return;
|
||||
@@ -528,9 +537,9 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
};
|
||||
|
||||
handleNewChannelPress = () => {
|
||||
const { balance, pushDrawerStack } = this.props;
|
||||
const { pushDrawerStack } = this.props;
|
||||
pushDrawerStack(Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM);
|
||||
this.setState({ canSave: balance >= 0.1, currentPhase: Constants.PHASE_CREATE });
|
||||
this.setState({ currentPhase: Constants.PHASE_CREATE });
|
||||
};
|
||||
|
||||
handleCreateCancel = () => {
|
||||
@@ -548,7 +557,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
|
||||
resetChannelCreator = () => {
|
||||
this.setState({
|
||||
canSave: false,
|
||||
canSave: true,
|
||||
claimId: null,
|
||||
editMode: false,
|
||||
displayName: null,
|
||||
@@ -610,7 +619,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
|
||||
pushDrawerStack(Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM);
|
||||
this.setState({
|
||||
canSave: balance >= 0.1,
|
||||
canSave: true,
|
||||
claimId: channel.claim_id,
|
||||
currentPhase: Constants.PHASE_CREATE,
|
||||
displayName: value && value.title ? value.title : channel.name.substring(1),
|
||||
@@ -841,7 +850,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
)}
|
||||
|
||||
{currentPhase === Constants.PHASE_CREATE && (
|
||||
<ScrollView style={channelCreatorStyle.createChannelContainer}>
|
||||
<ScrollView ref={ref => (this.scrollView = ref)} style={channelCreatorStyle.createChannelContainer}>
|
||||
<View style={channelCreatorStyle.imageSelectors}>
|
||||
<TouchableOpacity style={channelCreatorStyle.coverImageTouchArea} onPress={this.onCoverImagePress}>
|
||||
<Image
|
||||
@@ -886,7 +895,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
{balance < 0.1 && <ChannelRewardsDriver navigation={navigation} />}
|
||||
{balance < Constants.MINIMUM_TRANSACTION_BALANCE && <ChannelRewardsDriver navigation={navigation} />}
|
||||
|
||||
<View style={channelCreatorStyle.card}>
|
||||
<View style={channelCreatorStyle.textInputLayout}>
|
||||
@@ -1046,7 +1055,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
<Link style={channelCreatorStyle.cancelLink} text="Cancel" onPress={this.handleCreateCancel} />
|
||||
<Button
|
||||
style={channelCreatorStyle.createButton}
|
||||
disabled={!canSave || uploadingImage || !newChannelName || newChannelName.trim().length === 0}
|
||||
disabled={!canSave || uploadingImage}
|
||||
text={editMode ? 'Update' : 'Create'}
|
||||
onPress={this.handleCreateChannelClick}
|
||||
/>
|
||||
|
||||
+34
-38
@@ -61,11 +61,10 @@ 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);
|
||||
@@ -88,9 +87,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 => {
|
||||
@@ -127,44 +128,39 @@ class DiscoverPage extends React.PureComponent {
|
||||
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
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
Alert,
|
||||
DeviceEventEmitter,
|
||||
Dimensions,
|
||||
Linking,
|
||||
NativeModules,
|
||||
ScrollView,
|
||||
StatusBar,
|
||||
@@ -507,6 +508,20 @@ class FilePage extends React.PureComponent {
|
||||
this.setState({ fileViewLogged: true });
|
||||
};
|
||||
|
||||
// TODO: Move this to lbry-redux
|
||||
formatLbryUrlForWeb = url => {
|
||||
return url.replace('lbry://', '/').replace(/#/g, ':');
|
||||
};
|
||||
|
||||
handleSharePress = () => {
|
||||
const { claim, notify } = this.props;
|
||||
if (claim) {
|
||||
const { canonical_url: canonicalUrl, short_url: shortUrl, permanent_url: permanentUrl } = claim;
|
||||
const url = 'https://lbry.tv' + this.formatLbryUrlForWeb(canonicalUrl || shortUrl || permanentUrl);
|
||||
NativeModules.UtilityModule.shareUrl(url);
|
||||
}
|
||||
};
|
||||
|
||||
handleSendTip = () => {
|
||||
const { claim, balance, navigation, notify, sendTip } = this.props;
|
||||
const { uri } = navigation.state.params;
|
||||
@@ -932,6 +947,22 @@ class FilePage extends React.PureComponent {
|
||||
</View>
|
||||
</View>
|
||||
</TouchableWithoutFeedback>
|
||||
|
||||
<View style={filePageStyle.largeButtonsRow}>
|
||||
<TouchableOpacity style={filePageStyle.largeButton} onPress={this.handleSharePress}>
|
||||
<Icon name={'share-alt'} size={24} style={filePageStyle.largeButtonIcon} />
|
||||
<Text style={filePageStyle.largeButtonText}>Share</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity
|
||||
style={filePageStyle.largeButton}
|
||||
onPress={() => Linking.openURL(`https://lbry.com/dmca/${claim.claim_id}`)}
|
||||
>
|
||||
<Icon name={'flag'} size={24} style={filePageStyle.largeButtonIcon} />
|
||||
<Text style={filePageStyle.largeButtonText}>Report</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
<View style={filePageStyle.channelRow}>
|
||||
<View style={filePageStyle.publishInfo}>
|
||||
{channelName && (
|
||||
|
||||
@@ -76,8 +76,10 @@ const languages = {
|
||||
class PublishPage extends React.PureComponent {
|
||||
camera = null;
|
||||
|
||||
scrollView = null;
|
||||
|
||||
state = {
|
||||
canPublish: false,
|
||||
canPublish: true,
|
||||
canUseCamera: false,
|
||||
documentPickerOpen: false,
|
||||
editMode: false,
|
||||
@@ -186,7 +188,6 @@ class PublishPage extends React.PureComponent {
|
||||
NativeModules.Gallery.getThumbnailPath().then(thumbnailPath => this.setState({ thumbnailPath }));
|
||||
this.setState(
|
||||
{
|
||||
canPublish: balance >= 0.1,
|
||||
loadingVideos: true,
|
||||
},
|
||||
() => {
|
||||
@@ -319,7 +320,7 @@ class PublishPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
handlePublishPressed = () => {
|
||||
const { notify, publish, updatePublishForm } = this.props;
|
||||
const { balance, notify, publish, updatePublishForm } = this.props;
|
||||
const {
|
||||
editMode,
|
||||
bid,
|
||||
@@ -340,6 +341,16 @@ class PublishPage extends React.PureComponent {
|
||||
uri,
|
||||
} = this.state;
|
||||
|
||||
if (balance < Constants.MINIMUM_TRANSACTION_BALANCE) {
|
||||
notify({
|
||||
message: 'Publishing content requires credits. Press the blue bar to get some for free.',
|
||||
});
|
||||
if (this.scrollView) {
|
||||
this.scrollView.scrollTo({ x: 0, y: 0, animated: true });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!title || title.trim().length === 0) {
|
||||
notify({ message: 'Please provide a title' });
|
||||
return;
|
||||
@@ -961,7 +972,7 @@ class PublishPage extends React.PureComponent {
|
||||
this.updateThumbnailUriForMedia(currentMedia);
|
||||
}
|
||||
content = (
|
||||
<ScrollView style={publishStyle.publishDetails}>
|
||||
<ScrollView ref={ref => (this.scrollView = ref)} style={publishStyle.publishDetails}>
|
||||
<TouchableOpacity style={publishStyle.mainThumbnailContainer} onPress={this.handleThumbnailPressed}>
|
||||
<FastImage
|
||||
style={publishStyle.mainThumbnail}
|
||||
@@ -980,7 +991,7 @@ class PublishPage extends React.PureComponent {
|
||||
</View>
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
{!this.state.canPublish && <PublishRewardsDriver navigation={navigation} />}
|
||||
{balance < Constants.MINIMUM_TRANSACTION_BALANCE && <PublishRewardsDriver navigation={navigation} />}
|
||||
|
||||
<View style={publishStyle.card}>
|
||||
<View style={publishStyle.textInputLayout}>
|
||||
@@ -1190,7 +1201,7 @@ class PublishPage extends React.PureComponent {
|
||||
<View style={publishStyle.rightActionButtons}>
|
||||
<Button
|
||||
style={publishStyle.publishButton}
|
||||
disabled={!this.state.canPublish || this.state.uploadThumbnailStarted}
|
||||
disabled={this.state.uploadThumbnailStarted}
|
||||
text={this.state.editMode ? 'Save changes' : 'Publish'}
|
||||
onPress={this.handlePublishPressed}
|
||||
/>
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ const Colors = {
|
||||
VeryLightGrey: '#f1f1f1',
|
||||
White: '#ffffff',
|
||||
UriDescBlue: '#3971db',
|
||||
RewardDriverBlue: '#2196f3',
|
||||
|
||||
StatsAudio: '#f6a637',
|
||||
StatsImage: '#ff4a7d',
|
||||
|
||||
+26
-1
@@ -322,6 +322,9 @@ const filePageStyle = StyleSheet.create({
|
||||
saveFileButton: {
|
||||
marginRight: 8,
|
||||
},
|
||||
reportButton: {
|
||||
marginRight: 8,
|
||||
},
|
||||
tagContainer: {
|
||||
marginLeft: 12,
|
||||
marginRight: 12,
|
||||
@@ -345,13 +348,17 @@ const filePageStyle = StyleSheet.create({
|
||||
},
|
||||
rewardDriverCard: {
|
||||
alignItems: 'center',
|
||||
backgroundColor: Colors.BrighterLbryGreen,
|
||||
backgroundColor: Colors.RewardDriverBlue,
|
||||
flexDirection: 'row',
|
||||
paddingLeft: 16,
|
||||
paddingRight: 16,
|
||||
paddingTop: 12,
|
||||
paddingBottom: 12,
|
||||
},
|
||||
rewardDriverIcon: {
|
||||
color: Colors.White,
|
||||
marginRight: 8,
|
||||
},
|
||||
rewardDriverText: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
color: Colors.White,
|
||||
@@ -374,6 +381,24 @@ const filePageStyle = StyleSheet.create({
|
||||
backButtonIcon: {
|
||||
color: Colors.White,
|
||||
},
|
||||
largeButton: {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
largeButtonIcon: {
|
||||
color: Colors.DescriptionGrey,
|
||||
},
|
||||
largeButtonText: {
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 14,
|
||||
marginTop: 4,
|
||||
},
|
||||
largeButtonsRow: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
margin: 16,
|
||||
},
|
||||
});
|
||||
|
||||
export default filePageStyle;
|
||||
@@ -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;
|
||||
@@ -297,7 +297,7 @@ const publishStyle = StyleSheet.create({
|
||||
},
|
||||
rewardDriverCard: {
|
||||
alignItems: 'center',
|
||||
backgroundColor: Colors.BrighterLbryGreen,
|
||||
backgroundColor: Colors.RewardDriverBlue,
|
||||
flexDirection: 'row',
|
||||
paddingLeft: 16,
|
||||
paddingRight: 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;
|
||||
@@ -198,7 +198,7 @@ const walletStyle = StyleSheet.create({
|
||||
},
|
||||
rewardDriverCard: {
|
||||
alignItems: 'center',
|
||||
backgroundColor: Colors.BrighterLbryGreen,
|
||||
backgroundColor: Colors.RewardDriverBlue,
|
||||
flexDirection: 'row',
|
||||
padding: 16,
|
||||
marginLeft: 16,
|
||||
|
||||
Reference in new issue
Block a user