Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e4765a743 | ||
|
|
6217c45322 | ||
|
|
dfb43199ea | ||
|
|
42488c0b39 | ||
|
|
330997bc1e |
No files matched your search
Generated
+392
-315
File diff suppressed because it is too large.
Load diff
+4
-4
@@ -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#c74deed2a63e1acd0d1827ed9b954242d74e2a1e",
|
||||
"lbryinc": "lbryio/lbryinc#4c761084990557d379c85e1c998fcae7e5db143a",
|
||||
"lbry-redux": "lbryio/lbry-redux#73f10d488d5fd5df7aa806b60c8df5c948ca3c9a",
|
||||
"lbryinc": "lbryio/lbryinc#17868d948a160af27a375956226f8dd23fa2c37d",
|
||||
"lodash": ">=4.17.11",
|
||||
"merge": ">=1.2.1",
|
||||
"moment": "^2.22.1",
|
||||
@@ -26,11 +26,11 @@
|
||||
"react-native-exception-handler": "2.9.0",
|
||||
"react-native-fast-image": "^6.1.1",
|
||||
"react-native-fs": "^2.13.3",
|
||||
"react-native-gesture-handler": "1.1.0",
|
||||
"react-native-gesture-handler": "^1.1.0",
|
||||
"react-native-image-zoom-viewer": "^2.2.5",
|
||||
"react-native-password-strength-meter": "^0.0.2",
|
||||
"react-native-phone-input": "lbryio/react-native-phone-input",
|
||||
"react-native-reanimated": "1.2.0",
|
||||
"react-native-reanimated": "^1.2.0",
|
||||
"react-native-super-grid": "^3.0.4",
|
||||
"react-native-vector-icons": "^6.6.0",
|
||||
"react-native-video": "lbryio/react-native-video#exoplayer-lbry-android",
|
||||
|
||||
@@ -11,13 +11,14 @@ import { selectShowNsfw } from 'redux/selectors/settings';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import ClaimList from './view';
|
||||
|
||||
const select = state => ({
|
||||
showNsfwContent: selectShowNsfw(state),
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
lastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
||||
loadingByQuery: selectFetchingClaimSearchByQuery(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
});
|
||||
const select = (state, props) => {
|
||||
return {
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
lastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
||||
loadingByQuery: selectFetchingClaimSearchByQuery(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = dispatch => ({
|
||||
claimSearch: options => dispatch(doClaimSearch(options)),
|
||||
|
||||
@@ -42,6 +42,7 @@ class ClaimList extends React.PureComponent {
|
||||
tags: prevTags,
|
||||
channelIds: prevChannelIds,
|
||||
time: prevTime,
|
||||
showNsfwContent,
|
||||
} = prevProps;
|
||||
const { claimSearchByQuery, orderBy, tags, channelIds, time } = this.props;
|
||||
|
||||
@@ -71,7 +72,7 @@ class ClaimList extends React.PureComponent {
|
||||
}
|
||||
|
||||
buildClaimSearchOptions() {
|
||||
const { orderBy, channelIds, showNsfwContent, tags, time } = this.props;
|
||||
const { orderBy = Constants.DEFAULT_ORDER_BY, channelIds, showNsfwContent, tags, time } = this.props;
|
||||
const { currentPage, subscriptionsView } = this.state;
|
||||
|
||||
const options = {
|
||||
@@ -204,12 +205,7 @@ class ClaimList extends React.PureComponent {
|
||||
|
||||
const options = this.buildClaimSearchOptions();
|
||||
const claimSearchKey = createNormalizedClaimSearchKey(options);
|
||||
let uris = claimSearchByQuery[claimSearchKey];
|
||||
|
||||
if (uris) {
|
||||
// temporary workaround for missing short_urls
|
||||
uris = uris.filter(uri => uri && uri.length > 0);
|
||||
}
|
||||
const uris = claimSearchByQuery[claimSearchKey];
|
||||
|
||||
if (Constants.ORIENTATION_VERTICAL === orientation) {
|
||||
return (
|
||||
|
||||
@@ -53,39 +53,39 @@ class FileList extends React.PureComponent<Props, State> {
|
||||
dateNew: fileInfos =>
|
||||
this.props.sortByHeight
|
||||
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||
if (fileInfo1.pending) {
|
||||
return -1;
|
||||
}
|
||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||
? this.props.claimsById[fileInfo1.claim_id].height
|
||||
: 0;
|
||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||
? this.props.claimsById[fileInfo2.claim_id].height
|
||||
: 0;
|
||||
if (height1 > height2) {
|
||||
return -1;
|
||||
} else if (height1 < height2) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
if (fileInfo1.pending) {
|
||||
return -1;
|
||||
}
|
||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||
? this.props.claimsById[fileInfo1.claim_id].height
|
||||
: 0;
|
||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||
? this.props.claimsById[fileInfo2.claim_id].height
|
||||
: 0;
|
||||
if (height1 > height2) {
|
||||
return -1;
|
||||
} else if (height1 < height2) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
: [...fileInfos].reverse(),
|
||||
dateOld: fileInfos =>
|
||||
this.props.sortByHeight
|
||||
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||
? this.props.claimsById[fileInfo1.claim_id].height
|
||||
: 999999;
|
||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||
? this.props.claimsById[fileInfo2.claim_id].height
|
||||
: 999999;
|
||||
if (height1 < height2) {
|
||||
return -1;
|
||||
} else if (height1 > height2) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||
? this.props.claimsById[fileInfo1.claim_id].height
|
||||
: 999999;
|
||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||
? this.props.claimsById[fileInfo2.claim_id].height
|
||||
: 999999;
|
||||
if (height1 < height2) {
|
||||
return -1;
|
||||
} else if (height1 > height2) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
: fileInfos,
|
||||
title: fileInfos =>
|
||||
fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||
@@ -160,7 +160,7 @@ class FileList extends React.PureComponent<Props, State> {
|
||||
// This is unfortunate
|
||||
// https://github.com/lbryio/lbry/issues/1159
|
||||
const name = claimName || claimNameDownloaded;
|
||||
uriParams.claimName = name;
|
||||
uriParams.contentName = name;
|
||||
uriParams.claimId = claimId;
|
||||
const uri = buildURI(uriParams);
|
||||
|
||||
@@ -179,7 +179,7 @@ class FileList extends React.PureComponent<Props, State> {
|
||||
style={fileListStyle.fileItem}
|
||||
uri={item}
|
||||
navigation={navigation}
|
||||
showDetails
|
||||
showDetails={true}
|
||||
compactView={false}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -3,7 +3,6 @@ import { normalizeURI, parseURI } from 'lbry-redux';
|
||||
import { ActivityIndicator, Platform, Text, TouchableOpacity, View } from 'react-native';
|
||||
import { navigateToUri, formatBytes } from 'utils/helper';
|
||||
import Colors from 'styles/colors';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import DateTime from 'component/dateTime';
|
||||
import FileItemMedia from 'component/fileItemMedia';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
@@ -43,13 +42,8 @@ class FileListItem extends React.PureComponent {
|
||||
}
|
||||
|
||||
defaultOnPress = () => {
|
||||
const { autoplay, claim, featuredResult, navigation, uri, shortUrl } = this.props;
|
||||
|
||||
if (featuredResult && !claim) {
|
||||
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_PUBLISH, params: { vanityUrl: uri.trim() } });
|
||||
} else {
|
||||
navigateToUri(navigation, shortUrl || uri, { autoplay });
|
||||
}
|
||||
const { autoplay, navigation, uri, shortUrl } = this.props;
|
||||
navigateToUri(navigation, shortUrl || uri, { autoplay });
|
||||
};
|
||||
|
||||
onPressHandler = () => {
|
||||
@@ -117,7 +111,7 @@ class FileListItem extends React.PureComponent {
|
||||
// shouldHide = 'channel' === claim.value_type;
|
||||
}
|
||||
|
||||
if (shouldHide || (!isResolvingUri && !claim && !featuredResult)) {
|
||||
if (shouldHide || (!isResolvingUri && !claim) || (featuredResult && !isResolvingUri && !claim && !title && !name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -136,7 +130,7 @@ class FileListItem extends React.PureComponent {
|
||||
style={fileListStyle.thumbnail}
|
||||
duration={duration}
|
||||
resizeMode="cover"
|
||||
title={title || name || normalizeURI(uri).substring(7)}
|
||||
title={title || name}
|
||||
thumbnail={thumbnail}
|
||||
/>
|
||||
{selected && (
|
||||
@@ -173,13 +167,6 @@ class FileListItem extends React.PureComponent {
|
||||
{isRewardContent && <Icon style={fileListStyle.rewardIcon} name="award" size={12} />}
|
||||
</View>
|
||||
)}
|
||||
|
||||
{featuredResult && !isResolving && !claim && (
|
||||
<View style={fileListStyle.titleContainer}>
|
||||
<Text style={fileListStyle.featuredTitle}>Nothing here. Publish something!</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{channel && !hideChannel && (
|
||||
<Link
|
||||
style={fileListStyle.publisher}
|
||||
|
||||
@@ -19,12 +19,11 @@ class TransactionListItem extends React.PureComponent {
|
||||
return (
|
||||
<View style={transactionListStyle.listItem}>
|
||||
<View style={[transactionListStyle.row, transactionListStyle.topRow]}>
|
||||
<View style={[transactionListStyle.col, transactionListStyle.leftCol]}>
|
||||
<View style={transactionListStyle.col}>
|
||||
<Text style={transactionListStyle.text}>{this.capitalize(type)}</Text>
|
||||
{name && claimId && (
|
||||
<Link
|
||||
style={transactionListStyle.link}
|
||||
numberOfLines={1}
|
||||
onPress={() => navigateToUri(navigation, buildURI({ claimName: name, claimId }))}
|
||||
text={name}
|
||||
/>
|
||||
@@ -38,7 +37,7 @@ class TransactionListItem extends React.PureComponent {
|
||||
</View>
|
||||
</View>
|
||||
<View style={transactionListStyle.row}>
|
||||
<View style={[transactionListStyle.col, transactionListStyle.leftCol]}>
|
||||
<View style={transactionListStyle.col}>
|
||||
<Link
|
||||
style={transactionListStyle.smallLink}
|
||||
text={txid.substring(0, 8)}
|
||||
|
||||
+16
-14
@@ -19,7 +19,6 @@ import {
|
||||
isNameValid,
|
||||
buildURI,
|
||||
normalizeURI,
|
||||
parseURI,
|
||||
regexInvalidURI,
|
||||
CLAIM_VALUES,
|
||||
LICENSES,
|
||||
@@ -28,6 +27,7 @@ import {
|
||||
} from 'lbry-redux';
|
||||
import { RNCamera } from 'react-native-camera';
|
||||
import { generateCombination } from 'gfycat-style-urls';
|
||||
import DocumentPicker from 'react-native-document-picker';
|
||||
import RNFS from 'react-native-fs';
|
||||
import Button from 'component/button';
|
||||
import ChannelSelector from 'component/channelSelector';
|
||||
@@ -124,7 +124,6 @@ class PublishPage extends React.PureComponent {
|
||||
tags: [],
|
||||
selectedChannel: null,
|
||||
uploadedThumbnailUri: null,
|
||||
vanityUrlSet: false,
|
||||
|
||||
// other
|
||||
publishStarted: false,
|
||||
@@ -181,16 +180,9 @@ class PublishPage extends React.PureComponent {
|
||||
|
||||
// Check if this is an edit action
|
||||
if (navigation.state.params) {
|
||||
const { editMode, claimToEdit, vanityUrl } = navigation.state.params;
|
||||
const { editMode, claimToEdit } = navigation.state.params;
|
||||
if (editMode) {
|
||||
this.prepareEdit(claimToEdit);
|
||||
} else if (vanityUrl) {
|
||||
const { claimName } = parseURI(vanityUrl);
|
||||
this.setState({
|
||||
name: claimName,
|
||||
hasEditedContentAddress: true,
|
||||
vanityUrlSet: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -242,7 +234,6 @@ class PublishPage extends React.PureComponent {
|
||||
title,
|
||||
currentThumbnailUri: thumbnailUrl,
|
||||
uploadedThumbnailUri: thumbnailUrl,
|
||||
vanityUrlSet: false,
|
||||
},
|
||||
() => {
|
||||
this.handleNameChange(name);
|
||||
@@ -389,7 +380,7 @@ class PublishPage extends React.PureComponent {
|
||||
{
|
||||
currentMedia: media,
|
||||
title: null, // no title autogeneration (user will fill this in)
|
||||
name: this.state.hasEditedContentAddress ? this.state.name : this.formatNameForTitle(name),
|
||||
name: this.formatNameForTitle(name),
|
||||
currentPhase: Constants.PHASE_DETAILS,
|
||||
},
|
||||
() => this.handleNameChange(this.state.name)
|
||||
@@ -435,8 +426,6 @@ class PublishPage extends React.PureComponent {
|
||||
tags: [],
|
||||
selectedChannel: null,
|
||||
uploadedThumbnailUri: null,
|
||||
|
||||
vanityUrlSet: false,
|
||||
},
|
||||
() => {
|
||||
// reset thumbnail
|
||||
@@ -523,6 +512,19 @@ class PublishPage extends React.PureComponent {
|
||||
});
|
||||
};
|
||||
|
||||
handleUploadPressed = () => {
|
||||
DocumentPicker.pick({ type: [DocumentPicker.types.allFiles] })
|
||||
.then(file => {
|
||||
// console.log(file);
|
||||
})
|
||||
.catch(error => {
|
||||
if (!DocumentPicker.isCancel(error)) {
|
||||
// notify the user
|
||||
// console.log(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
getRandomFileId = () => {
|
||||
// generate a random id for a photo or recorded video between 1 and 20 (for creating thumbnails)
|
||||
const id = Math.floor(Math.random() * (20 - 2)) + 1;
|
||||
|
||||
@@ -101,7 +101,13 @@ class SearchPage extends React.PureComponent {
|
||||
const { currentUri } = this.state;
|
||||
|
||||
return (
|
||||
<FileListItem uri={currentUri} featuredResult style={searchStyle.featuredResultItem} navigation={navigation} />
|
||||
<FileListItem
|
||||
uri={currentUri}
|
||||
featuredResult
|
||||
style={searchStyle.featuredResultItem}
|
||||
navigation={navigation}
|
||||
onPress={() => navigateToUri(navigation, this.state.currentUri)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import { ActivityIndicator, NativeModules, View, ScrollView, Text } from 'react-native';
|
||||
import Colors from 'styles/colors';
|
||||
import { NativeModules, View, ScrollView, Text } from 'react-native';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import TransactionList from 'component/transactionList';
|
||||
import UriBar from 'component/uriBar';
|
||||
@@ -45,16 +44,13 @@ class TransactionHistoryPage extends React.PureComponent {
|
||||
const { fetchingTransactions, transactions, navigation } = this.props;
|
||||
|
||||
return (
|
||||
<View style={walletStyle.container}>
|
||||
<View>
|
||||
<UriBar navigation={navigation} />
|
||||
{fetchingTransactions && (
|
||||
<View style={walletStyle.loadingContainer}>
|
||||
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
|
||||
<Text style={walletStyle.loadingText}>Loading transactions...</Text>
|
||||
</View>
|
||||
)}
|
||||
<ScrollView style={walletStyle.transactionHistoryScroll}>
|
||||
<View style={walletStyle.historyList}>
|
||||
{fetchingTransactions && !transactions.length && (
|
||||
<Text style={walletStyle.infoText}>Loading transactions...</Text>
|
||||
)}
|
||||
{!fetchingTransactions && transactions.length === 0 && (
|
||||
<Text style={walletStyle.infoText}>No transactions to list.</Text>
|
||||
)}
|
||||
|
||||
@@ -45,12 +45,9 @@ class TrendingPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
onComponentFocused = () => {
|
||||
const { pushDrawerStack, setPlayerVisible, navigation, sortByItem } = this.props;
|
||||
const { pushDrawerStack, setPlayerVisible, navigation } = this.props;
|
||||
const { filterForTags } = navigation.state.params ? navigation.state.params : { filterForTags: false };
|
||||
this.setState({
|
||||
currentTrendingForItem: TRENDING_FOR_ITEMS[filterForTags ? 1 : 0],
|
||||
orderBy: getOrderBy(sortByItem),
|
||||
});
|
||||
this.setState({ currentTrendingForItem: TRENDING_FOR_ITEMS[filterForTags ? 1 : 0] });
|
||||
pushDrawerStack(Constants.DRAWER_ROUTE_TRENDING, navigation.state.params);
|
||||
setPlayerVisible();
|
||||
NativeModules.Firebase.setCurrentScreen('All content');
|
||||
@@ -113,7 +110,7 @@ class TrendingPage extends React.PureComponent {
|
||||
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||
</TouchableOpacity>
|
||||
|
||||
{sortByTop && <Text style={discoverStyle.pickerLabel}>from</Text>}
|
||||
{sortByTop && <Text style={discoverStyle.pickerLabel}>in the</Text>}
|
||||
|
||||
{sortByTop && (
|
||||
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
|
||||
|
||||
@@ -17,9 +17,6 @@ const transactionListStyle = StyleSheet.create({
|
||||
topRow: {
|
||||
marginBottom: 4,
|
||||
},
|
||||
leftCol: {
|
||||
flex: 0.7,
|
||||
},
|
||||
col: {
|
||||
alignSelf: 'stretch',
|
||||
},
|
||||
|
||||
@@ -3,7 +3,6 @@ import Colors from './colors';
|
||||
|
||||
const walletStyle = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: Colors.PageBackground,
|
||||
},
|
||||
scrollContainer: {
|
||||
@@ -289,22 +288,6 @@ const walletStyle = StyleSheet.create({
|
||||
syncSwitch: {
|
||||
marginLeft: 8,
|
||||
},
|
||||
loadingContainer: {
|
||||
position: 'absolute',
|
||||
flexDirection: 'row',
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 60,
|
||||
bottom: 0,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
loadingText: {
|
||||
color: '#aaaaaa',
|
||||
fontFamily: 'Inter-UI-Regular',
|
||||
fontSize: 16,
|
||||
marginLeft: 8,
|
||||
},
|
||||
});
|
||||
|
||||
export default walletStyle;
|
||||
+1
-1
@@ -184,7 +184,7 @@ export function dispatchNavigateBack(dispatch, nav, drawerStack) {
|
||||
export function uriFromFileInfo(fileInfo) {
|
||||
const { name: claimName, claim_name: claimNameDownloaded, claim_id: claimId } = fileInfo;
|
||||
const uriParams = {};
|
||||
uriParams.claimName = claimName || claimNameDownloaded;
|
||||
uriParams.contentName = claimName || claimNameDownloaded;
|
||||
uriParams.claimId = claimId;
|
||||
return buildURI(uriParams);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user