Compare commits
82
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23cf8b15bc | ||
|
|
76cc8eaea1 | ||
|
|
f372b33f42 | ||
|
|
a26fb3e06b | ||
|
|
8bd3bd21e8 | ||
|
|
0115025b86 | ||
|
|
34fa24ffd0 | ||
|
|
9e8ba95fec | ||
|
|
d63253cc30 | ||
|
|
6ce143b145 | ||
|
|
c7ce7ea284 | ||
|
|
076122def4 | ||
|
|
625559528d | ||
|
|
c88961002f | ||
|
|
decf0623fb | ||
|
|
c7f2b78b92 | ||
|
|
47cf15741c | ||
|
|
e74a419ffd | ||
|
|
0c06f478c8 | ||
|
|
9391c1b78c | ||
|
|
e902420269 | ||
|
|
dc0d3ad9b6 | ||
|
|
1c70fc878a | ||
|
|
47cdf2698f | ||
|
|
cf5045cce3 | ||
|
|
e6139d59d9 | ||
|
|
a45e9c5513 | ||
|
|
68d99ac639 | ||
|
|
10e92b2834 | ||
|
|
384550cc63 | ||
|
|
3f7408907a | ||
|
|
4ff2fb1def | ||
|
|
1e31d8d22b | ||
|
|
430fc1a661 | ||
|
|
7dd4f96e65 | ||
|
|
1e6505b664 | ||
|
|
3ed97ff3da | ||
|
|
3cb5d34511 | ||
|
|
8d5ce92f81 | ||
|
|
4c864c00dd | ||
|
|
bbdea90e0f | ||
|
|
719604e7da | ||
|
|
6ae8c32f72 | ||
|
|
4287793d3f | ||
|
|
a2ee73e23e | ||
|
|
6653225b61 | ||
|
|
41f511e233 | ||
|
|
2c6ac47d1a | ||
|
|
1bc2b47145 | ||
|
|
5c80e7f1cf | ||
|
|
0d06ce5844 | ||
|
|
33d525f5c7 | ||
|
|
84fe0f69d5 | ||
|
|
e443a0fdbb | ||
|
|
580f879d0e | ||
|
|
8fc179cbde | ||
|
|
df05825763 | ||
|
|
acf0095be9 | ||
|
|
1e72672b4b | ||
|
|
319cf3abad | ||
|
|
73ad23ef58 | ||
|
|
0041059465 | ||
|
|
47378d9191 | ||
|
|
2e7660250b | ||
|
|
8b67a9fab8 | ||
|
|
95285cf4dd | ||
|
|
60c617f334 | ||
|
|
1853558215 | ||
|
|
f05181898b | ||
|
|
4bd26d4e2e | ||
|
|
c57449abf7 | ||
|
|
38618080a1 | ||
|
|
89222bc9ee | ||
|
|
fc412e4282 | ||
|
|
ffccc124d0 | ||
|
|
e8704b1c92 | ||
|
|
86b4a825c8 | ||
|
|
95b6801450 | ||
|
|
1e0a636b4f | ||
|
|
4b7f3f140a | ||
|
|
18d654cc66 | ||
|
|
22d860a885 |
No files matched your search
Generated
+475
-466
File diff suppressed because it is too large.
Load diff
+11
-8
@@ -12,29 +12,31 @@
|
|||||||
"base-64": "^0.1.0",
|
"base-64": "^0.1.0",
|
||||||
"@expo/vector-icons": "^8.1.0",
|
"@expo/vector-icons": "^8.1.0",
|
||||||
"gfycat-style-urls": "^1.0.3",
|
"gfycat-style-urls": "^1.0.3",
|
||||||
"lbry-redux": "lbryio/lbry-redux#67a654f60630710cae72419448a73a18d076d18a",
|
"lbry-redux": "lbryio/lbry-redux#123efacf4d45289ebda9dc291976d475de227a55",
|
||||||
"lbryinc": "lbryio/lbryinc",
|
"lbryinc": "lbryio/lbryinc#b9f354ae50bd57691765a7d042c5054167878bf4",
|
||||||
"lodash": ">=4.17.11",
|
"lodash": ">=4.17.11",
|
||||||
"merge": ">=1.2.1",
|
"merge": ">=1.2.1",
|
||||||
"moment": "^2.22.1",
|
"moment": "^2.22.1",
|
||||||
"react": "16.8.6",
|
"react": "16.8.6",
|
||||||
"react-native": "0.59.10",
|
"react-native": "0.59.10",
|
||||||
"@react-native-community/async-storage": "^1.5.1",
|
"@react-native-community/async-storage": "^1.5.1",
|
||||||
"react-native-camera": "^2.11.0",
|
"react-native-camera": "^2.11.1",
|
||||||
"react-native-country-picker-modal": "^0.6.2",
|
"react-native-country-picker-modal": "^0.6.2",
|
||||||
"react-native-document-picker": "^2.3.0",
|
|
||||||
"react-native-exception-handler": "2.9.0",
|
"react-native-exception-handler": "2.9.0",
|
||||||
"react-native-fast-image": "^5.0.3",
|
"react-native-fast-image": "^6.1.1",
|
||||||
"react-native-fs": "^2.13.3",
|
"react-native-fs": "^2.13.3",
|
||||||
"react-native-gesture-handler": "^1.1.0",
|
"react-native-gesture-handler": "1.3.0",
|
||||||
"react-native-image-zoom-viewer": "^2.2.5",
|
"react-native-image-zoom-viewer": "^2.2.5",
|
||||||
"react-native-password-strength-meter": "^0.0.2",
|
"react-native-password-strength-meter": "^0.0.2",
|
||||||
"react-native-phone-input": "lbryio/react-native-phone-input",
|
"react-native-phone-input": "lbryio/react-native-phone-input",
|
||||||
|
"react-native-reanimated": "1.2.0",
|
||||||
"react-native-super-grid": "^3.0.4",
|
"react-native-super-grid": "^3.0.4",
|
||||||
"react-native-vector-icons": "^6.4.2",
|
"react-native-vector-icons": "^6.6.0",
|
||||||
"react-native-video": "lbryio/react-native-video#exoplayer-lbry-android",
|
"react-native-video": "lbryio/react-native-video#exoplayer-lbry-android",
|
||||||
"react-navigation": "^3.11.0",
|
"react-navigation": "^3.11.0",
|
||||||
|
"react-navigation-drawer": "^2.2.2",
|
||||||
"react-navigation-redux-helpers": "^3.0.2",
|
"react-navigation-redux-helpers": "^3.0.2",
|
||||||
|
"react-navigation-stack": "^1.8.1",
|
||||||
"react-redux": "^5.0.3",
|
"react-redux": "^5.0.3",
|
||||||
"redux": "^4.0.4",
|
"redux": "^4.0.4",
|
||||||
"redux-persist": "^5.10.0",
|
"redux-persist": "^5.10.0",
|
||||||
@@ -42,7 +44,8 @@
|
|||||||
"redux-persist-transform-compress": "^4.2.0",
|
"redux-persist-transform-compress": "^4.2.0",
|
||||||
"redux-persist-transform-filter": "0.0.18",
|
"redux-persist-transform-filter": "0.0.18",
|
||||||
"redux-thunk": "^2.3.0",
|
"redux-thunk": "^2.3.0",
|
||||||
"rn-fetch-blob": "0.10.15"
|
"rn-fetch-blob": "0.10.15",
|
||||||
|
"seedrandom": "3.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.5.4",
|
"@babel/core": "^7.5.4",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import AboutPage from 'page/about';
|
import AboutPage from 'page/about';
|
||||||
|
import ChannelCreatorPage from 'page/channelCreator';
|
||||||
import DiscoverPage from 'page/discover';
|
import DiscoverPage from 'page/discover';
|
||||||
import DownloadsPage from 'page/downloads';
|
import DownloadsPage from 'page/downloads';
|
||||||
import DrawerContent from 'component/drawerContent';
|
import DrawerContent from 'component/drawerContent';
|
||||||
@@ -17,7 +18,9 @@ import SubscriptionsPage from 'page/subscriptions';
|
|||||||
import TransactionHistoryPage from 'page/transactionHistory';
|
import TransactionHistoryPage from 'page/transactionHistory';
|
||||||
import VerificationScreen from 'page/verification';
|
import VerificationScreen from 'page/verification';
|
||||||
import WalletPage from 'page/wallet';
|
import WalletPage from 'page/wallet';
|
||||||
import { createDrawerNavigator, createStackNavigator, NavigationActions } from 'react-navigation';
|
import { NavigationActions } from 'react-navigation';
|
||||||
|
import { createDrawerNavigator } from 'react-navigation-drawer';
|
||||||
|
import { createStackNavigator } from 'react-navigation-stack';
|
||||||
import {
|
import {
|
||||||
createReduxContainer,
|
createReduxContainer,
|
||||||
createReactNavigationReduxMiddleware,
|
createReactNavigationReduxMiddleware,
|
||||||
@@ -39,7 +42,7 @@ import {
|
|||||||
} from 'lbryinc';
|
} from 'lbryinc';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
import { decode as atob } from 'base-64';
|
import { decode as atob } from 'base-64';
|
||||||
import { dispatchNavigateBack, dispatchNavigateToUri } from 'utils/helper';
|
import { dispatchNavigateBack, dispatchNavigateToUri, transformUrl } from 'utils/helper';
|
||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
@@ -127,79 +130,91 @@ const walletStack = createStackNavigator(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const drawerIconSize = 18;
|
||||||
const drawer = createDrawerNavigator(
|
const drawer = createDrawerNavigator(
|
||||||
{
|
{
|
||||||
DiscoverStack: {
|
DiscoverStack: {
|
||||||
screen: discoverStack,
|
screen: discoverStack,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
title: 'Explore',
|
title: 'Explore',
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="home" size={20} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="home" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
TrendingStack: {
|
Trending: {
|
||||||
screen: TrendingPage,
|
screen: TrendingPage,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
title: 'Trending',
|
title: 'All Content',
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="fire" size={20} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="fire" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
MySubscriptionsStack: {
|
Subscriptions: {
|
||||||
screen: SubscriptionsPage,
|
screen: SubscriptionsPage,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
title: 'Subscriptions',
|
title: 'Subscriptions',
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="heart" solid size={20} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="heart" solid size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
WalletStack: {
|
WalletStack: {
|
||||||
screen: walletStack,
|
screen: walletStack,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
title: 'Wallet',
|
title: 'Wallet',
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="wallet" size={20} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="wallet" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ChannelCreator: {
|
||||||
|
screen: ChannelCreatorPage,
|
||||||
|
navigationOptions: {
|
||||||
|
drawerIcon: ({ tintColor }) => <Icon name="at" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Publish: {
|
Publish: {
|
||||||
screen: PublishPage,
|
screen: PublishPage,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="upload" size={20} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="upload" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Publishes: {
|
Publishes: {
|
||||||
screen: PublishesPage,
|
screen: PublishesPage,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="cloud-upload-alt" size={20} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => (
|
||||||
|
<Icon name="cloud-upload-alt" size={drawerIconSize} style={{ color: tintColor }} />
|
||||||
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Rewards: {
|
Rewards: {
|
||||||
screen: RewardsPage,
|
screen: RewardsPage,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="award" size={20} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="award" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
MyLBRYStack: {
|
Downloads: {
|
||||||
screen: DownloadsPage,
|
screen: DownloadsPage,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
title: 'Library',
|
title: 'Library',
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="download" size={20} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="download" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Settings: {
|
Settings: {
|
||||||
screen: SettingsPage,
|
screen: SettingsPage,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
drawerLockMode: 'locked-closed',
|
drawerLockMode: 'locked-closed',
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="cog" size={20} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="cog" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
About: {
|
About: {
|
||||||
screen: AboutPage,
|
screen: AboutPage,
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
drawerLockMode: 'locked-closed',
|
drawerLockMode: 'locked-closed',
|
||||||
drawerIcon: ({ tintColor }) => <Icon name="info" size={20} style={{ color: tintColor }} />,
|
drawerIcon: ({ tintColor }) => <Icon name="info" size={drawerIconSize} style={{ color: tintColor }} />,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
drawerWidth: 300,
|
drawerWidth: 300,
|
||||||
|
drawerBackgroundColor: 'transparent',
|
||||||
headerMode: 'none',
|
headerMode: 'none',
|
||||||
|
backBehavior: 'none',
|
||||||
|
unmountInactiveRoutes: true,
|
||||||
contentComponent: DrawerContent,
|
contentComponent: DrawerContent,
|
||||||
contentOptions: {
|
contentOptions: {
|
||||||
activeTintColor: Colors.LbryGreen,
|
activeTintColor: Colors.LbryGreen,
|
||||||
@@ -265,21 +280,11 @@ class AppWithNavigationState extends React.Component {
|
|||||||
'hardwareBackPress',
|
'hardwareBackPress',
|
||||||
function() {
|
function() {
|
||||||
const { dispatch, nav, drawerStack } = this.props;
|
const { dispatch, nav, drawerStack } = this.props;
|
||||||
// There should be a better way to check this
|
if (drawerStack.length > 1) {
|
||||||
if (nav.routes.length > 0) {
|
dispatchNavigateBack(dispatch, nav, drawerStack);
|
||||||
if (nav.routes[0].routeName === 'Main') {
|
return true;
|
||||||
const mainRoute = nav.routes[0];
|
|
||||||
if (
|
|
||||||
mainRoute.index > 0 ||
|
|
||||||
mainRoute.routes[0].index > 0 /* Discover stack index */ ||
|
|
||||||
mainRoute.routes[4].index > 0 /* Wallet stack index */ ||
|
|
||||||
mainRoute.index >= 5 /* Settings and About screens */
|
|
||||||
) {
|
|
||||||
dispatchNavigateBack(dispatch, nav, drawerStack);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
@@ -313,6 +318,7 @@ class AppWithNavigationState extends React.Component {
|
|||||||
AsyncStorage.setItem(Constants.KEY_EMAIL_VERIFY_PENDING, 'false');
|
AsyncStorage.setItem(Constants.KEY_EMAIL_VERIFY_PENDING, 'false');
|
||||||
this.setState({ verifyPending: false });
|
this.setState({ verifyPending: false });
|
||||||
|
|
||||||
|
NativeModules.Firebase.track('email_verified', { email: user.primary_email });
|
||||||
ToastAndroid.show('Your email address was successfully verified.', ToastAndroid.LONG);
|
ToastAndroid.show('Your email address was successfully verified.', ToastAndroid.LONG);
|
||||||
|
|
||||||
// upon successful email verification, do wallet sync (if password has been set)
|
// upon successful email verification, do wallet sync (if password has been set)
|
||||||
@@ -416,7 +422,7 @@ class AppWithNavigationState extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dispatchNavigateToUri(dispatch, nav, evt.url);
|
dispatchNavigateToUri(dispatch, nav, transformUrl(evt.url));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,16 +34,11 @@ export default class Button extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let renderIcon = (
|
let renderIcon = (
|
||||||
<Icon name={icon} size={18} color={iconColor ? iconColor : 'light' === theme ? Colors.DarkGrey : Colors.White} />
|
<Icon name={icon} size={16} color={iconColor || (theme === 'light' ? Colors.DarkGrey : Colors.White)} />
|
||||||
);
|
);
|
||||||
if (solid) {
|
if (solid) {
|
||||||
renderIcon = (
|
renderIcon = (
|
||||||
<Icon
|
<Icon name={icon} size={16} color={iconColor || (theme === 'light' ? Colors.DarkGrey : Colors.White)} solid />
|
||||||
name={icon}
|
|
||||||
size={18}
|
|
||||||
color={iconColor ? iconColor : 'light' === theme ? Colors.DarkGrey : Colors.White}
|
|
||||||
solid
|
|
||||||
/>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doResolveUri, makeSelectClaimForUri, makeSelectThumbnailForUri, makeSelectIsUriResolving } from 'lbry-redux';
|
import {
|
||||||
|
doResolveUri,
|
||||||
|
makeSelectClaimForUri,
|
||||||
|
makeSelectThumbnailForUri,
|
||||||
|
makeSelectTitleForUri,
|
||||||
|
makeSelectIsUriResolving,
|
||||||
|
} from 'lbry-redux';
|
||||||
import ChannelIconItem from './view';
|
import ChannelIconItem from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
||||||
claim: makeSelectClaimForUri(props.uri)(state),
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
|
title: makeSelectTitleForUri(props.uri)(state),
|
||||||
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,40 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ActivityIndicator, Image, Text, TouchableOpacity, View } from 'react-native';
|
import { ActivityIndicator, Image, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
|
import autothumbStyle from 'styles/autothumb';
|
||||||
import channelIconStyle from 'styles/channelIcon';
|
import channelIconStyle from 'styles/channelIcon';
|
||||||
|
|
||||||
export default class ChannelIconItem extends React.PureComponent {
|
export default class ChannelIconItem extends React.PureComponent {
|
||||||
|
static AUTO_THUMB_STYLES = [
|
||||||
|
autothumbStyle.autothumbPurple,
|
||||||
|
autothumbStyle.autothumbRed,
|
||||||
|
autothumbStyle.autothumbPink,
|
||||||
|
autothumbStyle.autothumbIndigo,
|
||||||
|
autothumbStyle.autothumbBlue,
|
||||||
|
autothumbStyle.autothumbLightBlue,
|
||||||
|
autothumbStyle.autothumbCyan,
|
||||||
|
autothumbStyle.autothumbGreen,
|
||||||
|
autothumbStyle.autothumbYellow,
|
||||||
|
autothumbStyle.autothumbOrange,
|
||||||
|
autothumbStyle.autothumbDeepPurple,
|
||||||
|
autothumbStyle.autothumbAmber,
|
||||||
|
autothumbStyle.autothumbLime,
|
||||||
|
autothumbStyle.autothumbLightGreen,
|
||||||
|
autothumbStyle.autothumbDeepOrange,
|
||||||
|
autothumbStyle.autothumbBrown,
|
||||||
|
];
|
||||||
|
|
||||||
|
state = {
|
||||||
|
autoStyle: null,
|
||||||
|
};
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
this.setState({
|
||||||
|
autoStyle:
|
||||||
|
ChannelIconItem.AUTO_THUMB_STYLES[Math.floor(Math.random() * ChannelIconItem.AUTO_THUMB_STYLES.length)],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { claim, isPlaceholder, uri, resolveUri } = this.props;
|
const { claim, isPlaceholder, uri, resolveUri } = this.props;
|
||||||
if (!claim && !isPlaceholder) {
|
if (!claim && !isPlaceholder) {
|
||||||
@@ -13,6 +44,8 @@ export default class ChannelIconItem extends React.PureComponent {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { claim, isPlaceholder, isResolvingUri, onPress, thumbnail, title } = this.props;
|
const { claim, isPlaceholder, isResolvingUri, onPress, thumbnail, title } = this.props;
|
||||||
|
const displayName = title || (claim ? claim.name : '');
|
||||||
|
const substrIndex = displayName.startsWith('@') ? 1 : 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity style={channelIconStyle.container} onPress={onPress}>
|
<TouchableOpacity style={channelIconStyle.container} onPress={onPress}>
|
||||||
@@ -25,6 +58,7 @@ export default class ChannelIconItem extends React.PureComponent {
|
|||||||
style={[
|
style={[
|
||||||
channelIconStyle.thumbnailContainer,
|
channelIconStyle.thumbnailContainer,
|
||||||
isPlaceholder ? channelIconStyle.borderedThumbnailContainer : null,
|
isPlaceholder ? channelIconStyle.borderedThumbnailContainer : null,
|
||||||
|
isPlaceholder ? null : this.state.autoStyle,
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{isPlaceholder && (
|
{isPlaceholder && (
|
||||||
@@ -32,17 +66,18 @@ export default class ChannelIconItem extends React.PureComponent {
|
|||||||
<Text style={channelIconStyle.placeholderText}>ALL</Text>
|
<Text style={channelIconStyle.placeholderText}>ALL</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{!isPlaceholder && (
|
{!isPlaceholder && thumbnail && (
|
||||||
<Image
|
<Image style={channelIconStyle.thumbnail} resizeMode={'cover'} source={{ uri: thumbnail }} />
|
||||||
style={channelIconStyle.thumbnail}
|
)}
|
||||||
resizeMode={'cover'}
|
{!isPlaceholder && !thumbnail && (
|
||||||
source={thumbnail ? { uri: thumbnail } : require('../../assets/default_avatar.jpg')}
|
<Text style={channelIconStyle.autothumbCharacter}>
|
||||||
/>
|
{displayName.substring(substrIndex, substrIndex + 1).toUpperCase()}
|
||||||
|
</Text>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
{!isPlaceholder && (
|
{!isPlaceholder && (
|
||||||
<Text style={channelIconStyle.title} numberOfLines={1}>
|
<Text style={channelIconStyle.title} numberOfLines={1}>
|
||||||
{title || (claim ? claim.name : '')}
|
{displayName}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { CLAIM_VALUES, isNameValid } from 'lbry-redux';
|
import { CLAIM_VALUES, isURIValid } from 'lbry-redux';
|
||||||
import { ActivityIndicator, Picker, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
import { ActivityIndicator, Picker, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import channelSelectorStyle from 'styles/channelSelector';
|
import channelSelectorStyle from 'styles/channelSelector';
|
||||||
@@ -26,10 +26,20 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { channels, fetchChannelListMine, fetchingChannels } = this.props;
|
const { channels, channelName, fetchChannelListMine, fetchingChannels } = this.props;
|
||||||
if (!channels.length && !fetchingChannels) {
|
if (!channels.length && !fetchingChannels) {
|
||||||
fetchChannelListMine();
|
fetchChannelListMine();
|
||||||
}
|
}
|
||||||
|
this.setState({ currentSelectedValue: channelName });
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
const { channels: prevChannels = [], channelName } = this.props;
|
||||||
|
const { channels = [] } = nextProps;
|
||||||
|
|
||||||
|
if (channels.length !== prevChannels.length && channelName !== this.state.currentSelectedValue) {
|
||||||
|
this.setState({ currentSelectedValue: channelName });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCreateCancel = () => {
|
handleCreateCancel = () => {
|
||||||
@@ -54,13 +64,13 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
if (channel === CLAIM_VALUES.CHANNEL_NEW) {
|
if (channel === CLAIM_VALUES.CHANNEL_NEW) {
|
||||||
this.setState({ addingChannel: true });
|
this.setState({ addingChannel: true });
|
||||||
if (onChannelChange) {
|
if (onChannelChange) {
|
||||||
onChannelChange(channel);
|
onChannelChange(value);
|
||||||
}
|
}
|
||||||
this.handleNewChannelBidChange(newChannelBid);
|
this.handleNewChannelBidChange(newChannelBid);
|
||||||
} else {
|
} else {
|
||||||
this.setState({ addingChannel: false });
|
this.setState({ addingChannel: false });
|
||||||
if (onChannelChange) {
|
if (onChannelChange) {
|
||||||
onChannelChange(channel);
|
onChannelChange(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -68,14 +78,22 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
handleNewChannelNameChange = value => {
|
handleNewChannelNameChange = value => {
|
||||||
const { notify } = this.props;
|
const { notify } = this.props;
|
||||||
|
|
||||||
let newChannelName = value;
|
let newChannelName = value,
|
||||||
|
newChannelNameError = '';
|
||||||
|
|
||||||
if (newChannelName.startsWith('@')) {
|
if (newChannelName.startsWith('@')) {
|
||||||
newChannelName = newChannelName.slice(1);
|
newChannelName = newChannelName.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newChannelName.trim().length > 0 && !isURIValid(newChannelName)) {
|
||||||
|
newChannelNameError = 'Your channel name contains invalid characters.';
|
||||||
|
} else if (this.channelExists(newChannelName)) {
|
||||||
|
newChannelNameError = 'You have already created a channel with the same name.';
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
newChannelName,
|
newChannelName,
|
||||||
|
newChannelNameError,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -102,7 +120,7 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
const { balance, createChannel, onChannelChange, notify } = this.props;
|
const { balance, createChannel, onChannelChange, notify } = this.props;
|
||||||
const { newChannelBid, newChannelName } = this.state;
|
const { newChannelBid, newChannelName } = this.state;
|
||||||
|
|
||||||
if (newChannelName.trim().length === 0 || !isNameValid(newChannelName.substr(1), false)) {
|
if (newChannelName.trim().length === 0 || !isURIValid(newChannelName.substr(1), false)) {
|
||||||
notify({ message: 'Your channel name contains invalid characters.' });
|
notify({ message: 'Your channel name contains invalid characters.' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -163,10 +181,9 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const channel = this.state.addingChannel ? 'new' : this.props.channel;
|
const channel = this.state.addingChannel ? 'new' : this.props.channel;
|
||||||
const { fetchingChannels, channels = [] } = this.props;
|
const { enabled, fetchingChannels, channels = [] } = this.props;
|
||||||
const pickerItems = [{ name: Constants.ITEM_ANONYMOUS }, { name: Constants.ITEM_CREATE_A_CHANNEL }].concat(
|
const pickerItems = [Constants.ITEM_ANONYMOUS, Constants.ITEM_CREATE_A_CHANNEL].concat(channels.map(ch => ch.name));
|
||||||
channels
|
|
||||||
);
|
|
||||||
const {
|
const {
|
||||||
newChannelName,
|
newChannelName,
|
||||||
newChannelNameError,
|
newChannelNameError,
|
||||||
@@ -175,22 +192,24 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
creatingChannel,
|
creatingChannel,
|
||||||
createChannelError,
|
createChannelError,
|
||||||
addingChannel,
|
addingChannel,
|
||||||
|
showCreateChannel,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={channelSelectorStyle.container}>
|
<View style={channelSelectorStyle.container}>
|
||||||
<Picker
|
<Picker
|
||||||
|
enabled={enabled}
|
||||||
selectedValue={this.state.currentSelectedValue}
|
selectedValue={this.state.currentSelectedValue}
|
||||||
style={channelSelectorStyle.channelPicker}
|
style={channelSelectorStyle.channelPicker}
|
||||||
itemStyle={channelSelectorStyle.channelPickerItem}
|
itemStyle={channelSelectorStyle.channelPickerItem}
|
||||||
onValueChange={this.handlePickerValueChange}
|
onValueChange={this.handlePickerValueChange}
|
||||||
>
|
>
|
||||||
{pickerItems.map(item => (
|
{pickerItems.map(item => (
|
||||||
<Picker.Item label={item.name} value={item.name} key={item.name} />
|
<Picker.Item label={item} value={item} key={item} />
|
||||||
))}
|
))}
|
||||||
</Picker>
|
</Picker>
|
||||||
|
|
||||||
{this.state.showCreateChannel && (
|
{showCreateChannel && (
|
||||||
<View style={channelSelectorStyle.createChannelContainer}>
|
<View style={channelSelectorStyle.createChannelContainer}>
|
||||||
<View style={channelSelectorStyle.channelInputContainer}>
|
<View style={channelSelectorStyle.channelInputContainer}>
|
||||||
<Text style={channelSelectorStyle.channelAt}>@</Text>
|
<Text style={channelSelectorStyle.channelAt}>@</Text>
|
||||||
@@ -203,11 +222,14 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
underlineColorAndroid={Colors.NextLbryGreen}
|
underlineColorAndroid={Colors.NextLbryGreen}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
{newChannelNameError.length > 0 && (
|
||||||
|
<Text style={channelSelectorStyle.inlineError}>{newChannelNameError}</Text>
|
||||||
|
)}
|
||||||
<View style={channelSelectorStyle.bidRow}>
|
<View style={channelSelectorStyle.bidRow}>
|
||||||
<Text style={channelSelectorStyle.label}>Deposit</Text>
|
<Text style={channelSelectorStyle.label}>Deposit</Text>
|
||||||
<TextInput
|
<TextInput
|
||||||
style={channelSelectorStyle.bidAmountInput}
|
style={channelSelectorStyle.bidAmountInput}
|
||||||
value={String(this.state.newChannelBid)}
|
value={String(newChannelBid)}
|
||||||
onChangeText={this.handleNewChannelBidChange}
|
onChangeText={this.handleNewChannelBidChange}
|
||||||
placeholder={'0.00'}
|
placeholder={'0.00'}
|
||||||
keyboardType={'number-pad'}
|
keyboardType={'number-pad'}
|
||||||
@@ -226,7 +248,7 @@ export default class ChannelSelector extends React.PureComponent {
|
|||||||
<Link style={channelSelectorStyle.cancelLink} text="Cancel" onPress={this.handleCreateCancel} />
|
<Link style={channelSelectorStyle.cancelLink} text="Cancel" onPress={this.handleCreateCancel} />
|
||||||
<Button
|
<Button
|
||||||
style={channelSelectorStyle.createButton}
|
style={channelSelectorStyle.createButton}
|
||||||
disabled={!(this.state.newChannelName.trim().length > 0 && this.state.newChannelBid > 0)}
|
disabled={!(newChannelName.trim().length > 0 && newChannelBid > 0)}
|
||||||
text="Create"
|
text="Create"
|
||||||
onPress={this.handleCreateChannelClick}
|
onPress={this.handleCreateChannelClick}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -2,44 +2,25 @@ import { connect } from 'react-redux';
|
|||||||
import {
|
import {
|
||||||
MATURE_TAGS,
|
MATURE_TAGS,
|
||||||
doClaimSearch,
|
doClaimSearch,
|
||||||
doClaimSearchByTags,
|
selectClaimSearchByQuery,
|
||||||
makeSelectClaimSearchUrisForTags,
|
selectClaimSearchByQueryLastPageReached,
|
||||||
makeSelectFetchingClaimSearchForTags,
|
selectFetchingClaimSearchByQuery,
|
||||||
selectFetchingClaimSearch,
|
selectFetchingClaimSearch,
|
||||||
selectLastClaimSearchUris,
|
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import ClaimList from './view';
|
import ClaimList from './view';
|
||||||
|
|
||||||
const select = (state, props) => {
|
const select = state => ({
|
||||||
return {
|
showNsfwContent: selectShowNsfw(state),
|
||||||
loading: makeSelectFetchingClaimSearchForTags(props.tags)(state),
|
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||||
uris: makeSelectClaimSearchUrisForTags(props.tags)(state),
|
lastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
||||||
// for subscriptions
|
loadingByQuery: selectFetchingClaimSearchByQuery(state),
|
||||||
claimSearchLoading: selectFetchingClaimSearch(state),
|
loading: selectFetchingClaimSearch(state),
|
||||||
claimSearchUris: selectLastClaimSearchUris(state),
|
});
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
claimSearch: options => dispatch(doClaimSearch(Constants.DEFAULT_PAGE_SIZE, options)),
|
claimSearch: options => dispatch(doClaimSearch(options)),
|
||||||
searchByTags: (tags, orderBy = Constants.DEFAULT_ORDER_BY, page = 1, additionalOptions = {}) =>
|
|
||||||
dispatch(
|
|
||||||
doClaimSearchByTags(
|
|
||||||
tags,
|
|
||||||
Constants.DEFAULT_PAGE_SIZE,
|
|
||||||
Object.assign(
|
|
||||||
{},
|
|
||||||
{
|
|
||||||
no_totals: true,
|
|
||||||
order_by: orderBy,
|
|
||||||
page,
|
|
||||||
not_tags: MATURE_TAGS,
|
|
||||||
},
|
|
||||||
additionalOptions
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|||||||
+116
-110
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import NavigationActions from 'react-navigation';
|
import NavigationActions from 'react-navigation';
|
||||||
import { ActivityIndicator, FlatList, Text, TouchableOpacity, View } from 'react-native';
|
import { ActivityIndicator, FlatList, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { MATURE_TAGS, normalizeURI } from 'lbry-redux';
|
import { MATURE_TAGS, normalizeURI, createNormalizedClaimSearchKey } from 'lbry-redux';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import FileItem from 'component/fileItem';
|
import FileItem from 'component/fileItem';
|
||||||
import FileListItem from 'component/fileListItem';
|
import FileListItem from 'component/fileListItem';
|
||||||
@@ -21,94 +21,82 @@ class ClaimList extends React.PureComponent {
|
|||||||
state = {
|
state = {
|
||||||
currentPage: 1, // initial page load is page 1
|
currentPage: 1, // initial page load is page 1
|
||||||
subscriptionsView: false, // whether or not this claim list is for subscriptions
|
subscriptionsView: false, // whether or not this claim list is for subscriptions
|
||||||
trendingForAllView: false,
|
lastPageReached: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const {
|
const { channelIds } = this.props;
|
||||||
channelIds,
|
|
||||||
trendingForAll,
|
|
||||||
claimSearch,
|
|
||||||
orderBy = Constants.DEFAULT_ORDER_BY,
|
|
||||||
searchByTags,
|
|
||||||
tags,
|
|
||||||
time,
|
|
||||||
} = this.props;
|
|
||||||
if (channelIds || trendingForAll) {
|
|
||||||
const options = {
|
|
||||||
order_by: orderBy,
|
|
||||||
no_totals: true,
|
|
||||||
not_tags: MATURE_TAGS,
|
|
||||||
page: this.state.currentPage,
|
|
||||||
};
|
|
||||||
if (channelIds) {
|
|
||||||
this.setState({ subscriptionsView: true });
|
|
||||||
options.channel_ids = channelIds;
|
|
||||||
} else if (trendingForAll) {
|
|
||||||
this.setState({ trendingForAllView: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
claimSearch(options);
|
if (channelIds) {
|
||||||
} else if (tags && tags.length > 0) {
|
this.setState({ subscriptionsView: true });
|
||||||
const additionalOptions = {};
|
|
||||||
if (orderBy && orderBy[0] === Constants.ORDER_BY_EFFECTIVE_AMOUNT && Constants.TIME_ALL !== time) {
|
|
||||||
additionalOptions.release_time = this.getReleaseTimeOption(time);
|
|
||||||
}
|
|
||||||
searchByTags(tags, orderBy, this.state.currentPage, additionalOptions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.doClaimSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentDidUpdate(prevProps) {
|
||||||
const {
|
const {
|
||||||
claimSearch,
|
claimSearchByQuery: prevClaimSearchByQuery,
|
||||||
orderBy: prevOrderBy,
|
orderBy: prevOrderBy,
|
||||||
searchByTags,
|
searchByTags,
|
||||||
tags: prevTags,
|
tags: prevTags,
|
||||||
channelIds: prevChannelIds,
|
channelIds: prevChannelIds,
|
||||||
trendingForAll: prevTrendingForAll,
|
|
||||||
time: prevTime,
|
time: prevTime,
|
||||||
} = this.props;
|
} = prevProps;
|
||||||
const { orderBy, tags, channelIds, trendingForAll, time } = nextProps;
|
const { claimSearchByQuery, orderBy, tags, channelIds, time } = this.props;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!_.isEqual(orderBy, prevOrderBy) ||
|
!_.isEqual(orderBy, prevOrderBy) ||
|
||||||
!_.isEqual(tags, prevTags) ||
|
!_.isEqual(tags, prevTags) ||
|
||||||
!_.isEqual(channelIds, prevChannelIds) ||
|
!_.isEqual(channelIds, prevChannelIds) ||
|
||||||
time !== prevTime ||
|
time !== prevTime
|
||||||
trendingForAll !== prevTrendingForAll
|
|
||||||
) {
|
) {
|
||||||
// reset to page 1 because the order, tags or channelIds changed
|
// reset to page 1 because the order, tags or channelIds changed
|
||||||
this.setState({ currentPage: 1 }, () => {
|
this.setState({ currentPage: 1 }, () => {
|
||||||
if (this.scrollView) {
|
if (this.scrollView) {
|
||||||
this.scrollView.scrollToOffset({ animated: true, offset: 0 });
|
this.scrollView.scrollToOffset({ animated: true, offset: 0 });
|
||||||
}
|
}
|
||||||
if (trendingForAll || (prevChannelIds && channelIds)) {
|
|
||||||
const options = {
|
if (prevChannelIds && channelIds) {
|
||||||
order_by: orderBy,
|
|
||||||
no_totals: true,
|
|
||||||
not_tags: MATURE_TAGS,
|
|
||||||
page: this.state.currentPage,
|
|
||||||
};
|
|
||||||
if (channelIds) {
|
if (channelIds) {
|
||||||
this.setState({ subscriptionsView: true });
|
this.setState({ subscriptionsView: true });
|
||||||
options.channel_ids = channelIds;
|
|
||||||
}
|
}
|
||||||
if (trendingForAll) {
|
|
||||||
this.setState({ trendingForAllView: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
claimSearch(options);
|
|
||||||
} else if (tags && tags.length > 0) {
|
} else if (tags && tags.length > 0) {
|
||||||
this.setState({ subscriptionsView: false, trendingForAllView: false });
|
this.setState({ subscriptionsView: false });
|
||||||
const additionalOptions = {};
|
|
||||||
if (orderBy && orderBy[0] === Constants.ORDER_BY_EFFECTIVE_AMOUNT && Constants.TIME_ALL !== time) {
|
|
||||||
additionalOptions.release_time = this.getReleaseTimeOption(time);
|
|
||||||
}
|
|
||||||
searchByTags(tags, orderBy, this.state.currentPage, additionalOptions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.doClaimSearch();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildClaimSearchOptions() {
|
||||||
|
const { orderBy, channelIds, showNsfwContent, tags, time } = this.props;
|
||||||
|
const { currentPage, subscriptionsView } = this.state;
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
order_by: orderBy,
|
||||||
|
no_totals: true,
|
||||||
|
page: currentPage,
|
||||||
|
page_size: Constants.DEFAULT_PAGE_SIZE,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (channelIds) {
|
||||||
|
options.channel_ids = channelIds;
|
||||||
|
} else if (tags && tags.length > 0) {
|
||||||
|
options.any_tags = tags;
|
||||||
|
}
|
||||||
|
if (!showNsfwContent) {
|
||||||
|
options.not_tags = MATURE_TAGS;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (orderBy && orderBy[0] === Constants.ORDER_BY_EFFECTIVE_AMOUNT && Constants.TIME_ALL !== time) {
|
||||||
|
options.release_time = this.getReleaseTimeOption(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
getReleaseTimeOption = time => {
|
getReleaseTimeOption = time => {
|
||||||
return `>${Math.floor(
|
return `>${Math.floor(
|
||||||
moment()
|
moment()
|
||||||
@@ -117,36 +105,27 @@ class ClaimList extends React.PureComponent {
|
|||||||
)}`;
|
)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
doClaimSearch() {
|
||||||
|
const { claimSearch } = this.props;
|
||||||
|
const options = this.buildClaimSearchOptions();
|
||||||
|
claimSearch(options);
|
||||||
|
}
|
||||||
|
|
||||||
handleVerticalEndReached = () => {
|
handleVerticalEndReached = () => {
|
||||||
// fetch more content
|
// fetch more content
|
||||||
const { channelIds, claimSearch, claimSearchUris, orderBy, searchByTags, tags, time, uris } = this.props;
|
const { claimSearchByQuery, lastPageReached } = this.props;
|
||||||
const { subscriptionsView, trendingForAllView } = this.state;
|
|
||||||
if ((claimSearchUris && claimSearchUris.length >= softLimit) || (uris && uris.length >= softLimit)) {
|
const options = this.buildClaimSearchOptions();
|
||||||
// don't fetch more than the specified limit to be displayed
|
const claimSearchKey = createNormalizedClaimSearchKey(options);
|
||||||
|
const uris = claimSearchByQuery[claimSearchKey];
|
||||||
|
if (
|
||||||
|
lastPageReached[claimSearchKey] ||
|
||||||
|
((uris.length > 0 && uris.length < Constants.DEFAULT_PAGE_SIZE) || uris.length >= softLimit)
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({ currentPage: this.state.currentPage + 1 }, () => {
|
this.setState({ currentPage: this.state.currentPage + 1 }, () => this.doClaimSearch());
|
||||||
if (subscriptionsView || trendingForAllView) {
|
|
||||||
const options = {
|
|
||||||
order_by: orderBy,
|
|
||||||
no_totals: true,
|
|
||||||
not_tags: MATURE_TAGS,
|
|
||||||
page: this.state.currentPage,
|
|
||||||
};
|
|
||||||
if (subscriptionsView) {
|
|
||||||
options.channel_ids = channelIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
claimSearch(options);
|
|
||||||
} else {
|
|
||||||
const additionalOptions = {};
|
|
||||||
if (orderBy && orderBy[0] === Constants.ORDER_BY_EFFECTIVE_AMOUNT && Constants.TIME_ALL !== time) {
|
|
||||||
additionalOptions.release_time = this.getReleaseTimeOption(time);
|
|
||||||
}
|
|
||||||
searchByTags(tags, orderBy, this.state.currentPage, additionalOptions);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
appendMorePlaceholder = items => {
|
appendMorePlaceholder = items => {
|
||||||
@@ -161,7 +140,7 @@ class ClaimList extends React.PureComponent {
|
|||||||
if (tags.length === 1) {
|
if (tags.length === 1) {
|
||||||
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_TAG, key: 'tagPage', params: { tag: tags[0] } });
|
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_TAG, key: 'tagPage', params: { tag: tags[0] } });
|
||||||
} else {
|
} else {
|
||||||
navigation.navigate({ routeName: Constants.FULL_ROUTE_NAME_TRENDING });
|
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_TRENDING, params: { filterForTags: true } });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -174,22 +153,64 @@ class ClaimList extends React.PureComponent {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
verticalListEmptyComponent = () => {
|
||||||
|
return (
|
||||||
|
<Text style={claimListStyle.noContentText}>No content to display at this time. Please check back later.</Text>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
renderVerticalItem = ({ item }) => {
|
||||||
|
const { hideChannel, navigation } = this.props;
|
||||||
|
return (
|
||||||
|
<FileListItem
|
||||||
|
key={item}
|
||||||
|
uri={item}
|
||||||
|
hideChannel={hideChannel}
|
||||||
|
style={claimListStyle.verticalListItem}
|
||||||
|
navigation={navigation}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
renderHorizontalItem = ({ item }) => {
|
||||||
|
const { navigation } = this.props;
|
||||||
|
|
||||||
|
return item === Constants.MORE_PLACEHOLDER ? (
|
||||||
|
this.renderMorePlaceholder()
|
||||||
|
) : (
|
||||||
|
<FileItem
|
||||||
|
style={discoverStyle.fileItem}
|
||||||
|
mediaStyle={discoverStyle.fileItemMedia}
|
||||||
|
key={item}
|
||||||
|
uri={normalizeURI(item)}
|
||||||
|
navigation={navigation}
|
||||||
|
showDetails
|
||||||
|
compactView={false}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
ListHeaderComponent,
|
ListHeaderComponent,
|
||||||
loading,
|
loading,
|
||||||
claimSearchLoading,
|
|
||||||
claimSearchUris,
|
|
||||||
morePlaceholder,
|
morePlaceholder,
|
||||||
navigation,
|
navigation,
|
||||||
orientation = Constants.ORIENTATION_VERTICAL,
|
orientation = Constants.ORIENTATION_VERTICAL,
|
||||||
style,
|
style,
|
||||||
uris,
|
claimSearchByQuery,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { subscriptionsView, trendingForAllView } = this.state;
|
const { subscriptionsView } = this.state;
|
||||||
|
|
||||||
|
const options = this.buildClaimSearchOptions();
|
||||||
|
const claimSearchKey = createNormalizedClaimSearchKey(options);
|
||||||
|
let uris = claimSearchByQuery[claimSearchKey];
|
||||||
|
|
||||||
|
if (uris) {
|
||||||
|
uris = uris.filter(uri => uri && uri.length > 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (Constants.ORIENTATION_VERTICAL === orientation) {
|
if (Constants.ORIENTATION_VERTICAL === orientation) {
|
||||||
const data = subscriptionsView || trendingForAllView ? claimSearchUris : uris;
|
|
||||||
return (
|
return (
|
||||||
<View style={style}>
|
<View style={style}>
|
||||||
<FlatList
|
<FlatList
|
||||||
@@ -197,22 +218,21 @@ class ClaimList extends React.PureComponent {
|
|||||||
this.scrollView = ref;
|
this.scrollView = ref;
|
||||||
}}
|
}}
|
||||||
ListHeaderComponent={ListHeaderComponent}
|
ListHeaderComponent={ListHeaderComponent}
|
||||||
|
ListEmptyComponent={loading ? null : this.verticalListEmptyComponent}
|
||||||
style={claimListStyle.verticalScrollContainer}
|
style={claimListStyle.verticalScrollContainer}
|
||||||
contentContainerStyle={claimListStyle.verticalScrollPadding}
|
contentContainerStyle={claimListStyle.verticalScrollPadding}
|
||||||
initialNumToRender={10}
|
initialNumToRender={10}
|
||||||
maxToRenderPerBatch={20}
|
maxToRenderPerBatch={20}
|
||||||
removeClippedSubviews
|
removeClippedSubviews
|
||||||
renderItem={({ item }) => (
|
renderItem={this.renderVerticalItem}
|
||||||
<FileListItem key={item} uri={item} style={claimListStyle.verticalListItem} navigation={navigation} />
|
data={uris}
|
||||||
)}
|
|
||||||
data={data}
|
|
||||||
keyExtractor={(item, index) => item}
|
keyExtractor={(item, index) => item}
|
||||||
onEndReached={this.handleVerticalEndReached}
|
onEndReached={this.handleVerticalEndReached}
|
||||||
onEndReachedThreshold={0.2}
|
onEndReachedThreshold={0.2}
|
||||||
/>
|
/>
|
||||||
{(((subscriptionsView || trendingForAllView) && claimSearchLoading) || loading) && (
|
{loading && (
|
||||||
<View style={claimListStyle.verticalLoading}>
|
<View style={claimListStyle.verticalLoading}>
|
||||||
<ActivityIndicator size={'small'} color={Colors.LbryGreen} />
|
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
@@ -223,7 +243,7 @@ class ClaimList extends React.PureComponent {
|
|||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<View style={discoverStyle.listLoading}>
|
<View style={discoverStyle.listLoading}>
|
||||||
<ActivityIndicator size={'small'} color={Colors.LbryGreen} />
|
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -235,21 +255,7 @@ class ClaimList extends React.PureComponent {
|
|||||||
initialNumToRender={3}
|
initialNumToRender={3}
|
||||||
maxToRenderPerBatch={3}
|
maxToRenderPerBatch={3}
|
||||||
removeClippedSubviews
|
removeClippedSubviews
|
||||||
renderItem={({ item }) => {
|
renderItem={this.renderHorizontalItem}
|
||||||
return item === Constants.MORE_PLACEHOLDER ? (
|
|
||||||
this.renderMorePlaceholder()
|
|
||||||
) : (
|
|
||||||
<FileItem
|
|
||||||
style={discoverStyle.fileItem}
|
|
||||||
mediaStyle={discoverStyle.fileItemMedia}
|
|
||||||
key={item}
|
|
||||||
uri={normalizeURI(item)}
|
|
||||||
navigation={navigation}
|
|
||||||
showDetails
|
|
||||||
compactView={false}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
horizontal
|
horizontal
|
||||||
showsHorizontalScrollIndicator={false}
|
showsHorizontalScrollIndicator={false}
|
||||||
data={uris ? this.appendMorePlaceholder(uris.slice(0, horizontalLimit)) : []}
|
data={uris ? this.appendMorePlaceholder(uris.slice(0, horizontalLimit)) : []}
|
||||||
|
|||||||
@@ -1,36 +1,97 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { DrawerItems, SafeAreaView } from 'react-navigation';
|
import { DrawerItems, SafeAreaView } from 'react-navigation';
|
||||||
import { ScrollView } from 'react-native';
|
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import discoverStyle from 'styles/discover';
|
import discoverStyle from 'styles/discover';
|
||||||
|
|
||||||
|
const groupedMenuItems = {
|
||||||
|
'Find content': [
|
||||||
|
{ icon: 'hashtag', label: 'Your tags', route: Constants.DRAWER_ROUTE_DISCOVER },
|
||||||
|
{ icon: 'heart', solid: true, label: 'Subscriptions', route: Constants.DRAWER_ROUTE_SUBSCRIPTIONS },
|
||||||
|
{ icon: 'globe-americas', label: 'All content', route: Constants.DRAWER_ROUTE_TRENDING },
|
||||||
|
],
|
||||||
|
'Your content': [
|
||||||
|
{ icon: 'at', label: 'Channels', route: Constants.DRAWER_ROUTE_CHANNEL_CREATOR },
|
||||||
|
{ icon: 'download', label: 'Library', route: Constants.DRAWER_ROUTE_MY_LBRY },
|
||||||
|
{ icon: 'cloud-upload-alt', label: 'Publishes', route: Constants.DRAWER_ROUTE_PUBLISHES },
|
||||||
|
{ icon: 'upload', label: 'New publish', route: Constants.DRAWER_ROUTE_PUBLISH },
|
||||||
|
],
|
||||||
|
Wallet: [
|
||||||
|
{ icon: 'wallet', label: 'Wallet', route: Constants.DRAWER_ROUTE_WALLET },
|
||||||
|
{ icon: 'award', label: 'Rewards', route: Constants.DRAWER_ROUTE_REWARDS },
|
||||||
|
],
|
||||||
|
Settings: [
|
||||||
|
{ icon: 'cog', label: 'Settings', route: Constants.DRAWER_ROUTE_SETTINGS },
|
||||||
|
{ icon: 'info', label: 'About', route: Constants.DRAWER_ROUTE_ABOUT },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
const groupNames = Object.keys(groupedMenuItems);
|
||||||
|
|
||||||
class DrawerContent extends React.PureComponent {
|
class DrawerContent extends React.PureComponent {
|
||||||
render() {
|
render() {
|
||||||
const props = this.props;
|
const { activeTintColor, navigation, onItemPress } = this.props;
|
||||||
const { navigation, onItemPress } = props;
|
const { state } = navigation;
|
||||||
|
|
||||||
|
const activeItemKey = state.routes[state.index] ? state.routes[state.index].key : null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollView>
|
<View style={discoverStyle.drawerContentArea}>
|
||||||
<SafeAreaView style={discoverStyle.drawerContentContainer} forceInset={{ top: 'always', horizontal: 'never' }}>
|
<ScrollView contentContainerStyle={discoverStyle.menuScrollContent}>
|
||||||
<DrawerItems
|
<SafeAreaView
|
||||||
{...props}
|
style={discoverStyle.drawerContentContainer}
|
||||||
onItemPress={route => {
|
forceInset={{ top: 'always', horizontal: 'never' }}
|
||||||
const { routeName } = route.route;
|
>
|
||||||
if (Constants.FULL_ROUTE_NAME_DISCOVER === routeName) {
|
{groupNames.map(groupName => {
|
||||||
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_DISCOVER });
|
const menuItems = groupedMenuItems[groupName];
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Constants.FULL_ROUTE_NAME_WALLET === routeName) {
|
return (
|
||||||
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_WALLET });
|
<View key={groupName} style={discoverStyle.menuGroup}>
|
||||||
return;
|
{groupNames[3] !== groupName && (
|
||||||
}
|
<Text key={`${groupName}-title`} style={discoverStyle.menuGroupName}>
|
||||||
|
{groupName}
|
||||||
onItemPress(route);
|
</Text>
|
||||||
}}
|
)}
|
||||||
/>
|
{menuItems.map(item => {
|
||||||
</SafeAreaView>
|
const focused =
|
||||||
</ScrollView>
|
activeItemKey === item.route ||
|
||||||
|
(activeItemKey === Constants.FULL_ROUTE_NAME_DISCOVER &&
|
||||||
|
item.route === Constants.DRAWER_ROUTE_DISCOVER) ||
|
||||||
|
(activeItemKey === Constants.FULL_ROUTE_NAME_WALLET &&
|
||||||
|
item.route === Constants.DRAWER_ROUTE_WALLET);
|
||||||
|
return (
|
||||||
|
<TouchableOpacity
|
||||||
|
accessible
|
||||||
|
accessibilityLabel={item.label}
|
||||||
|
style={[
|
||||||
|
discoverStyle.menuItemTouchArea,
|
||||||
|
focused ? discoverStyle.menuItemTouchAreaFocused : null,
|
||||||
|
]}
|
||||||
|
key={item.label}
|
||||||
|
onPress={() => navigation.navigate({ routeName: item.route })}
|
||||||
|
delayPressIn={0}
|
||||||
|
>
|
||||||
|
<View style={discoverStyle.menuItemIcon}>
|
||||||
|
<Icon
|
||||||
|
name={item.icon}
|
||||||
|
size={16}
|
||||||
|
solid={item.solid}
|
||||||
|
color={focused ? activeTintColor : null}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<Text style={[discoverStyle.menuItem, focused ? discoverStyle.menuItemFocused : null]}>
|
||||||
|
{item.label}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</SafeAreaView>
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
makeSelectTitleForUri,
|
makeSelectTitleForUri,
|
||||||
makeSelectIsUriResolving,
|
makeSelectIsUriResolving,
|
||||||
makeSelectClaimIsNsfw,
|
makeSelectClaimIsNsfw,
|
||||||
|
makeSelectShortUrlForUri,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { selectRewardContentClaimIds } from 'lbryinc';
|
import { selectRewardContentClaimIds } from 'lbryinc';
|
||||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
@@ -17,9 +18,10 @@ const select = (state, props) => ({
|
|||||||
claim: makeSelectClaimForUri(props.uri)(state),
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
||||||
metadata: makeSelectMetadataForUri(props.uri)(state),
|
metadata: makeSelectMetadataForUri(props.uri)(state),
|
||||||
rewardedContentClaimIds: selectRewardContentClaimIds(state, props),
|
rewardedContentClaimIds: selectRewardContentClaimIds(state),
|
||||||
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
||||||
obscureNsfw: !selectShowNsfw(state),
|
obscureNsfw: !selectShowNsfw(state),
|
||||||
|
shortUrl: makeSelectShortUrlForUri(props.uri)(state),
|
||||||
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
||||||
title: makeSelectTitleForUri(props.uri)(state),
|
title: makeSelectTitleForUri(props.uri)(state),
|
||||||
nsfw: makeSelectClaimIsNsfw(props.uri)(state),
|
nsfw: makeSelectClaimIsNsfw(props.uri)(state),
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ class FileItem extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
navigateToFileUri = () => {
|
navigateToFileUri = () => {
|
||||||
const { navigation, uri } = this.props;
|
const { navigation, uri, shortUrl } = this.props;
|
||||||
const normalizedUri = normalizeURI(uri);
|
const normalizedUri = normalizeURI(uri);
|
||||||
if (NativeModules.Firebase) {
|
if (NativeModules.Firebase) {
|
||||||
NativeModules.Firebase.track('explore_click', { uri: normalizedUri });
|
NativeModules.Firebase.track('explore_click', { uri: normalizedUri, short_url: shortUrl });
|
||||||
}
|
}
|
||||||
navigateToUri(navigation, normalizedUri);
|
navigateToUri(navigation, shortUrl || uri);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -50,19 +50,28 @@ class FileItem extends React.PureComponent {
|
|||||||
style,
|
style,
|
||||||
mediaStyle,
|
mediaStyle,
|
||||||
navigation,
|
navigation,
|
||||||
|
nsfw,
|
||||||
|
obscureNsfw,
|
||||||
showDetails,
|
showDetails,
|
||||||
compactView,
|
compactView,
|
||||||
titleBeforeThumbnail,
|
titleBeforeThumbnail,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
|
if (claim && claim.value_type === 'channel') {
|
||||||
|
// don't display channels in the lists on the Explore page
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const uri = normalizeURI(this.props.uri);
|
const uri = normalizeURI(this.props.uri);
|
||||||
const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw;
|
const obscure = obscureNsfw && nsfw;
|
||||||
const isRewardContent = claim && rewardedContentClaimIds.includes(claim.claim_id);
|
const isRewardContent = claim && rewardedContentClaimIds.includes(claim.claim_id);
|
||||||
const signingChannel = claim ? claim.signing_channel : null;
|
const signingChannel = claim ? claim.signing_channel : null;
|
||||||
const channelName = signingChannel ? signingChannel.name : null;
|
const channelName = signingChannel ? signingChannel.name : null;
|
||||||
const channelClaimId = signingChannel ? signingChannel.claim_id : null;
|
const channelClaimId = signingChannel ? signingChannel.claim_id : null;
|
||||||
const fullChannelUri = channelClaimId ? `${channelName}#${channelClaimId}` : channelName;
|
const fullChannelUri = channelClaimId ? `${channelName}#${channelClaimId}` : channelName;
|
||||||
|
const shortChannelUri = signingChannel ? signingChannel.short_url : null;
|
||||||
const height = claim ? claim.height : null;
|
const height = claim ? claim.height : null;
|
||||||
|
const duration = claim && claim.value && claim.value.video ? claim.value.video.duration : null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={style}>
|
<View style={style}>
|
||||||
@@ -73,14 +82,13 @@ class FileItem extends React.PureComponent {
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
<FileItemMedia
|
<FileItemMedia
|
||||||
|
duration={duration}
|
||||||
title={title}
|
title={title}
|
||||||
thumbnail={thumbnail}
|
thumbnail={thumbnail}
|
||||||
blurRadius={obscureNsfw ? 15 : 0}
|
|
||||||
resizeMode="cover"
|
resizeMode="cover"
|
||||||
isResolvingUri={isResolvingUri}
|
isResolvingUri={isResolvingUri}
|
||||||
style={mediaStyle}
|
style={mediaStyle}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{!compactView && fileInfo && fileInfo.completed && fileInfo.download_path && (
|
{!compactView && fileInfo && fileInfo.completed && fileInfo.download_path && (
|
||||||
<Icon style={discoverStyle.downloadedIcon} solid color={Colors.NextLbryGreen} name={'folder'} size={16} />
|
<Icon style={discoverStyle.downloadedIcon} solid color={Colors.NextLbryGreen} name={'folder'} size={16} />
|
||||||
)}
|
)}
|
||||||
@@ -102,17 +110,16 @@ class FileItem extends React.PureComponent {
|
|||||||
style={discoverStyle.channelName}
|
style={discoverStyle.channelName}
|
||||||
text={channelName}
|
text={channelName}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
navigateToUri(navigation, normalizeURI(fullChannelUri));
|
navigateToUri(navigation, normalizeURI(shortChannelUri || fullChannelUri));
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{!channelName && !isResolvingUri && <Text style={discoverStyle.anonChannelName}>Anonymous</Text>}
|
||||||
<DateTime style={discoverStyle.dateTime} textStyle={discoverStyle.dateTimeText} timeAgo uri={uri} />
|
<DateTime style={discoverStyle.dateTime} textStyle={discoverStyle.dateTimeText} timeAgo uri={uri} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
{obscureNsfw && (
|
{obscure && <NsfwOverlay onPress={() => navigation.navigate({ routeName: 'Settings', key: 'settingsPage' })} />}
|
||||||
<NsfwOverlay onPress={() => navigation.navigate({ routeName: 'Settings', key: 'settingsPage' })} />
|
|
||||||
)}
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,24 +2,26 @@ import React from 'react';
|
|||||||
import { ActivityIndicator, Image, Text, View } from 'react-native';
|
import { ActivityIndicator, Image, Text, View } from 'react-native';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import FastImage from 'react-native-fast-image';
|
import FastImage from 'react-native-fast-image';
|
||||||
|
import VideoDuration from 'component/videoDuration';
|
||||||
|
import autothumbStyle from 'styles/autothumb';
|
||||||
import fileItemMediaStyle from 'styles/fileItemMedia';
|
import fileItemMediaStyle from 'styles/fileItemMedia';
|
||||||
|
|
||||||
class FileItemMedia extends React.PureComponent {
|
class FileItemMedia extends React.PureComponent {
|
||||||
static AUTO_THUMB_STYLES = [
|
static AUTO_THUMB_STYLES = [
|
||||||
fileItemMediaStyle.autothumbPurple,
|
autothumbStyle.autothumbPurple,
|
||||||
fileItemMediaStyle.autothumbRed,
|
autothumbStyle.autothumbRed,
|
||||||
fileItemMediaStyle.autothumbPink,
|
autothumbStyle.autothumbPink,
|
||||||
fileItemMediaStyle.autothumbIndigo,
|
autothumbStyle.autothumbIndigo,
|
||||||
fileItemMediaStyle.autothumbBlue,
|
autothumbStyle.autothumbBlue,
|
||||||
fileItemMediaStyle.autothumbLightBlue,
|
autothumbStyle.autothumbLightBlue,
|
||||||
fileItemMediaStyle.autothumbCyan,
|
autothumbStyle.autothumbCyan,
|
||||||
fileItemMediaStyle.autothumbTeal,
|
autothumbStyle.autothumbTeal,
|
||||||
fileItemMediaStyle.autothumbGreen,
|
autothumbStyle.autothumbGreen,
|
||||||
fileItemMediaStyle.autothumbYellow,
|
autothumbStyle.autothumbYellow,
|
||||||
fileItemMediaStyle.autothumbOrange,
|
autothumbStyle.autothumbOrange,
|
||||||
];
|
];
|
||||||
|
|
||||||
state: {
|
state = {
|
||||||
imageLoadFailed: false,
|
imageLoadFailed: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ class FileItemMedia extends React.PureComponent {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thumbnail.substring(0, 7) != 'http://' && thumbnail.substring(0, 8) != 'https://') {
|
if (thumbnail.substring(0, 7) !== 'http://' && thumbnail.substring(0, 8) !== 'https://') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,37 +59,34 @@ class FileItemMedia extends React.PureComponent {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
let style = this.props.style;
|
let style = this.props.style;
|
||||||
const { blurRadius, isResolvingUri, thumbnail, title, resizeMode } = this.props;
|
const { duration, isResolvingUri, thumbnail, title, resizeMode } = this.props;
|
||||||
const atStyle = this.state.autoThumbStyle;
|
const atStyle = this.state.autoThumbStyle;
|
||||||
if (this.isThumbnailValid(thumbnail) && !this.state.imageLoadFailed) {
|
if (this.isThumbnailValid(thumbnail) && !this.state.imageLoadFailed) {
|
||||||
if (style == null) {
|
if (style == null) {
|
||||||
style = fileItemMediaStyle.thumbnail;
|
style = fileItemMediaStyle.thumbnail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blurRadius > 0) {
|
|
||||||
// No blur radius support in FastImage yet
|
|
||||||
return (
|
|
||||||
<Image
|
|
||||||
source={{ uri: thumbnail }}
|
|
||||||
blurRadius={blurRadius}
|
|
||||||
resizeMode={resizeMode ? resizeMode : 'cover'}
|
|
||||||
style={style}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FastImage
|
<View style={style}>
|
||||||
source={{ uri: thumbnail }}
|
<FastImage
|
||||||
onError={() => this.setState({ imageLoadFailed: true })}
|
source={{ uri: thumbnail }}
|
||||||
resizeMode={this.getFastImageResizeMode(resizeMode)}
|
onError={() => this.setState({ imageLoadFailed: true })}
|
||||||
style={style}
|
resizeMode={this.getFastImageResizeMode(resizeMode)}
|
||||||
/>
|
style={fileItemMediaStyle.image}
|
||||||
|
/>
|
||||||
|
{duration && (
|
||||||
|
<VideoDuration
|
||||||
|
duration={duration}
|
||||||
|
style={fileItemMediaStyle.duration}
|
||||||
|
textStyle={fileItemMediaStyle.durationText}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[style ? style : fileItemMediaStyle.autothumb, atStyle]}>
|
<View style={[style || fileItemMediaStyle.autothumb, atStyle]}>
|
||||||
{isResolvingUri && (
|
{isResolvingUri && (
|
||||||
<View style={fileItemMediaStyle.resolving}>
|
<View style={fileItemMediaStyle.resolving}>
|
||||||
<ActivityIndicator color={Colors.White} size={'large'} />
|
<ActivityIndicator color={Colors.White} size={'large'} />
|
||||||
@@ -104,6 +103,13 @@ class FileItemMedia extends React.PureComponent {
|
|||||||
.toUpperCase()}
|
.toUpperCase()}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
{duration && (
|
||||||
|
<VideoDuration
|
||||||
|
duration={duration}
|
||||||
|
style={fileItemMediaStyle.duration}
|
||||||
|
textStyle={fileItemMediaStyle.durationText}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,39 +53,39 @@ class FileList extends React.PureComponent<Props, State> {
|
|||||||
dateNew: fileInfos =>
|
dateNew: fileInfos =>
|
||||||
this.props.sortByHeight
|
this.props.sortByHeight
|
||||||
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||||
if (fileInfo1.pending) {
|
if (fileInfo1.pending) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||||
? this.props.claimsById[fileInfo1.claim_id].height
|
? this.props.claimsById[fileInfo1.claim_id].height
|
||||||
: 0;
|
: 0;
|
||||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||||
? this.props.claimsById[fileInfo2.claim_id].height
|
? this.props.claimsById[fileInfo2.claim_id].height
|
||||||
: 0;
|
: 0;
|
||||||
if (height1 > height2) {
|
if (height1 > height2) {
|
||||||
return -1;
|
return -1;
|
||||||
} else if (height1 < height2) {
|
} else if (height1 < height2) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
})
|
})
|
||||||
: [...fileInfos].reverse(),
|
: [...fileInfos].reverse(),
|
||||||
dateOld: fileInfos =>
|
dateOld: fileInfos =>
|
||||||
this.props.sortByHeight
|
this.props.sortByHeight
|
||||||
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
? fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||||
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
const height1 = this.props.claimsById[fileInfo1.claim_id]
|
||||||
? this.props.claimsById[fileInfo1.claim_id].height
|
? this.props.claimsById[fileInfo1.claim_id].height
|
||||||
: 999999;
|
: 999999;
|
||||||
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
const height2 = this.props.claimsById[fileInfo2.claim_id]
|
||||||
? this.props.claimsById[fileInfo2.claim_id].height
|
? this.props.claimsById[fileInfo2.claim_id].height
|
||||||
: 999999;
|
: 999999;
|
||||||
if (height1 < height2) {
|
if (height1 < height2) {
|
||||||
return -1;
|
return -1;
|
||||||
} else if (height1 > height2) {
|
} else if (height1 > height2) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
})
|
})
|
||||||
: fileInfos,
|
: fileInfos,
|
||||||
title: fileInfos =>
|
title: fileInfos =>
|
||||||
fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
fileInfos.slice().sort((fileInfo1, fileInfo2) => {
|
||||||
@@ -160,7 +160,7 @@ class FileList extends React.PureComponent<Props, State> {
|
|||||||
// This is unfortunate
|
// This is unfortunate
|
||||||
// https://github.com/lbryio/lbry/issues/1159
|
// https://github.com/lbryio/lbry/issues/1159
|
||||||
const name = claimName || claimNameDownloaded;
|
const name = claimName || claimNameDownloaded;
|
||||||
uriParams.contentName = name;
|
uriParams.claimName = name;
|
||||||
uriParams.claimId = claimId;
|
uriParams.claimId = claimId;
|
||||||
const uri = buildURI(uriParams);
|
const uri = buildURI(uriParams);
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ class FileList extends React.PureComponent<Props, State> {
|
|||||||
style={fileListStyle.fileItem}
|
style={fileListStyle.fileItem}
|
||||||
uri={item}
|
uri={item}
|
||||||
navigation={navigation}
|
navigation={navigation}
|
||||||
showDetails={true}
|
showDetails
|
||||||
compactView={false}
|
compactView={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -5,10 +5,12 @@ import {
|
|||||||
makeSelectMetadataForUri,
|
makeSelectMetadataForUri,
|
||||||
makeSelectFileInfoForUri,
|
makeSelectFileInfoForUri,
|
||||||
makeSelectIsUriResolving,
|
makeSelectIsUriResolving,
|
||||||
|
makeSelectClaimIsNsfw,
|
||||||
|
makeSelectShortUrlForUri,
|
||||||
makeSelectTitleForUri,
|
makeSelectTitleForUri,
|
||||||
makeSelectThumbnailForUri,
|
makeSelectThumbnailForUri,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
import { selectBlackListedOutpoints, selectFilteredOutpoints, selectRewardContentClaimIds } from 'lbryinc';
|
||||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
import FileListItem from './view';
|
import FileListItem from './view';
|
||||||
|
|
||||||
@@ -19,8 +21,11 @@ const select = (state, props) => ({
|
|||||||
filteredOutpoints: selectFilteredOutpoints(state),
|
filteredOutpoints: selectFilteredOutpoints(state),
|
||||||
isDownloaded: !!makeSelectFileInfoForUri(props.uri)(state),
|
isDownloaded: !!makeSelectFileInfoForUri(props.uri)(state),
|
||||||
metadata: makeSelectMetadataForUri(props.uri)(state),
|
metadata: makeSelectMetadataForUri(props.uri)(state),
|
||||||
|
nsfw: makeSelectClaimIsNsfw(props.uri)(state),
|
||||||
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
||||||
obscureNsfw: !selectShowNsfw(state),
|
obscureNsfw: !selectShowNsfw(state),
|
||||||
|
rewardedContentClaimIds: selectRewardContentClaimIds(state),
|
||||||
|
shortUrl: makeSelectShortUrlForUri(props.uri)(state),
|
||||||
title: makeSelectTitleForUri(props.uri)(state),
|
title: makeSelectTitleForUri(props.uri)(state),
|
||||||
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { normalizeURI, parseURI } from 'lbry-redux';
|
|||||||
import { ActivityIndicator, Platform, Text, TouchableOpacity, View } from 'react-native';
|
import { ActivityIndicator, Platform, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { navigateToUri, formatBytes } from 'utils/helper';
|
import { navigateToUri, formatBytes } from 'utils/helper';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import DateTime from 'component/dateTime';
|
import DateTime from 'component/dateTime';
|
||||||
import FileItemMedia from 'component/fileItemMedia';
|
import FileItemMedia from 'component/fileItemMedia';
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
@@ -12,6 +13,10 @@ import ProgressBar from 'component/progressBar';
|
|||||||
import fileListStyle from 'styles/fileList';
|
import fileListStyle from 'styles/fileList';
|
||||||
|
|
||||||
class FileListItem extends React.PureComponent {
|
class FileListItem extends React.PureComponent {
|
||||||
|
state = {
|
||||||
|
url: null,
|
||||||
|
};
|
||||||
|
|
||||||
getStorageForFileInfo = fileInfo => {
|
getStorageForFileInfo = fileInfo => {
|
||||||
if (!fileInfo.completed) {
|
if (!fileInfo.completed) {
|
||||||
const written = formatBytes(fileInfo.written_bytes);
|
const written = formatBytes(fileInfo.written_bytes);
|
||||||
@@ -41,9 +46,30 @@ class FileListItem extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidUpdate() {
|
||||||
|
const { claim, resolveUri, uri } = this.props;
|
||||||
|
if (!claim && uri !== this.state.url) {
|
||||||
|
this.setState({ url: uri }, () => resolveUri(uri));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defaultOnPress = () => {
|
defaultOnPress = () => {
|
||||||
const { navigation, uri } = this.props;
|
const { autoplay, claim, featuredResult, navigation, uri, shortUrl } = this.props;
|
||||||
navigateToUri(navigation, uri);
|
|
||||||
|
if (featuredResult && !claim) {
|
||||||
|
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_PUBLISH, params: { vanityUrl: uri.trim() } });
|
||||||
|
} else {
|
||||||
|
navigateToUri(navigation, shortUrl || uri, { autoplay });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onPressHandler = () => {
|
||||||
|
const { claim, onPress } = this.props;
|
||||||
|
if (onPress) {
|
||||||
|
onPress(claim);
|
||||||
|
} else {
|
||||||
|
this.defaultOnPress();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -53,50 +79,82 @@ class FileListItem extends React.PureComponent {
|
|||||||
fileInfo,
|
fileInfo,
|
||||||
filteredOutpoints,
|
filteredOutpoints,
|
||||||
metadata,
|
metadata,
|
||||||
|
nsfw,
|
||||||
featuredResult,
|
featuredResult,
|
||||||
isResolvingUri,
|
isResolvingUri,
|
||||||
isDownloaded,
|
isDownloaded,
|
||||||
style,
|
style,
|
||||||
|
obscureNsfw,
|
||||||
onPress,
|
onPress,
|
||||||
navigation,
|
navigation,
|
||||||
|
rewardedContentClaimIds,
|
||||||
thumbnail,
|
thumbnail,
|
||||||
hideChannel,
|
hideChannel,
|
||||||
|
onLongPress,
|
||||||
|
selected,
|
||||||
title,
|
title,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const uri = normalizeURI(this.props.uri);
|
const uri = normalizeURI(this.props.uri);
|
||||||
const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw;
|
const obscure = obscureNsfw && nsfw;
|
||||||
const isResolving = !fileInfo && isResolvingUri;
|
const isResolving = !fileInfo && isResolvingUri;
|
||||||
|
const duration = claim && claim.value && claim.value.video ? claim.value.video.duration : null;
|
||||||
|
|
||||||
let name, channel, height, channelClaimId, fullChannelUri, shouldHide, signingChannel;
|
let name,
|
||||||
|
channel,
|
||||||
|
height,
|
||||||
|
isRewardContent,
|
||||||
|
channelClaimId,
|
||||||
|
fullChannelUri,
|
||||||
|
shortChannelUri,
|
||||||
|
shouldHide,
|
||||||
|
signingChannel;
|
||||||
if (claim) {
|
if (claim) {
|
||||||
name = claim.name;
|
name = claim.name;
|
||||||
signingChannel = claim.signing_channel;
|
signingChannel = claim.signing_channel;
|
||||||
channel = signingChannel ? signingChannel.name : null;
|
channel = signingChannel ? signingChannel.name : null;
|
||||||
height = claim.height;
|
height = claim.height;
|
||||||
|
isRewardContent = rewardedContentClaimIds.includes(claim.claim_id);
|
||||||
channelClaimId = signingChannel ? signingChannel.claim_id : null;
|
channelClaimId = signingChannel ? signingChannel.claim_id : null;
|
||||||
fullChannelUri = channelClaimId ? `${channel}#${channelClaimId}` : channel;
|
fullChannelUri = channelClaimId ? `${channel}#${channelClaimId}` : channel;
|
||||||
|
shortChannelUri = signingChannel ? signingChannel.short_url : null;
|
||||||
|
|
||||||
if (blackListedOutpoints || filteredOutpoints) {
|
if (blackListedOutpoints || filteredOutpoints) {
|
||||||
const outpointsToHide = blackListedOutpoints.concat(filteredOutpoints);
|
const outpointsToHide = blackListedOutpoints.concat(filteredOutpoints);
|
||||||
shouldHide = outpointsToHide.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout);
|
shouldHide = outpointsToHide.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: hide channels on tag pages?
|
||||||
|
// shouldHide = 'channel' === claim.value_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldHide || (featuredResult && !isResolvingUri && !claim && !title && !name)) {
|
if (shouldHide || (!isResolvingUri && !claim && !featuredResult)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={style}>
|
<View style={style}>
|
||||||
<TouchableOpacity style={style} onPress={onPress || this.defaultOnPress}>
|
<TouchableOpacity
|
||||||
|
style={style}
|
||||||
|
onPress={this.onPressHandler}
|
||||||
|
onLongPress={() => {
|
||||||
|
if (onLongPress) {
|
||||||
|
onLongPress(claim);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
<FileItemMedia
|
<FileItemMedia
|
||||||
style={fileListStyle.thumbnail}
|
style={fileListStyle.thumbnail}
|
||||||
blurRadius={obscureNsfw ? 15 : 0}
|
duration={duration}
|
||||||
resizeMode="cover"
|
resizeMode="cover"
|
||||||
title={title || name}
|
title={title || name || normalizeURI(uri).substring(7)}
|
||||||
thumbnail={thumbnail}
|
thumbnail={thumbnail}
|
||||||
/>
|
/>
|
||||||
|
{selected && (
|
||||||
|
<View style={fileListStyle.selectedOverlay}>
|
||||||
|
<Icon name={'check-circle'} solid color={Colors.NextLbryGreen} size={32} />
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
{fileInfo && fileInfo.completed && fileInfo.download_path && (
|
{fileInfo && fileInfo.completed && fileInfo.download_path && (
|
||||||
<Icon style={fileListStyle.downloadedIcon} solid color={Colors.NextLbryGreen} name={'folder'} size={16} />
|
<Icon style={fileListStyle.downloadedIcon} solid color={Colors.NextLbryGreen} name={'folder'} size={16} />
|
||||||
)}
|
)}
|
||||||
@@ -119,16 +177,26 @@ class FileListItem extends React.PureComponent {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{(title || name) && (
|
{(title || name) && (
|
||||||
<Text style={featuredResult ? fileListStyle.featuredTitle : fileListStyle.title}>
|
<View style={fileListStyle.titleContainer}>
|
||||||
{this.formatTitle(title) || this.formatTitle(name)}
|
<Text style={featuredResult ? fileListStyle.featuredTitle : fileListStyle.title}>
|
||||||
</Text>
|
{this.formatTitle(title) || this.formatTitle(name)}
|
||||||
|
</Text>
|
||||||
|
{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 && (
|
{channel && !hideChannel && (
|
||||||
<Link
|
<Link
|
||||||
style={fileListStyle.publisher}
|
style={fileListStyle.publisher}
|
||||||
text={channel}
|
text={channel}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
navigateToUri(navigation, normalizeURI(fullChannelUri));
|
navigateToUri(navigation, normalizeURI(shortChannelUri || fullChannelUri));
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -155,9 +223,7 @@ class FileListItem extends React.PureComponent {
|
|||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
{obscureNsfw && (
|
{obscure && <NsfwOverlay onPress={() => navigation.navigate({ routeName: 'Settings', key: 'settingsPage' })} />}
|
||||||
<NsfwOverlay onPress={() => navigation.navigate({ routeName: 'Settings', key: 'settingsPage' })} />
|
|
||||||
)}
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class FloatingWalletBalance extends React.PureComponent<Props> {
|
|||||||
style={floatingButtonStyle.pendingContainer}
|
style={floatingButtonStyle.pendingContainer}
|
||||||
onPress={() => navigation && navigation.navigate({ routeName: 'Rewards' })}
|
onPress={() => navigation && navigation.navigate({ routeName: 'Rewards' })}
|
||||||
>
|
>
|
||||||
<Icon name="award" size={18} style={floatingButtonStyle.rewardIcon} />
|
<Icon name="award" size={14} style={floatingButtonStyle.rewardIcon} />
|
||||||
<Text style={floatingButtonStyle.text}>{unclaimedRewardAmount}</Text>
|
<Text style={floatingButtonStyle.text}>{unclaimedRewardAmount}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
@@ -31,9 +31,10 @@ class FloatingWalletBalance extends React.PureComponent<Props> {
|
|||||||
style={floatingButtonStyle.container}
|
style={floatingButtonStyle.container}
|
||||||
onPress={() => navigation && navigation.navigate({ routeName: 'WalletStack' })}
|
onPress={() => navigation && navigation.navigate({ routeName: 'WalletStack' })}
|
||||||
>
|
>
|
||||||
|
<Icon name="coins" size={12} style={floatingButtonStyle.balanceIcon} />
|
||||||
{isNaN(balance) && <ActivityIndicator size="small" color={Colors.White} />}
|
{isNaN(balance) && <ActivityIndicator size="small" color={Colors.White} />}
|
||||||
{(!isNaN(balance) || balance === 0) && (
|
{(!isNaN(balance) || balance === 0) && (
|
||||||
<Text style={floatingButtonStyle.text}>{formatCredits(parseFloat(balance), 2) + ' LBC'}</Text>
|
<Text style={floatingButtonStyle.text}>{formatCredits(parseFloat(balance), 0, true)}</Text>
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -418,6 +418,13 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
: mediaPlayerStyle.containedTrackingControls,
|
: mediaPlayerStyle.containedTrackingControls,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const seekerCircleStyle = [this.state.seeking ? mediaPlayerStyle.bigSeekerCircle : mediaPlayerStyle.seekerCircle];
|
||||||
|
if (!this.state.seeking) {
|
||||||
|
seekerCircleStyle.push(
|
||||||
|
this.state.fullscreenMode ? mediaPlayerStyle.seekerCircleTopFs : mediaPlayerStyle.seekerCircleTop
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles} onLayout={onLayout}>
|
<View style={styles} onLayout={onLayout}>
|
||||||
<Video
|
<Video
|
||||||
@@ -482,7 +489,7 @@ class MediaPlayer extends React.PureComponent {
|
|||||||
]}
|
]}
|
||||||
{...this.seekResponder.panHandlers}
|
{...this.seekResponder.panHandlers}
|
||||||
>
|
>
|
||||||
<View style={this.state.seeking ? mediaPlayerStyle.bigSeekerCircle : mediaPlayerStyle.seekerCircle} />
|
<View style={seekerCircleStyle} />
|
||||||
</View>
|
</View>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={[
|
style={[
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import TagSearch from 'component/tagSearch';
|
|||||||
import modalTagSelectorStyle from 'styles/modalTagSelector';
|
import modalTagSelectorStyle from 'styles/modalTagSelector';
|
||||||
import { __ } from 'utils/helper';
|
import { __ } from 'utils/helper';
|
||||||
|
|
||||||
|
const minimumTags = 2;
|
||||||
|
|
||||||
export default class ModalTagSelector extends React.PureComponent {
|
export default class ModalTagSelector extends React.PureComponent {
|
||||||
handleAddTag = tag => {
|
handleAddTag = tag => {
|
||||||
if (!tag) {
|
if (!tag) {
|
||||||
@@ -23,6 +25,9 @@ export default class ModalTagSelector extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.props.doToggleTagFollow(tag);
|
this.props.doToggleTagFollow(tag);
|
||||||
|
if (window.persistor) {
|
||||||
|
window.persistor.flush();
|
||||||
|
}
|
||||||
NativeModules.Firebase.track('tag_follow', { tag });
|
NativeModules.Firebase.track('tag_follow', { tag });
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -31,7 +36,16 @@ export default class ModalTagSelector extends React.PureComponent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { followedTags, doToast } = this.props;
|
||||||
|
if (followedTags.length <= minimumTags) {
|
||||||
|
doToast({ message: __(`You can follow a minimum of ${minimumTags} tags.`) });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.props.doToggleTagFollow(tag);
|
this.props.doToggleTagFollow(tag);
|
||||||
|
if (window.persistor) {
|
||||||
|
window.persistor.flush();
|
||||||
|
}
|
||||||
NativeModules.Firebase.track('tag_unfollow', { tag });
|
NativeModules.Firebase.track('tag_unfollow', { tag });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import discoverStyle from '../../styles/discover';
|
|||||||
class NsfwOverlay extends React.PureComponent {
|
class NsfwOverlay extends React.PureComponent {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity style={discoverStyle.overlay} activeOpacity={0.95} onPress={this.props.onPress}>
|
<TouchableOpacity style={discoverStyle.overlay} activeOpacity={1} onPress={this.props.onPress}>
|
||||||
<Text style={discoverStyle.overlayText}>
|
<Text style={discoverStyle.overlayText}>
|
||||||
This content is Not Safe For Work. To view adult content, please change your Settings.
|
This content is Not Safe For Work. To view adult content, please change your Settings.
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ActivityIndicator, FlatList, Text, View } from 'react-native';
|
import { ActivityIndicator, FlatList, Text, View } from 'react-native';
|
||||||
|
import { normalizeURI } from 'lbry-redux';
|
||||||
import { navigateToUri } from 'utils/helper';
|
import { navigateToUri } from 'utils/helper';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import FileListItem from 'component/fileListItem';
|
import FileListItem from 'component/fileListItem';
|
||||||
@@ -41,7 +42,7 @@ export default class RelatedContent extends React.PureComponent {
|
|||||||
didSearch;
|
didSearch;
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { recommendedContent, isSearching, navigation } = this.props;
|
const { recommendedContent, isSearching, navigation, uri, fullUri } = this.props;
|
||||||
|
|
||||||
if (!isSearching && (!recommendedContent || recommendedContent.length === 0)) {
|
if (!isSearching && (!recommendedContent || recommendedContent.length === 0)) {
|
||||||
return null;
|
return null;
|
||||||
@@ -51,15 +52,17 @@ export default class RelatedContent extends React.PureComponent {
|
|||||||
<View style={relatedContentStyle.container}>
|
<View style={relatedContentStyle.container}>
|
||||||
<Text style={relatedContentStyle.title}>Related Content</Text>
|
<Text style={relatedContentStyle.title}>Related Content</Text>
|
||||||
{recommendedContent &&
|
{recommendedContent &&
|
||||||
recommendedContent.map(recommendedUri => (
|
recommendedContent
|
||||||
<FileListItem
|
.filter(recommendedUri => recommendedUri !== normalizeURI(fullUri))
|
||||||
style={fileListStyle.item}
|
.map(recommendedUri => (
|
||||||
key={recommendedUri}
|
<FileListItem
|
||||||
uri={recommendedUri}
|
style={fileListStyle.item}
|
||||||
navigation={navigation}
|
key={recommendedUri}
|
||||||
onPress={() => navigateToUri(navigation, recommendedUri, { autoplay: true })}
|
uri={recommendedUri}
|
||||||
/>
|
navigation={navigation}
|
||||||
))}
|
autoplay
|
||||||
|
/>
|
||||||
|
))}
|
||||||
{isSearching && (
|
{isSearching && (
|
||||||
<ActivityIndicator size="small" color={Colors.NextLbryGreen} style={relatedContentStyle.loading} />
|
<ActivityIndicator size="small" color={Colors.NextLbryGreen} style={relatedContentStyle.loading} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ type Props = {
|
|||||||
id: string,
|
id: string,
|
||||||
reward_title: string,
|
reward_title: string,
|
||||||
reward_amount: number,
|
reward_amount: number,
|
||||||
|
reward_range?: string,
|
||||||
transaction_id: string,
|
transaction_id: string,
|
||||||
created_at: string,
|
created_at: string,
|
||||||
reward_description: string,
|
reward_description: string,
|
||||||
@@ -55,6 +56,20 @@ class RewardCard extends React.PureComponent<Props> {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getDisplayAmount = () => {
|
||||||
|
const { reward } = this.props;
|
||||||
|
if (reward) {
|
||||||
|
if (reward.reward_range && reward.reward_range.includes('-')) {
|
||||||
|
return reward.reward_range.split('-')[0] + '+'; // ex: 5+
|
||||||
|
} else if (reward.reward_amount > 0) {
|
||||||
|
return reward.reward_amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// unknown amount which normally shouldn't happen
|
||||||
|
return '?';
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { canClaim, isPending, onClaimPress, reward } = this.props;
|
const { canClaim, isPending, onClaimPress, reward } = this.props;
|
||||||
const claimed = !!reward.transaction_id;
|
const claimed = !!reward.transaction_id;
|
||||||
@@ -101,7 +116,7 @@ class RewardCard extends React.PureComponent<Props> {
|
|||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
<View style={rewardStyle.rightCol}>
|
<View style={rewardStyle.rightCol}>
|
||||||
<Text style={rewardStyle.rewardAmount}>{reward.reward_amount}</Text>
|
<Text style={rewardStyle.rewardAmount}>{this.getDisplayAmount()}</Text>
|
||||||
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
|
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ class StorageStatsCard extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.state.totalBytes == 0) {
|
const { fileInfos } = this.props;
|
||||||
|
if (fileInfos.length === 0 || this.state.totalBytes === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,17 +5,27 @@ import Button from 'component/button';
|
|||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
|
|
||||||
class SubscribeNotificationButton extends React.PureComponent {
|
class SubscribeNotificationButton extends React.PureComponent {
|
||||||
render() {
|
handlePress = () => {
|
||||||
const {
|
const {
|
||||||
uri,
|
|
||||||
name,
|
name,
|
||||||
doChannelSubscriptionEnableNotifications,
|
doChannelSubscriptionEnableNotifications,
|
||||||
doChannelSubscriptionDisableNotifications,
|
doChannelSubscriptionDisableNotifications,
|
||||||
doToast,
|
doToast,
|
||||||
enabledChannelNotifications,
|
enabledChannelNotifications,
|
||||||
isSubscribed,
|
|
||||||
style,
|
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
const shouldNotify = enabledChannelNotifications.indexOf(name) > -1;
|
||||||
|
|
||||||
|
if (shouldNotify) {
|
||||||
|
doChannelSubscriptionDisableNotifications(name);
|
||||||
|
doToast({ message: 'You will not receive notifications for new content.' });
|
||||||
|
} else {
|
||||||
|
doChannelSubscriptionEnableNotifications(name);
|
||||||
|
doToast({ message: 'You will receive all notifications for new content.' });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { enabledChannelNotifications, name, uri, isSubscribed, style } = this.props;
|
||||||
|
|
||||||
if (!isSubscribed) {
|
if (!isSubscribed) {
|
||||||
return null;
|
return null;
|
||||||
@@ -31,23 +41,14 @@ class SubscribeNotificationButton extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const shouldNotify = enabledChannelNotifications.indexOf(name) > -1;
|
const shouldNotify = enabledChannelNotifications.indexOf(name) > -1;
|
||||||
const { claimName } = parseURI(uri);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
style={styles}
|
style={styles}
|
||||||
theme={'light'}
|
theme={'light'}
|
||||||
icon={shouldNotify ? 'bell-slash' : 'bell'}
|
icon={shouldNotify ? 'bell-slash' : 'bell'}
|
||||||
solid={true}
|
solid
|
||||||
onPress={() => {
|
onPress={this.handlePress}
|
||||||
if (shouldNotify) {
|
|
||||||
doChannelSubscriptionDisableNotifications(name);
|
|
||||||
doToast({ message: 'You will not receive notifications for new content.' });
|
|
||||||
} else {
|
|
||||||
doChannelSubscriptionEnableNotifications(name);
|
|
||||||
doToast({ message: 'You will receive all notifications for new content.' });
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { buildURI, normalizeURI } from 'lbry-redux';
|
import { buildURI, normalizeURI } from 'lbry-redux';
|
||||||
import { ActivityIndicator, FlatList, Image, Text, View } from 'react-native';
|
import { ActivityIndicator, FlatList, Image, Text, View } from 'react-native';
|
||||||
|
import { navigateToUri } from 'utils/helper';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import discoverStyle from 'styles/discover';
|
import discoverStyle from 'styles/discover';
|
||||||
import FileItem from 'component/fileItem';
|
import FileItem from 'component/fileItem';
|
||||||
import SubscribeButton from 'component/subscribeButton';
|
import SubscribeButton from 'component/subscribeButton';
|
||||||
import subscriptionsStyle from 'styles/subscriptions';
|
import subscriptionsStyle from 'styles/subscriptions';
|
||||||
|
import Link from 'component/link';
|
||||||
import Tag from 'component/tag';
|
import Tag from 'component/tag';
|
||||||
|
|
||||||
class SuggestedSubscriptionItem extends React.PureComponent {
|
class SuggestedSubscriptionItem extends React.PureComponent {
|
||||||
@@ -18,9 +20,12 @@ class SuggestedSubscriptionItem extends React.PureComponent {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { claim, isResolvingUri, navigation, thumbnail, title, uri } = this.props;
|
const { claim, isResolvingUri, navigation, thumbnail, title, uri } = this.props;
|
||||||
let tags;
|
let shortUrl, tags;
|
||||||
if (claim && claim.value) {
|
if (claim) {
|
||||||
tags = claim.value.tags;
|
shortUrl = claim.short_url;
|
||||||
|
if (claim.value) {
|
||||||
|
tags = claim.value.tags;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isResolvingUri) {
|
if (isResolvingUri) {
|
||||||
@@ -47,15 +52,22 @@ class SuggestedSubscriptionItem extends React.PureComponent {
|
|||||||
{title}
|
{title}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
<Text style={subscriptionsStyle.suggestedItemName} numberOfLines={1}>
|
{claim && (
|
||||||
{claim && claim.name}
|
<Link
|
||||||
</Text>
|
style={subscriptionsStyle.suggestedItemName}
|
||||||
|
numberOfLines={1}
|
||||||
|
text={claim.name}
|
||||||
|
onPress={() => navigateToUri(navigation, normalizeURI(shortUrl || uri))}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{tags && (
|
{tags && (
|
||||||
<View style={subscriptionsStyle.suggestedItemTagList}>
|
<View style={subscriptionsStyle.suggestedItemTagList}>
|
||||||
{tags &&
|
{tags &&
|
||||||
tags
|
tags
|
||||||
.slice(0, 3)
|
.slice(0, 3)
|
||||||
.map(tag => <Tag style={subscriptionsStyle.tag} key={tag} name={tag} navigation={navigation} />)}
|
.map(tag => (
|
||||||
|
<Tag style={subscriptionsStyle.tag} key={tag} name={tag} navigation={navigation} truncate />
|
||||||
|
))}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doClaimSearch, selectFetchingClaimSearch, selectLastClaimSearchUris, selectFollowedTags } from 'lbry-redux';
|
import { doClaimSearch, selectFetchingClaimSearch, selectClaimSearchByQuery, selectFollowedTags } from 'lbry-redux';
|
||||||
import { selectSuggestedChannels, selectIsFetchingSuggested } from 'lbryinc';
|
import { selectSuggestedChannels, selectIsFetchingSuggested } from 'lbryinc';
|
||||||
import SuggestedSubscriptions from './view';
|
import SuggestedSubscriptions from './view';
|
||||||
|
|
||||||
@@ -7,11 +7,11 @@ const select = state => ({
|
|||||||
followedTags: selectFollowedTags(state),
|
followedTags: selectFollowedTags(state),
|
||||||
suggested: selectSuggestedChannels(state),
|
suggested: selectSuggestedChannels(state),
|
||||||
loading: selectIsFetchingSuggested(state) || selectFetchingClaimSearch(state),
|
loading: selectIsFetchingSuggested(state) || selectFetchingClaimSearch(state),
|
||||||
claimSearchUris: selectLastClaimSearchUris(state),
|
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
claimSearch: options => dispatch(doClaimSearch(10, options)),
|
claimSearch: options => dispatch(doClaimSearch(options)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ActivityIndicator, FlatList, SectionList, Text, View } from 'react-native';
|
import { ActivityIndicator, FlatList, SectionList, Text, View } from 'react-native';
|
||||||
import { normalizeURI } from 'lbry-redux';
|
import { createNormalizedClaimSearchKey, normalizeURI } from 'lbry-redux';
|
||||||
import { __, navigateToUri } from 'utils/helper';
|
import { __, navigateToUri } from 'utils/helper';
|
||||||
import SubscribeButton from 'component/subscribeButton';
|
import SubscribeButton from 'component/subscribeButton';
|
||||||
import SuggestedSubscriptionItem from 'component/suggestedSubscriptionItem';
|
import SuggestedSubscriptionItem from 'component/suggestedSubscriptionItem';
|
||||||
@@ -11,29 +11,37 @@ import Link from 'component/link';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
class SuggestedSubscriptions extends React.PureComponent {
|
class SuggestedSubscriptions extends React.PureComponent {
|
||||||
|
state = {
|
||||||
|
options: {},
|
||||||
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { claimSearch, followedTags } = this.props;
|
const { claimSearch, followedTags } = this.props;
|
||||||
const options = {
|
const options = {
|
||||||
any_tags: _.shuffle(followedTags.map(tag => tag.name)).slice(0, 2),
|
any_tags: _.shuffle(followedTags.map(tag => tag.name)).slice(0, 3),
|
||||||
page: 1,
|
page: 1,
|
||||||
no_totals: true,
|
no_totals: true,
|
||||||
claim_type: 'channel',
|
claim_type: 'channel',
|
||||||
};
|
};
|
||||||
|
this.setState({ options });
|
||||||
claimSearch(options);
|
claimSearch(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
buildSections = () => {
|
buildSections = () => {
|
||||||
const { suggested, claimSearchUris } = this.props;
|
const { suggested, claimSearchByQuery } = this.props;
|
||||||
|
const claimSearchKey = createNormalizedClaimSearchKey(this.state.options);
|
||||||
|
const claimSearchUris = claimSearchByQuery[claimSearchKey];
|
||||||
|
|
||||||
const suggestedUris = suggested ? suggested.map(suggested => suggested.uri) : [];
|
const suggestedUris = suggested ? suggested.map(suggested => suggested.uri) : [];
|
||||||
return [
|
return [
|
||||||
{
|
|
||||||
title: __('You might like'),
|
|
||||||
data: suggestedUris,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: __('Tags you follow'),
|
title: __('Tags you follow'),
|
||||||
data: claimSearchUris ? claimSearchUris.filter(uri => !suggestedUris.includes(uri)) : [],
|
data: claimSearchUris ? claimSearchUris.filter(uri => !suggestedUris.includes(uri)) : [],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: __('You might also like'),
|
||||||
|
data: _.shuffle(suggestedUris),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text, TouchableOpacity, View } from 'react-native';
|
import { Text, TouchableOpacity, View } from 'react-native';
|
||||||
|
import { MATURE_TAGS } from 'lbry-redux';
|
||||||
import { formatTagName } from 'utils/helper';
|
import { formatTagName } from 'utils/helper';
|
||||||
import tagStyle from 'styles/tag';
|
import tagStyle from 'styles/tag';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
@@ -29,7 +30,7 @@ export default class Tag extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { name, onPress, style, type } = this.props;
|
const { name, onPress, style, type, truncate } = this.props;
|
||||||
|
|
||||||
let styles = [];
|
let styles = [];
|
||||||
if (style) {
|
if (style) {
|
||||||
@@ -41,7 +42,7 @@ export default class Tag extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
styles.push({
|
styles.push({
|
||||||
backgroundColor: Colors.TagGreen,
|
backgroundColor: MATURE_TAGS.includes(name) ? Colors.TagGrape : Colors.TagGreen,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
marginBottom: 4,
|
marginBottom: 4,
|
||||||
});
|
});
|
||||||
@@ -49,7 +50,7 @@ export default class Tag extends React.PureComponent {
|
|||||||
return (
|
return (
|
||||||
<TouchableOpacity style={styles} onPress={onPress || this.onPressDefault}>
|
<TouchableOpacity style={styles} onPress={onPress || this.onPressDefault}>
|
||||||
<View style={tagStyle.content}>
|
<View style={tagStyle.content}>
|
||||||
<Text style={tagStyle.text}>{formatTagName(name)}</Text>
|
<Text style={tagStyle.text}>{truncate ? formatTagName(name) : name}</Text>
|
||||||
{type && <Icon style={tagStyle.icon} name={type === 'add' ? 'plus' : 'times'} size={8} />}
|
{type && <Icon style={tagStyle.icon} name={type === 'add' ? 'plus' : 'times'} size={8} />}
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { KeyboardAvoidingView, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
import { KeyboardAvoidingView, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
||||||
|
import { MATURE_TAGS } from 'lbry-redux';
|
||||||
import Tag from 'component/tag';
|
import Tag from 'component/tag';
|
||||||
import tagStyle from 'styles/tag';
|
import tagStyle from 'styles/tag';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
@@ -66,11 +67,12 @@ export default class TagSearch extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { name, style, type, selectedTags = [] } = this.props;
|
const { editable, name, style, type, selectedTags = [], showNsfwTags } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
editable={editable}
|
||||||
style={tagStyle.searchInput}
|
style={tagStyle.searchInput}
|
||||||
placeholder={'Search for more tags'}
|
placeholder={'Search for more tags'}
|
||||||
underlineColorAndroid={Colors.NextLbryGreen}
|
underlineColorAndroid={Colors.NextLbryGreen}
|
||||||
@@ -85,6 +87,22 @@ export default class TagSearch extends React.PureComponent {
|
|||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
</KeyboardAvoidingView>
|
</KeyboardAvoidingView>
|
||||||
|
{showNsfwTags && (
|
||||||
|
<View style={tagStyle.nsfwTagsContainer}>
|
||||||
|
<Text style={tagStyle.nsfwTagsTitle}>Mature tags</Text>
|
||||||
|
<View style={tagStyle.tagResultsList}>
|
||||||
|
{MATURE_TAGS.map(tag => (
|
||||||
|
<Tag
|
||||||
|
key={tag}
|
||||||
|
name={tag}
|
||||||
|
style={tagStyle.tag}
|
||||||
|
type="add"
|
||||||
|
onAddPress={name => this.onAddTagPress(name)}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,12 @@ class TransactionListItem extends React.PureComponent {
|
|||||||
return (
|
return (
|
||||||
<View style={transactionListStyle.listItem}>
|
<View style={transactionListStyle.listItem}>
|
||||||
<View style={[transactionListStyle.row, transactionListStyle.topRow]}>
|
<View style={[transactionListStyle.row, transactionListStyle.topRow]}>
|
||||||
<View style={transactionListStyle.col}>
|
<View style={[transactionListStyle.col, transactionListStyle.leftCol]}>
|
||||||
<Text style={transactionListStyle.text}>{this.capitalize(type)}</Text>
|
<Text style={transactionListStyle.text}>{this.capitalize(type)}</Text>
|
||||||
{name && claimId && (
|
{name && claimId && (
|
||||||
<Link
|
<Link
|
||||||
style={transactionListStyle.link}
|
style={transactionListStyle.link}
|
||||||
|
numberOfLines={1}
|
||||||
onPress={() => navigateToUri(navigation, buildURI({ claimName: name, claimId }))}
|
onPress={() => navigateToUri(navigation, buildURI({ claimName: name, claimId }))}
|
||||||
text={name}
|
text={name}
|
||||||
/>
|
/>
|
||||||
@@ -37,7 +38,7 @@ class TransactionListItem extends React.PureComponent {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={transactionListStyle.row}>
|
<View style={transactionListStyle.row}>
|
||||||
<View style={transactionListStyle.col}>
|
<View style={[transactionListStyle.col, transactionListStyle.leftCol]}>
|
||||||
<Link
|
<Link
|
||||||
style={transactionListStyle.smallLink}
|
style={transactionListStyle.smallLink}
|
||||||
text={txid.substring(0, 8)}
|
text={txid.substring(0, 8)}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
//import BusyIndicator from 'component/common/busy-indicator';
|
// import BusyIndicator from 'component/common/busy-indicator';
|
||||||
import { Text, View } from 'react-native';
|
import { Text, View } from 'react-native';
|
||||||
import Button from '../button';
|
import Button from '../button';
|
||||||
import Link from '../link';
|
import Link from '../link';
|
||||||
@@ -33,7 +33,7 @@ class TransactionListRecent extends React.PureComponent<Props> {
|
|||||||
{!fetchingTransactions && (
|
{!fetchingTransactions && (
|
||||||
<TransactionList
|
<TransactionList
|
||||||
navigation={navigation}
|
navigation={navigation}
|
||||||
transactions={transactions}
|
transactions={transactions.slice(0, 5)}
|
||||||
emptyMessage={"Looks like you don't have any recent transactions."}
|
emptyMessage={"Looks like you don't have any recent transactions."}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
+123
-56
@@ -1,12 +1,12 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SEARCH_TYPES, isNameValid, isURIValid, normalizeURI } from 'lbry-redux';
|
import { SEARCH_TYPES, isNameValid, isURIValid, normalizeURI } from 'lbry-redux';
|
||||||
import { FlatList, Keyboard, TextInput, View } from 'react-native';
|
import { FlatList, Keyboard, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
||||||
import { navigateToUri } from 'utils/helper';
|
import { navigateToUri, transformUrl } from 'utils/helper';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import UriBarItem from './internal/uri-bar-item';
|
import UriBarItem from './internal/uri-bar-item';
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import NavigationButton from 'component/navigationButton';
|
import NavigationButton from 'component/navigationButton';
|
||||||
import discoverStyle from 'styles/discover';
|
|
||||||
import uriBarStyle from 'styles/uriBar';
|
import uriBarStyle from 'styles/uriBar';
|
||||||
|
|
||||||
class UriBar extends React.PureComponent {
|
class UriBar extends React.PureComponent {
|
||||||
@@ -16,6 +16,16 @@ class UriBar extends React.PureComponent {
|
|||||||
|
|
||||||
keyboardDidHideListener = null;
|
keyboardDidHideListener = null;
|
||||||
|
|
||||||
|
state = {
|
||||||
|
changeTextTimeout: null,
|
||||||
|
currentValue: null,
|
||||||
|
inputText: null,
|
||||||
|
focused: false,
|
||||||
|
|
||||||
|
// TODO: Add a setting to enable / disable direct search?
|
||||||
|
directSearch: true,
|
||||||
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
|
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
|
||||||
this.setSelection();
|
this.setSelection();
|
||||||
@@ -36,20 +46,8 @@ class UriBar extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
this.state = {
|
|
||||||
changeTextTimeout: null,
|
|
||||||
currentValue: null,
|
|
||||||
inputText: null,
|
|
||||||
focused: false,
|
|
||||||
// TODO: Add a setting to enable / disable direct search?
|
|
||||||
directSearch: true,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
handleChangeText = text => {
|
handleChangeText = text => {
|
||||||
const newValue = text ? text : '';
|
const newValue = text || '';
|
||||||
clearTimeout(this.state.changeTextTimeout);
|
clearTimeout(this.state.changeTextTimeout);
|
||||||
const { updateSearchQuery, onSearchSubmitted, navigation } = this.props;
|
const { updateSearchQuery, onSearchSubmitted, navigation } = this.props;
|
||||||
|
|
||||||
@@ -111,12 +109,19 @@ class UriBar extends React.PureComponent {
|
|||||||
handleSubmitEditing = () => {
|
handleSubmitEditing = () => {
|
||||||
const { navigation, onSearchSubmitted, updateSearchQuery } = this.props;
|
const { navigation, onSearchSubmitted, updateSearchQuery } = this.props;
|
||||||
if (this.state.inputText) {
|
if (this.state.inputText) {
|
||||||
let inputText = this.state.inputText;
|
let inputText = this.state.inputText,
|
||||||
if (inputText.startsWith('lbry://') && isURIValid(inputText)) {
|
inputTextIsUrl = false;
|
||||||
|
if (inputText.startsWith('lbry://')) {
|
||||||
|
const transformedUrl = transformUrl(inputText);
|
||||||
// if it's a URI (lbry://...), open the file page
|
// if it's a URI (lbry://...), open the file page
|
||||||
const uri = normalizeURI(inputText);
|
if (transformedUrl && isURIValid(transformedUrl)) {
|
||||||
navigateToUri(navigation, uri);
|
inputTextIsUrl = true;
|
||||||
} else {
|
navigateToUri(navigation, transformedUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// couldn't parse the inputText as a URL for some reason, so do a search instead
|
||||||
|
if (!inputTextIsUrl) {
|
||||||
updateSearchQuery(inputText);
|
updateSearchQuery(inputText);
|
||||||
// Not a URI, default to a search request
|
// Not a URI, default to a search request
|
||||||
if (onSearchSubmitted) {
|
if (onSearchSubmitted) {
|
||||||
@@ -136,7 +141,19 @@ class UriBar extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { navigation, suggestions, query, value, belowOverlay } = this.props;
|
const {
|
||||||
|
allowEdit,
|
||||||
|
belowOverlay,
|
||||||
|
navigation,
|
||||||
|
onExitSelectionMode,
|
||||||
|
onEditActionPressed,
|
||||||
|
onDeleteActionPressed,
|
||||||
|
query,
|
||||||
|
selectedItemCount,
|
||||||
|
selectionMode,
|
||||||
|
suggestions,
|
||||||
|
value,
|
||||||
|
} = this.props;
|
||||||
if (this.state.currentValue === null) {
|
if (this.state.currentValue === null) {
|
||||||
this.setState({ currentValue: value });
|
this.setState({ currentValue: value });
|
||||||
}
|
}
|
||||||
@@ -144,43 +161,93 @@ class UriBar extends React.PureComponent {
|
|||||||
let style = [uriBarStyle.overlay, belowOverlay ? null : uriBarStyle.overlayElevated];
|
let style = [uriBarStyle.overlay, belowOverlay ? null : uriBarStyle.overlayElevated];
|
||||||
|
|
||||||
// TODO: Add optional setting to enable URI / search bar suggestions
|
// TODO: Add optional setting to enable URI / search bar suggestions
|
||||||
/*if (this.state.focused) { style.push(uriBarStyle.inFocus); }*/
|
/* if (this.state.focused) { style.push(uriBarStyle.inFocus); } */
|
||||||
|
|
||||||
|
// TODO: selectionModeActions should be dynamically created / specified
|
||||||
return (
|
return (
|
||||||
<View style={style}>
|
<View style={style}>
|
||||||
<View style={[uriBarStyle.uriContainer, belowOverlay ? null : uriBarStyle.containerElevated]}>
|
<View style={[uriBarStyle.uriContainer, belowOverlay ? null : uriBarStyle.containerElevated]}>
|
||||||
<NavigationButton
|
{selectionMode && (
|
||||||
name="bars"
|
<View style={uriBarStyle.selectionModeBar}>
|
||||||
size={24}
|
<View style={uriBarStyle.selectionModeLeftBar}>
|
||||||
style={uriBarStyle.drawerMenuButton}
|
<TouchableOpacity
|
||||||
iconStyle={discoverStyle.drawerHamburger}
|
style={uriBarStyle.backTouchArea}
|
||||||
onPress={() => navigation.openDrawer()}
|
onPress={() => {
|
||||||
/>
|
if (onExitSelectionMode) {
|
||||||
<TextInput
|
onExitSelectionMode();
|
||||||
ref={ref => {
|
}
|
||||||
this.textInput = ref;
|
}}
|
||||||
}}
|
>
|
||||||
style={uriBarStyle.uriText}
|
<Icon name="arrow-left" size={20} />
|
||||||
onLayout={() => {
|
</TouchableOpacity>
|
||||||
this.setSelection();
|
{selectedItemCount > 0 && <Text style={uriBarStyle.itemCount}>{selectedItemCount}</Text>}
|
||||||
}}
|
</View>
|
||||||
selectTextOnFocus={true}
|
|
||||||
placeholder={'Search movies, music, and more'}
|
<View style={uriBarStyle.selectionModeActions}>
|
||||||
underlineColorAndroid={'transparent'}
|
{allowEdit && selectedItemCount === 1 && (
|
||||||
numberOfLines={1}
|
<TouchableOpacity
|
||||||
clearButtonMode={'while-editing'}
|
style={[uriBarStyle.actionTouchArea, uriBarStyle.leftAction]}
|
||||||
value={this.state.currentValue}
|
onPress={() => {
|
||||||
returnKeyType={'go'}
|
if (onEditActionPressed) {
|
||||||
inlineImageLeft={'baseline_search_black_24'}
|
onEditActionPressed();
|
||||||
inlineImagePadding={16}
|
}
|
||||||
onFocus={() => this.setState({ focused: true })}
|
}}
|
||||||
onBlur={() => {
|
>
|
||||||
this.setState({ focused: false });
|
<Icon name="edit" size={20} style={uriBarStyle.actionIcon} />
|
||||||
this.setSelection();
|
</TouchableOpacity>
|
||||||
}}
|
)}
|
||||||
onChangeText={this.handleChangeText}
|
|
||||||
onSubmitEditing={this.handleSubmitEditing}
|
<TouchableOpacity
|
||||||
/>
|
style={uriBarStyle.actionTouchArea}
|
||||||
|
onPress={() => {
|
||||||
|
if (onDeleteActionPressed) {
|
||||||
|
onDeleteActionPressed();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon name="trash-alt" solid={false} size={20} style={uriBarStyle.actionIcon} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!selectionMode && (
|
||||||
|
<NavigationButton
|
||||||
|
name="bars"
|
||||||
|
size={24}
|
||||||
|
style={uriBarStyle.drawerMenuButton}
|
||||||
|
iconStyle={uriBarStyle.drawerHamburger}
|
||||||
|
onPress={() => navigation.openDrawer()}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!selectionMode && (
|
||||||
|
<TextInput
|
||||||
|
ref={ref => {
|
||||||
|
this.textInput = ref;
|
||||||
|
}}
|
||||||
|
autoCorrect={false}
|
||||||
|
style={uriBarStyle.uriText}
|
||||||
|
onLayout={() => {
|
||||||
|
this.setSelection();
|
||||||
|
}}
|
||||||
|
selectTextOnFocus
|
||||||
|
placeholder={'Search movies, music, and more'}
|
||||||
|
underlineColorAndroid={'transparent'}
|
||||||
|
numberOfLines={1}
|
||||||
|
clearButtonMode={'while-editing'}
|
||||||
|
value={this.state.currentValue}
|
||||||
|
returnKeyType={'go'}
|
||||||
|
inlineImageLeft={'baseline_search_black_24'}
|
||||||
|
inlineImagePadding={16}
|
||||||
|
onFocus={() => this.setState({ focused: true })}
|
||||||
|
onBlur={() => {
|
||||||
|
this.setState({ focused: false });
|
||||||
|
this.setSelection();
|
||||||
|
}}
|
||||||
|
onChangeText={this.handleChangeText}
|
||||||
|
onSubmitEditing={this.handleSubmitEditing}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{this.state.focused && !this.state.directSearch && (
|
{this.state.focused && !this.state.directSearch && (
|
||||||
<View style={uriBarStyle.suggestions}>
|
<View style={uriBarStyle.suggestions}>
|
||||||
<FlatList
|
<FlatList
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { connect } from 'react-redux';
|
||||||
|
import VideoDuration from './view';
|
||||||
|
|
||||||
|
export default connect()(VideoDuration);
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Text, View } from 'react-native';
|
||||||
|
import fileListStyle from 'styles/fileList';
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
|
export default class VideoDuration extends React.PureComponent {
|
||||||
|
getDurationString = duration => {
|
||||||
|
let seconds = duration;
|
||||||
|
const hours = Math.floor(seconds / 3600);
|
||||||
|
seconds = duration - hours * 3600;
|
||||||
|
const minutes = Math.floor(seconds / 60);
|
||||||
|
seconds = seconds % 60;
|
||||||
|
|
||||||
|
let durationString = '';
|
||||||
|
if (hours > 0) {
|
||||||
|
durationString += hours + ':';
|
||||||
|
}
|
||||||
|
durationString += _.padStart(minutes, hours > 0 ? 2 : 0, '0') + ':';
|
||||||
|
durationString += _.padStart(seconds, 2, '0');
|
||||||
|
|
||||||
|
return durationString;
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { duration, style, textStyle } = this.props;
|
||||||
|
if (!duration || isNaN(parseFloat(duration))) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={style}>
|
||||||
|
<Text style={textStyle}>{this.getDurationString(duration)}</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+18
-3
@@ -25,6 +25,9 @@ const Constants = {
|
|||||||
PHASE_DETAILS: 'details',
|
PHASE_DETAILS: 'details',
|
||||||
PHASE_PUBLISH: 'publish',
|
PHASE_PUBLISH: 'publish',
|
||||||
|
|
||||||
|
PHASE_LIST: 'list',
|
||||||
|
PHASE_NEW: 'create',
|
||||||
|
|
||||||
CONTENT_TAB: 'content',
|
CONTENT_TAB: 'content',
|
||||||
ABOUT_TAB: 'about',
|
ABOUT_TAB: 'about',
|
||||||
|
|
||||||
@@ -53,6 +56,14 @@ const Constants = {
|
|||||||
ACTION_REACT_NAVIGATION_NAVIGATE: 'Navigation/NAVIGATE',
|
ACTION_REACT_NAVIGATION_NAVIGATE: 'Navigation/NAVIGATE',
|
||||||
ACTION_REACT_NAVIGATION_REPLACE: 'Navigation/REPLACE',
|
ACTION_REACT_NAVIGATION_REPLACE: 'Navigation/REPLACE',
|
||||||
|
|
||||||
|
ACTION_SORT_BY_ITEM_CHANGED: 'SORT_BY_ITEM_CHANGED',
|
||||||
|
ACTION_TIME_ITEM_CHANGED: 'TIME_ITEM_CHANGED',
|
||||||
|
|
||||||
|
ACTION_UPDATE_PUBLISH_FORM_STATE: 'UPDATE_PUBLISH_FORM_STATE',
|
||||||
|
ACTION_UPDATE_CHANNEL_FORM_STATE: 'UPDATE_CHANNEL_FORM_STATE',
|
||||||
|
ACTION_CLEAR_PUBLISH_FORM_STATE: 'CLEAR_PUBLISH_FORM_STATE',
|
||||||
|
ACTION_CLEAR_CHANNEL_FORM_STATE: 'CLEAR_CHANNEL_FORM_STATE',
|
||||||
|
|
||||||
ORIENTATION_HORIZONTAL: 'horizontal',
|
ORIENTATION_HORIZONTAL: 'horizontal',
|
||||||
ORIENTATION_VERTICAL: 'vertical',
|
ORIENTATION_VERTICAL: 'vertical',
|
||||||
|
|
||||||
@@ -66,6 +77,7 @@ const Constants = {
|
|||||||
DRAWER_ROUTE_SUBSCRIPTIONS: 'Subscriptions',
|
DRAWER_ROUTE_SUBSCRIPTIONS: 'Subscriptions',
|
||||||
DRAWER_ROUTE_MY_LBRY: 'Downloads',
|
DRAWER_ROUTE_MY_LBRY: 'Downloads',
|
||||||
DRAWER_ROUTE_PUBLISH: 'Publish',
|
DRAWER_ROUTE_PUBLISH: 'Publish',
|
||||||
|
DRAWER_ROUTE_PUBLISH_FORM: 'PublishForm',
|
||||||
DRAWER_ROUTE_PUBLISHES: 'Publishes',
|
DRAWER_ROUTE_PUBLISHES: 'Publishes',
|
||||||
DRAWER_ROUTE_REWARDS: 'Rewards',
|
DRAWER_ROUTE_REWARDS: 'Rewards',
|
||||||
DRAWER_ROUTE_WALLET: 'Wallet',
|
DRAWER_ROUTE_WALLET: 'Wallet',
|
||||||
@@ -74,12 +86,11 @@ const Constants = {
|
|||||||
DRAWER_ROUTE_SEARCH: 'Search',
|
DRAWER_ROUTE_SEARCH: 'Search',
|
||||||
DRAWER_ROUTE_TRANSACTION_HISTORY: 'TransactionHistory',
|
DRAWER_ROUTE_TRANSACTION_HISTORY: 'TransactionHistory',
|
||||||
DRAWER_ROUTE_TAG: 'Tag',
|
DRAWER_ROUTE_TAG: 'Tag',
|
||||||
|
DRAWER_ROUTE_CHANNEL_CREATOR: 'ChannelCreator',
|
||||||
|
DRAWER_ROUTE_CHANNEL_CREATOR_FORM: 'ChannnelCreatorForm',
|
||||||
|
|
||||||
FULL_ROUTE_NAME_DISCOVER: 'DiscoverStack',
|
FULL_ROUTE_NAME_DISCOVER: 'DiscoverStack',
|
||||||
FULL_ROUTE_NAME_TRENDING: 'TrendingStack',
|
|
||||||
FULL_ROUTE_NAME_MY_SUBSCRIPTIONS: 'MySubscriptionsStack',
|
|
||||||
FULL_ROUTE_NAME_WALLET: 'WalletStack',
|
FULL_ROUTE_NAME_WALLET: 'WalletStack',
|
||||||
FULL_ROUTE_NAME_MY_LBRY: 'MyLBRYStack',
|
|
||||||
|
|
||||||
ROUTE_FILE: 'File',
|
ROUTE_FILE: 'File',
|
||||||
|
|
||||||
@@ -146,4 +157,8 @@ export const DrawerRoutes = [
|
|||||||
Constants.DRAWER_ROUTE_ABOUT,
|
Constants.DRAWER_ROUTE_ABOUT,
|
||||||
Constants.DRAWER_ROUTE_SEARCH,
|
Constants.DRAWER_ROUTE_SEARCH,
|
||||||
Constants.DRAWER_ROUTE_TRANSACTION_HISTORY,
|
Constants.DRAWER_ROUTE_TRANSACTION_HISTORY,
|
||||||
|
Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// sub-pages for main routes
|
||||||
|
export const InnerDrawerRoutes = [Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM, Constants.DRAWER_ROUTE_PUBLISH_FORM];
|
||||||
+15
-19
@@ -37,6 +37,7 @@ import FilesystemStorage from 'redux-persist-filesystem-storage';
|
|||||||
import createCompressor from 'redux-persist-transform-compress';
|
import createCompressor from 'redux-persist-transform-compress';
|
||||||
import createFilter from 'redux-persist-transform-filter';
|
import createFilter from 'redux-persist-transform-filter';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import formReducer from 'redux/reducers/form';
|
||||||
import drawerReducer from 'redux/reducers/drawer';
|
import drawerReducer from 'redux/reducers/drawer';
|
||||||
import settingsReducer from 'redux/reducers/settings';
|
import settingsReducer from 'redux/reducers/settings';
|
||||||
import thunk from 'redux-thunk';
|
import thunk from 'redux-thunk';
|
||||||
@@ -109,6 +110,7 @@ const reducers = persistCombineReducers(persistOptions, {
|
|||||||
file: fileReducer,
|
file: fileReducer,
|
||||||
fileInfo: fileInfoReducer,
|
fileInfo: fileInfoReducer,
|
||||||
filtered: filteredReducer,
|
filtered: filteredReducer,
|
||||||
|
form: formReducer,
|
||||||
homepage: homepageReducer,
|
homepage: homepageReducer,
|
||||||
nav: navigatorReducer,
|
nav: navigatorReducer,
|
||||||
notifications: notificationsReducer,
|
notifications: notificationsReducer,
|
||||||
@@ -136,35 +138,29 @@ const store = createStore(
|
|||||||
);
|
);
|
||||||
window.store = store;
|
window.store = store;
|
||||||
|
|
||||||
/* const persistor = persistStore(store, persistOptions, err => {
|
const persistor = persistStore(store, persistOptions, err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('Unable to load saved SETTINGS');
|
console.log('Unable to load saved SETTINGS');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
window.persistor = persistor; */
|
window.persistor = persistor;
|
||||||
|
|
||||||
|
/*
|
||||||
const persistFilter = {
|
const persistFilter = {
|
||||||
auth: ['authToken'],
|
'auth': ['authToken'],
|
||||||
claims: ['byId', 'claimsByUri'],
|
'claims': ['byId', 'claimsByUri'],
|
||||||
content: ['positions'],
|
'content': ['positions'],
|
||||||
subscriptions: ['enabledChannelNotifications', 'subscriptions'],
|
'subscriptions': ['enabledChannelNotifications', 'subscriptions'],
|
||||||
settings: ['clientSettings'],
|
'settings': ['clientSettings'],
|
||||||
tags: ['followedTags'],
|
'tags': ['followedTags'],
|
||||||
wallet: ['receiveAddress'],
|
'wallet': ['receiveAddress']
|
||||||
};
|
};
|
||||||
|
|
||||||
store.subscribe(() => {
|
store.subscribe(() => {
|
||||||
const state = (({ auth, claims, content, subscriptions, settings, tags, wallet }) => ({
|
const state = (({ auth, claims, content, subscriptions, settings, tags, wallet }) =>
|
||||||
auth,
|
({ auth, claims, content, subscriptions, settings, tags, wallet }))(store.getState());
|
||||||
claims,
|
|
||||||
content,
|
|
||||||
subscriptions,
|
|
||||||
settings,
|
|
||||||
tags,
|
|
||||||
wallet,
|
|
||||||
}))(store.getState());
|
|
||||||
NativeModules.StatePersistor.update(state, persistFilter);
|
NativeModules.StatePersistor.update(state, persistFilter);
|
||||||
});
|
}); */
|
||||||
|
|
||||||
// TODO: Find i18n module that is compatible with react-native
|
// TODO: Find i18n module that is compatible with react-native
|
||||||
global.__ = str => str;
|
global.__ = str => str;
|
||||||
|
|||||||
+22
-20
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { Lbry } from 'lbry-redux';
|
import { Lbry } from 'lbry-redux';
|
||||||
import { NativeModules, Text, View, ScrollView } from 'react-native';
|
import { NativeModules, Text, View, ScrollView } from 'react-native';
|
||||||
import { navigateBack } from 'utils/helper';
|
import { navigateBack } from 'utils/helper';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import PageHeader from 'component/pageHeader';
|
import PageHeader from 'component/pageHeader';
|
||||||
import aboutStyle from 'styles/about';
|
import aboutStyle from 'styles/about';
|
||||||
@@ -18,7 +18,7 @@ class AboutPage extends React.PureComponent {
|
|||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -44,19 +44,21 @@ class AboutPage extends React.PureComponent {
|
|||||||
pushDrawerStack();
|
pushDrawerStack();
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
|
||||||
if (NativeModules.VersionInfo) {
|
NativeModules.Firebase.setCurrentScreen('About').then(result => {
|
||||||
NativeModules.VersionInfo.getAppVersion().then(version => {
|
if (NativeModules.VersionInfo) {
|
||||||
this.setState({ appVersion: version });
|
NativeModules.VersionInfo.getAppVersion().then(version => {
|
||||||
|
this.setState({ appVersion: version });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Lbry.version().then(info => {
|
||||||
|
this.setState({
|
||||||
|
versionInfo: info,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
Lbry.status().then(info => {
|
||||||
Lbry.version().then(info => {
|
this.setState({
|
||||||
this.setState({
|
lbryId: info.installation_id,
|
||||||
versionInfo: info,
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
Lbry.status().then(info => {
|
|
||||||
this.setState({
|
|
||||||
lbryId: info.installation_id,
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -105,7 +107,7 @@ class AboutPage extends React.PureComponent {
|
|||||||
<Text style={aboutStyle.text}>Connected email</Text>
|
<Text style={aboutStyle.text}>Connected email</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={aboutStyle.col}>
|
<View style={aboutStyle.col}>
|
||||||
<Text selectable={true} style={aboutStyle.valueText}>
|
<Text selectable style={aboutStyle.valueText}>
|
||||||
{userEmail}
|
{userEmail}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -125,7 +127,7 @@ class AboutPage extends React.PureComponent {
|
|||||||
<Text style={aboutStyle.text}>App version</Text>
|
<Text style={aboutStyle.text}>App version</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={aboutStyle.col}>
|
<View style={aboutStyle.col}>
|
||||||
<Text selectable={true} style={aboutStyle.valueText}>
|
<Text selectable style={aboutStyle.valueText}>
|
||||||
{this.state.appVersion}
|
{this.state.appVersion}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -133,10 +135,10 @@ class AboutPage extends React.PureComponent {
|
|||||||
|
|
||||||
<View style={aboutStyle.row}>
|
<View style={aboutStyle.row}>
|
||||||
<View style={aboutStyle.col}>
|
<View style={aboutStyle.col}>
|
||||||
<Text style={aboutStyle.text}>Daemon (lbrynet)</Text>
|
<Text style={aboutStyle.text}>LBRY SDK</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={aboutStyle.col}>
|
<View style={aboutStyle.col}>
|
||||||
<Text selectable={true} style={aboutStyle.valueText}>
|
<Text selectable style={aboutStyle.valueText}>
|
||||||
{ver ? ver.lbrynet_version : loading}
|
{ver ? ver.lbrynet_version : loading}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -147,7 +149,7 @@ class AboutPage extends React.PureComponent {
|
|||||||
<Text style={aboutStyle.text}>Platform</Text>
|
<Text style={aboutStyle.text}>Platform</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={aboutStyle.col}>
|
<View style={aboutStyle.col}>
|
||||||
<Text selectable={true} style={aboutStyle.valueText}>
|
<Text selectable style={aboutStyle.valueText}>
|
||||||
{ver ? ver.platform : loading}
|
{ver ? ver.platform : loading}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -156,7 +158,7 @@ class AboutPage extends React.PureComponent {
|
|||||||
<View style={aboutStyle.row}>
|
<View style={aboutStyle.row}>
|
||||||
<View style={aboutStyle.col}>
|
<View style={aboutStyle.col}>
|
||||||
<Text style={aboutStyle.text}>Installation ID</Text>
|
<Text style={aboutStyle.text}>Installation ID</Text>
|
||||||
<Text selectable={true} style={aboutStyle.lineValueText}>
|
<Text selectable style={aboutStyle.lineValueText}>
|
||||||
{this.state.lbryId ? this.state.lbryId : loading}
|
{this.state.lbryId ? this.state.lbryId : loading}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -1,26 +1,23 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import { makeSelectClaimForUri, selectMyChannelClaims } from 'lbry-redux';
|
||||||
doFetchClaimsByChannel,
|
|
||||||
makeSelectClaimForUri,
|
|
||||||
makeSelectClaimsInChannelForCurrentPageState,
|
|
||||||
makeSelectFetchingChannelClaims,
|
|
||||||
makeSelectTotalPagesForChannel,
|
|
||||||
} from 'lbry-redux';
|
|
||||||
import { doPopDrawerStack } from 'redux/actions/drawer';
|
import { doPopDrawerStack } from 'redux/actions/drawer';
|
||||||
|
import { doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
||||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||||
|
import { selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||||
import ChannelPage from './view';
|
import ChannelPage from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
|
channels: selectMyChannelClaims(state),
|
||||||
claim: makeSelectClaimForUri(props.uri)(state),
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
claimsInChannel: makeSelectClaimsInChannelForCurrentPageState(props.uri)(state),
|
|
||||||
drawerStack: selectDrawerStack(state),
|
drawerStack: selectDrawerStack(state),
|
||||||
fetching: makeSelectFetchingChannelClaims(props.uri)(state),
|
sortByItem: selectSortByItem(state),
|
||||||
totalPages: makeSelectTotalPagesForChannel(props.uri, 10)(state), // Update to use a default PAGE_SIZE constant
|
timeItem: selectTimeItem(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)),
|
|
||||||
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
||||||
|
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
||||||
|
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|||||||
+195
-101
@@ -1,111 +1,112 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ActivityIndicator, Dimensions, Image, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
Alert,
|
||||||
|
Dimensions,
|
||||||
|
Image,
|
||||||
|
NativeModules,
|
||||||
|
ScrollView,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from 'react-native';
|
||||||
import { TabView, SceneMap } from 'react-native-tab-view';
|
import { TabView, SceneMap } from 'react-native-tab-view';
|
||||||
import { navigateBack } from 'utils/helper';
|
import { normalizeURI } from 'lbry-redux';
|
||||||
|
import { navigateBack, getOrderBy } from 'utils/helper';
|
||||||
|
import ChannelIconItem from 'component/channelIconItem';
|
||||||
|
import ClaimList from 'component/claimList';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import FileList from 'component/fileList';
|
import ModalPicker from 'component/modalPicker';
|
||||||
import PageHeader from 'component/pageHeader';
|
import PageHeader from 'component/pageHeader';
|
||||||
import SubscribeButton from 'component/subscribeButton';
|
import SubscribeButton from 'component/subscribeButton';
|
||||||
|
import SubscribeNotificationButton from 'component/subscribeNotificationButton';
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
|
import channelIconStyle from 'styles/channelIcon';
|
||||||
import channelPageStyle from 'styles/channelPage';
|
import channelPageStyle from 'styles/channelPage';
|
||||||
|
import discoverStyle from 'styles/discover';
|
||||||
|
|
||||||
class ChannelPage extends React.PureComponent {
|
class ChannelPage extends React.PureComponent {
|
||||||
state = {
|
state = {
|
||||||
page: 1,
|
autoStyle: null,
|
||||||
showPageButtons: false,
|
showSortPicker: false,
|
||||||
|
showTimePicker: false,
|
||||||
|
orderBy: Constants.DEFAULT_ORDER_BY,
|
||||||
activeTab: Constants.CONTENT_TAB,
|
activeTab: Constants.CONTENT_TAB,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentWillMount() {
|
||||||
const { uri, page, claimsInChannel, fetchClaims, fetchClaimCount } = this.props;
|
this.setState({
|
||||||
|
autoStyle:
|
||||||
if (!claimsInChannel || !claimsInChannel.length) {
|
ChannelIconItem.AUTO_THUMB_STYLES[Math.floor(Math.random() * ChannelIconItem.AUTO_THUMB_STYLES.length)],
|
||||||
fetchClaims(uri, page || this.state.page);
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePreviousPage = () => {
|
componentDidMount() {
|
||||||
const { uri, fetchClaims } = this.props;
|
NativeModules.Firebase.setCurrentScreen('Channel');
|
||||||
if (this.state.page > 1) {
|
}
|
||||||
this.setState({ page: this.state.page - 1, showPageButtons: false }, () => {
|
|
||||||
fetchClaims(uri, this.state.page);
|
handleSortByItemSelected = item => {
|
||||||
});
|
const { setSortByItem } = this.props;
|
||||||
}
|
setSortByItem(item);
|
||||||
|
this.setState({ orderBy: getOrderBy(item), showSortPicker: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
handleNextPage = () => {
|
handleTimeItemSelected = item => {
|
||||||
const { uri, fetchClaims, totalPages } = this.props;
|
const { setTimeItem } = this.props;
|
||||||
if (this.state.page < totalPages) {
|
setTimeItem(item);
|
||||||
this.setState({ page: this.state.page + 1, showPageButtons: false }, () => {
|
this.setState({ showTimePicker: false });
|
||||||
fetchClaims(uri, this.state.page);
|
};
|
||||||
});
|
|
||||||
}
|
listHeader = () => {
|
||||||
|
const { sortByItem, timeItem } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={channelPageStyle.listHeader}>
|
||||||
|
<View style={discoverStyle.pickerRow}>
|
||||||
|
<View style={discoverStyle.leftPickerRow}>
|
||||||
|
<TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}>
|
||||||
|
<Text style={discoverStyle.tagSortText}>{sortByItem.label.split(' ')[0]}</Text>
|
||||||
|
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
{Constants.SORT_BY_TOP === sortByItem.name && (
|
||||||
|
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
|
||||||
|
<Text style={discoverStyle.tagSortText}>{timeItem.label}</Text>
|
||||||
|
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
renderContent = () => {
|
renderContent = () => {
|
||||||
const { fetching, claimsInChannel, totalPages, navigation } = this.props;
|
const { claim, navigation, timeItem } = this.props;
|
||||||
|
|
||||||
let contentList;
|
let channelId;
|
||||||
if (fetching) {
|
if (claim) {
|
||||||
contentList = (
|
channelId = claim.claim_id;
|
||||||
<View style={channelPageStyle.busyContainer}>
|
|
||||||
<ActivityIndicator size="large" color={Colors.NextLbryGreen} />
|
|
||||||
<Text style={channelPageStyle.infoText}>Fetching content...</Text>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
contentList =
|
|
||||||
claimsInChannel && claimsInChannel.length ? (
|
|
||||||
<FileList
|
|
||||||
sortByHeight
|
|
||||||
hideFilter
|
|
||||||
fileInfos={claimsInChannel}
|
|
||||||
navigation={navigation}
|
|
||||||
style={channelPageStyle.fileList}
|
|
||||||
contentContainerStyle={channelPageStyle.fileListContent}
|
|
||||||
onEndReached={() => this.setState({ showPageButtons: true })}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<View style={channelPageStyle.busyContainer}>
|
|
||||||
<Text style={channelPageStyle.infoText}>No content found.</Text>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let pageButtons;
|
|
||||||
if (totalPages > 1 && this.state.showPageButtons) {
|
|
||||||
pageButtons = (
|
|
||||||
<View style={channelPageStyle.pageButtons}>
|
|
||||||
<View>
|
|
||||||
{this.state.page > 1 && (
|
|
||||||
<Button
|
|
||||||
style={channelPageStyle.button}
|
|
||||||
text={'Previous'}
|
|
||||||
disabled={!!fetching}
|
|
||||||
onPress={this.handlePreviousPage}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</View>
|
|
||||||
{this.state.page < totalPages && (
|
|
||||||
<Button
|
|
||||||
style={[channelPageStyle.button, channelPageStyle.nextButton]}
|
|
||||||
text={'Next'}
|
|
||||||
disabled={!!fetching}
|
|
||||||
onPress={this.handleNextPage}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={channelPageStyle.contentTab}>
|
<View style={channelPageStyle.contentTab}>
|
||||||
{contentList}
|
{channelId && (
|
||||||
{pageButtons}
|
<ClaimList
|
||||||
|
ListHeaderComponent={this.listHeader}
|
||||||
|
hideChannel
|
||||||
|
orderBy={this.state.orderBy}
|
||||||
|
time={timeItem.name}
|
||||||
|
navigation={navigation}
|
||||||
|
orientation={Constants.ORIENTATION_VERTICAL}
|
||||||
|
channelIds={[channelId]}
|
||||||
|
style={channelPageStyle.claimList}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -159,19 +160,67 @@ class ChannelPage extends React.PureComponent {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
onEditPressed = () => {
|
||||||
const { fetching, claimsInChannel, claim, navigation, totalPages, uri, drawerStack, popDrawerStack } = this.props;
|
const { claim, navigation } = this.props;
|
||||||
const { name, permanent_url: permanentUrl } = claim;
|
if (claim) {
|
||||||
|
const { permanent_url: permanentUrl } = claim;
|
||||||
|
navigation.navigate({
|
||||||
|
routeName: Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
|
||||||
|
params: { editChannelUrl: permanentUrl },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let thumbnailUrl, coverUrl, title;
|
onDeletePressed = () => {
|
||||||
if (claim && claim.value) {
|
const { abandonClaim, claim, navigation } = this.props;
|
||||||
title = claim.value.title;
|
if (claim) {
|
||||||
if (claim.value.cover) {
|
const { txid, nout } = claim;
|
||||||
coverUrl = claim.value.cover.url;
|
|
||||||
}
|
// show confirm alert
|
||||||
if (claim.value.thumbnail) {
|
Alert.alert(
|
||||||
thumbnailUrl = claim.value.thumbnail.url;
|
__('Delete channel'),
|
||||||
|
__('Are you sure you want to delete this channel?'),
|
||||||
|
[
|
||||||
|
{ text: __('No') },
|
||||||
|
{
|
||||||
|
text: __('Yes'),
|
||||||
|
onPress: () => {
|
||||||
|
abandonClaim(txid, nout);
|
||||||
|
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_CHANNEL_CREATOR });
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
{ cancelable: true }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { channels, claim, navigation, uri, drawerStack, popDrawerStack, sortByItem, timeItem } = this.props;
|
||||||
|
const { name, permanent_url: permanentUrl } = claim;
|
||||||
|
const { autoStyle, showSortPicker, showTimePicker } = this.state;
|
||||||
|
const ownedChannel = channels ? channels.map(channel => channel.permanent_url).includes(permanentUrl) : false;
|
||||||
|
|
||||||
|
let thumbnailUrl,
|
||||||
|
coverUrl,
|
||||||
|
title,
|
||||||
|
fullUri,
|
||||||
|
displayName = null,
|
||||||
|
substrIndex = 0;
|
||||||
|
if (claim) {
|
||||||
|
if (claim.value) {
|
||||||
|
title = claim.value.title;
|
||||||
|
if (claim.value.cover) {
|
||||||
|
coverUrl = claim.value.cover.url;
|
||||||
|
}
|
||||||
|
if (claim.value.thumbnail) {
|
||||||
|
thumbnailUrl = claim.value.thumbnail.url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
displayName = title || claim.name;
|
||||||
|
substrIndex = displayName.startsWith('@') ? 1 : 0;
|
||||||
|
fullUri = normalizeURI(`${claim.name}#${claim.claim_id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -194,19 +243,45 @@ class ChannelPage extends React.PureComponent {
|
|||||||
<Text style={channelPageStyle.channelName}>{title && title.trim().length > 0 ? title : name}</Text>
|
<Text style={channelPageStyle.channelName}>{title && title.trim().length > 0 ? title : name}</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={channelPageStyle.avatarImageContainer}>
|
<View style={[channelPageStyle.avatarImageContainer, autoStyle]}>
|
||||||
<Image
|
{thumbnailUrl && (
|
||||||
style={channelPageStyle.avatarImage}
|
<Image style={channelPageStyle.avatarImage} resizeMode={'cover'} source={{ uri: thumbnailUrl }} />
|
||||||
resizeMode={'cover'}
|
)}
|
||||||
source={
|
{(!thumbnailUrl || thumbnailUrl.trim().length === 0) && (
|
||||||
thumbnailUrl && thumbnailUrl.trim().length > 0
|
<Text style={channelIconStyle.autothumbCharacter}>
|
||||||
? { uri: thumbnailUrl }
|
{displayName.substring(substrIndex, substrIndex + 1).toUpperCase()}
|
||||||
: require('../../assets/default_avatar.jpg')
|
</Text>
|
||||||
}
|
)}
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<SubscribeButton style={channelPageStyle.subscribeButton} uri={uri} name={name} />
|
<View style={channelPageStyle.subscribeButtonContainer}>
|
||||||
|
{ownedChannel && (
|
||||||
|
<Button
|
||||||
|
style={channelPageStyle.actionButton}
|
||||||
|
theme={'light'}
|
||||||
|
icon={'edit'}
|
||||||
|
text={'Edit'}
|
||||||
|
onPress={this.onEditPressed}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{ownedChannel && (
|
||||||
|
<Button
|
||||||
|
style={channelPageStyle.deleteButton}
|
||||||
|
theme={'light'}
|
||||||
|
icon={'trash-alt'}
|
||||||
|
text={'Delete'}
|
||||||
|
onPress={this.onDeletePressed}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!ownedChannel && <SubscribeButton style={channelPageStyle.subscribeButton} uri={fullUri} name={name} />}
|
||||||
|
{!ownedChannel && (
|
||||||
|
<SubscribeNotificationButton
|
||||||
|
style={[channelPageStyle.subscribeButton, channelPageStyle.bellButton]}
|
||||||
|
uri={fullUri}
|
||||||
|
name={name}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={channelPageStyle.tabBar}>
|
<View style={channelPageStyle.tabBar}>
|
||||||
@@ -229,6 +304,25 @@ class ChannelPage extends React.PureComponent {
|
|||||||
{Constants.CONTENT_TAB === this.state.activeTab && this.renderContent()}
|
{Constants.CONTENT_TAB === this.state.activeTab && this.renderContent()}
|
||||||
{Constants.ABOUT_TAB === this.state.activeTab && this.renderAbout()}
|
{Constants.ABOUT_TAB === this.state.activeTab && this.renderAbout()}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
{showSortPicker && (
|
||||||
|
<ModalPicker
|
||||||
|
title={__('Sort content by')}
|
||||||
|
onOverlayPress={() => this.setState({ showSortPicker: false })}
|
||||||
|
onItemSelected={this.handleSortByItemSelected}
|
||||||
|
selectedItem={sortByItem}
|
||||||
|
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{showTimePicker && (
|
||||||
|
<ModalPicker
|
||||||
|
title={__('Content from')}
|
||||||
|
onOverlayPress={() => this.setState({ showTimePicker: false })}
|
||||||
|
onItemSelected={this.handleTimeItemSelected}
|
||||||
|
selectedItem={timeItem}
|
||||||
|
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
import { connect } from 'react-redux';
|
||||||
|
import {
|
||||||
|
selectAbandoningIds,
|
||||||
|
selectBalance,
|
||||||
|
selectMyChannelClaims,
|
||||||
|
selectFetchingMyChannels,
|
||||||
|
selectUpdatingChannel,
|
||||||
|
selectUpdateChannelError,
|
||||||
|
doAbandonClaim,
|
||||||
|
doFetchChannelListMine,
|
||||||
|
doCreateChannel,
|
||||||
|
doUpdateChannel,
|
||||||
|
doToast,
|
||||||
|
} from 'lbry-redux';
|
||||||
|
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
|
import { doUpdateChannelFormState, doClearChannelFormState } from 'redux/actions/form';
|
||||||
|
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||||
|
import { selectChannelFormState, selectHasChannelFormState } from 'redux/selectors/form';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
import ChannelCreator from './view';
|
||||||
|
|
||||||
|
const select = state => ({
|
||||||
|
abandoningClaimIds: selectAbandoningIds(state),
|
||||||
|
channels: selectMyChannelClaims(state),
|
||||||
|
channelFormState: selectChannelFormState(state),
|
||||||
|
drawerStack: selectDrawerStack(state),
|
||||||
|
fetchingChannels: selectFetchingMyChannels(state),
|
||||||
|
balance: selectBalance(state),
|
||||||
|
hasFormState: selectHasChannelFormState(state),
|
||||||
|
updatingChannel: selectUpdatingChannel(state),
|
||||||
|
updateChannelError: selectUpdateChannelError(state),
|
||||||
|
});
|
||||||
|
|
||||||
|
const perform = dispatch => ({
|
||||||
|
abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)),
|
||||||
|
notify: data => dispatch(doToast(data)),
|
||||||
|
clearChannelFormState: () => dispatch(doClearChannelFormState()),
|
||||||
|
createChannel: (name, amount, optionalParams) => dispatch(doCreateChannel(name, amount, optionalParams)),
|
||||||
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||||
|
updateChannel: params => dispatch(doUpdateChannel(params)),
|
||||||
|
updateChannelFormState: data => dispatch(doUpdateChannelFormState(data)),
|
||||||
|
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
||||||
|
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
||||||
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
select,
|
||||||
|
perform
|
||||||
|
)(ChannelCreator);
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,12 +1,5 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import { doClaimSearch, doFileList, selectBalance, selectFileInfosDownloaded, selectFollowedTags } from 'lbry-redux';
|
||||||
doClaimSearch,
|
|
||||||
doFileList,
|
|
||||||
selectBalance,
|
|
||||||
selectFileInfosDownloaded,
|
|
||||||
selectLastClaimSearchUris,
|
|
||||||
selectFollowedTags,
|
|
||||||
} from 'lbry-redux';
|
|
||||||
import {
|
import {
|
||||||
doFetchFeaturedUris,
|
doFetchFeaturedUris,
|
||||||
doFetchRewardedContent,
|
doFetchRewardedContent,
|
||||||
@@ -18,9 +11,8 @@ import {
|
|||||||
selectSubscriptionClaims,
|
selectSubscriptionClaims,
|
||||||
selectUnreadSubscriptions,
|
selectUnreadSubscriptions,
|
||||||
} from 'lbryinc';
|
} from 'lbryinc';
|
||||||
|
import { doSetClientSetting, doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
||||||
import { doSetClientSetting } from 'redux/actions/settings';
|
import { makeSelectClientSetting, selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import DiscoverPage from './view';
|
import DiscoverPage from './view';
|
||||||
|
|
||||||
@@ -34,8 +26,9 @@ const select = state => ({
|
|||||||
followedTags: selectFollowedTags(state),
|
followedTags: selectFollowedTags(state),
|
||||||
ratingReminderDisabled: makeSelectClientSetting(Constants.SETTING_RATING_REMINDER_DISABLED)(state),
|
ratingReminderDisabled: makeSelectClientSetting(Constants.SETTING_RATING_REMINDER_DISABLED)(state),
|
||||||
ratingReminderLastShown: makeSelectClientSetting(Constants.SETTING_RATING_REMINDER_LAST_SHOWN)(state),
|
ratingReminderLastShown: makeSelectClientSetting(Constants.SETTING_RATING_REMINDER_LAST_SHOWN)(state),
|
||||||
|
sortByItem: selectSortByItem(state),
|
||||||
|
timeItem: selectTimeItem(state),
|
||||||
unreadSubscriptions: selectUnreadSubscriptions(state),
|
unreadSubscriptions: selectUnreadSubscriptions(state),
|
||||||
uris: selectLastClaimSearchUris(state),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
@@ -46,6 +39,8 @@ const perform = dispatch => ({
|
|||||||
fileList: () => dispatch(doFileList()),
|
fileList: () => dispatch(doFileList()),
|
||||||
removeUnreadSubscriptions: () => dispatch(doRemoveUnreadSubscriptions()),
|
removeUnreadSubscriptions: () => dispatch(doRemoveUnreadSubscriptions()),
|
||||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||||
|
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
||||||
|
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|||||||
+130
-68
@@ -11,7 +11,7 @@ import {
|
|||||||
View,
|
View,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { DEFAULT_FOLLOWED_TAGS, Lbry, normalizeURI, parseURI } from 'lbry-redux';
|
import { DEFAULT_FOLLOWED_TAGS, Lbry, normalizeURI, parseURI } from 'lbry-redux';
|
||||||
import { __, formatTagTitle } from 'utils/helper';
|
import { __, formatTagTitle, getOrderBy } from 'utils/helper';
|
||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import CategoryList from 'component/categoryList';
|
import CategoryList from 'component/categoryList';
|
||||||
@@ -30,13 +30,16 @@ import _ from 'lodash';
|
|||||||
class DiscoverPage extends React.PureComponent {
|
class DiscoverPage extends React.PureComponent {
|
||||||
state = {
|
state = {
|
||||||
tagCollection: [],
|
tagCollection: [],
|
||||||
|
remainingTags: [],
|
||||||
showModalTagSelector: false,
|
showModalTagSelector: false,
|
||||||
showSortPicker: false,
|
showSortPicker: false,
|
||||||
|
showTimePicker: false,
|
||||||
orderBy: Constants.DEFAULT_ORDER_BY,
|
orderBy: Constants.DEFAULT_ORDER_BY,
|
||||||
currentSortByItem: Constants.CLAIM_SEARCH_SORT_BY_ITEMS[0],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Your tags');
|
||||||
|
|
||||||
// Track the total time taken if this is the first launch
|
// Track the total time taken if this is the first launch
|
||||||
AsyncStorage.getItem('firstLaunchTime').then(startTime => {
|
AsyncStorage.getItem('firstLaunchTime').then(startTime => {
|
||||||
if (startTime !== null && !isNaN(parseInt(startTime, 10))) {
|
if (startTime !== null && !isNaN(parseInt(startTime, 10))) {
|
||||||
@@ -60,33 +63,28 @@ class DiscoverPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { fetchRewardedContent, fetchSubscriptions, fileList, followedTags } = this.props;
|
const { sortByItem, fetchRewardedContent, fetchSubscriptions, fileList, followedTags } = this.props;
|
||||||
|
|
||||||
this.buildTagCollection(followedTags);
|
this.buildTagCollection(followedTags);
|
||||||
fetchRewardedContent();
|
fetchRewardedContent();
|
||||||
fetchSubscriptions();
|
fetchSubscriptions();
|
||||||
fileList();
|
fileList();
|
||||||
|
|
||||||
|
this.handleSortByItemSelected(sortByItem);
|
||||||
this.showRatingReminder();
|
this.showRatingReminder();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSortByItemSelected = item => {
|
handleSortByItemSelected = item => {
|
||||||
let orderBy = [];
|
const { setSortByItem } = this.props;
|
||||||
switch (item.name) {
|
setSortByItem(item);
|
||||||
case Constants.SORT_BY_HOT:
|
const orderBy = getOrderBy(item);
|
||||||
orderBy = Constants.DEFAULT_ORDER_BY;
|
this.setState({ orderBy, showSortPicker: false });
|
||||||
break;
|
};
|
||||||
|
|
||||||
case Constants.SORT_BY_NEW:
|
handleTimeItemSelected = item => {
|
||||||
orderBy = ['release_time'];
|
const { setTimeItem } = this.props;
|
||||||
break;
|
setTimeItem(item);
|
||||||
|
this.setState({ showTimePicker: false });
|
||||||
case Constants.SORT_BY_TOP:
|
|
||||||
orderBy = ['effective_amount'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setState({ currentSortByItem: item, orderBy, showSortPicker: false });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
subscriptionForUri = (uri, channelName) => {
|
subscriptionForUri = (uri, channelName) => {
|
||||||
@@ -217,81 +215,136 @@ class DiscoverPage extends React.PureComponent {
|
|||||||
|
|
||||||
// each of the followed tags
|
// each of the followed tags
|
||||||
const tagCollection = _.shuffle(tags)
|
const tagCollection = _.shuffle(tags)
|
||||||
.slice(0, 6)
|
.slice(0, 5)
|
||||||
.map(tag => [tag]);
|
.map(tag => [tag]);
|
||||||
|
|
||||||
|
const usedTags = tagCollection.map(tagList => tagList[0]);
|
||||||
|
const remainingTags = tags.filter(tag => !usedTags.includes(tag));
|
||||||
|
|
||||||
// everything
|
// everything
|
||||||
tagCollection.unshift(tags);
|
tagCollection.unshift(tags);
|
||||||
|
|
||||||
this.setState({ tagCollection });
|
this.setState({ remainingTags, tagCollection });
|
||||||
};
|
};
|
||||||
|
|
||||||
handleTagPress = name => {
|
handleTagPress = name => {
|
||||||
const { navigation } = this.props;
|
const { navigation, sortByItem } = this.props;
|
||||||
if (name.toLowerCase() !== 'trending') {
|
if (name.toLowerCase() !== 'all tags you follow') {
|
||||||
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_TAG, key: `tagPage`, params: { tag: name } });
|
navigation.navigate({
|
||||||
|
routeName: Constants.DRAWER_ROUTE_TAG,
|
||||||
|
key: `tagPage`,
|
||||||
|
params: {
|
||||||
|
tag: name,
|
||||||
|
},
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// navigate to the trending page
|
// navigate to the trending page
|
||||||
navigation.navigate({ routeName: Constants.FULL_ROUTE_NAME_TRENDING });
|
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_TRENDING, params: { filterForTags: true } });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sectionListHeader = () => {
|
||||||
|
const { sortByItem, timeItem } = this.props;
|
||||||
|
return (
|
||||||
|
<View style={discoverStyle.listHeader}>
|
||||||
|
<View style={discoverStyle.titleRow}>
|
||||||
|
<Text style={discoverStyle.pageTitle}>Your tags</Text>
|
||||||
|
</View>
|
||||||
|
<View style={discoverStyle.pickerRow}>
|
||||||
|
<View style={discoverStyle.leftPickerRow}>
|
||||||
|
<TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}>
|
||||||
|
<Text style={discoverStyle.tagSortText}>{sortByItem.label.split(' ')[0]}</Text>
|
||||||
|
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
{Constants.SORT_BY_TOP === sortByItem.name && (
|
||||||
|
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
|
||||||
|
<Text style={discoverStyle.tagSortText}>{timeItem.label}</Text>
|
||||||
|
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Link
|
||||||
|
style={discoverStyle.customizeLink}
|
||||||
|
text={'Customize'}
|
||||||
|
onPress={() => this.setState({ showModalTagSelector: true })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
sectionListFooter = () => {
|
||||||
|
const { remainingTags } = this.state;
|
||||||
|
if (remainingTags.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={discoverStyle.footer}>
|
||||||
|
<Text style={discoverStyle.footerTitle}>More tags you follow</Text>
|
||||||
|
<View style={discoverStyle.footerTags}>
|
||||||
|
{remainingTags.map(tag => (
|
||||||
|
<Text
|
||||||
|
key={tag}
|
||||||
|
style={[discoverStyle.categoryName, discoverStyle.footerTag]}
|
||||||
|
onPress={() => this.handleTagPress(tag)}
|
||||||
|
>
|
||||||
|
{formatTagTitle(tag)}
|
||||||
|
</Text>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
renderSectionListItem = ({ item, index, section }) => (
|
||||||
|
<ClaimList
|
||||||
|
key={item.sort().join(',')}
|
||||||
|
orderBy={this.state.orderBy}
|
||||||
|
time={this.props.timeItem.name}
|
||||||
|
tags={item}
|
||||||
|
morePlaceholder
|
||||||
|
navigation={this.props.navigation}
|
||||||
|
orientation={Constants.ORIENTATION_HORIZONTAL}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
renderSectionHeader = ({ section: { title } }) => (
|
||||||
|
<View style={discoverStyle.categoryTitleRow}>
|
||||||
|
<Text style={discoverStyle.categoryName} onPress={() => this.handleTagPress(title)}>
|
||||||
|
{formatTagTitle(title)}
|
||||||
|
</Text>
|
||||||
|
<TouchableOpacity onPress={() => this.handleTagPress(title)}>
|
||||||
|
<Icon name={'angle-double-down'} size={16} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { navigation } = this.props;
|
const { navigation, sortByItem, timeItem } = this.props;
|
||||||
const { currentSortByItem, orderBy, showModalTagSelector, showSortPicker } = this.state;
|
const { orderBy, showModalTagSelector, showSortPicker, showTimePicker } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={discoverStyle.container}>
|
<View style={discoverStyle.container}>
|
||||||
<UriBar navigation={navigation} belowOverlay={showModalTagSelector} />
|
<UriBar navigation={navigation} belowOverlay={showModalTagSelector} />
|
||||||
<SectionList
|
<SectionList
|
||||||
ListHeaderComponent={
|
ListHeaderComponent={this.sectionListHeader}
|
||||||
<View style={discoverStyle.titleRow}>
|
ListFooterComponent={this.sectionListFooter}
|
||||||
<Text style={discoverStyle.pageTitle}>Explore</Text>
|
|
||||||
<View style={discoverStyle.rightTitleRow}>
|
|
||||||
<Link
|
|
||||||
style={discoverStyle.customizeLink}
|
|
||||||
text={'Customize'}
|
|
||||||
onPress={() => this.setState({ showModalTagSelector: true })}
|
|
||||||
/>
|
|
||||||
<TouchableOpacity
|
|
||||||
style={discoverStyle.tagSortBy}
|
|
||||||
onPress={() => this.setState({ showSortPicker: true })}
|
|
||||||
>
|
|
||||||
<Text style={discoverStyle.tagSortText}>{currentSortByItem.label.split(' ')[0]}</Text>
|
|
||||||
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
|
||||||
</TouchableOpacity>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
}
|
|
||||||
style={discoverStyle.scrollContainer}
|
style={discoverStyle.scrollContainer}
|
||||||
contentContainerStyle={discoverStyle.scrollPadding}
|
contentContainerStyle={discoverStyle.scrollPadding}
|
||||||
initialNumToRender={4}
|
initialNumToRender={4}
|
||||||
maxToRenderPerBatch={4}
|
maxToRenderPerBatch={4}
|
||||||
removeClippedSubviews
|
removeClippedSubviews
|
||||||
renderItem={({ item, index, section }) => (
|
renderItem={this.renderSectionListItem}
|
||||||
<ClaimList
|
renderSectionHeader={this.renderSectionHeader}
|
||||||
key={item.sort().join(',')}
|
|
||||||
orderBy={orderBy}
|
|
||||||
time={Constants.TIME_WEEK}
|
|
||||||
tags={item}
|
|
||||||
morePlaceholder
|
|
||||||
navigation={navigation}
|
|
||||||
orientation={Constants.ORIENTATION_HORIZONTAL}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
renderSectionHeader={({ section: { title } }) => (
|
|
||||||
<View style={discoverStyle.categoryTitleRow}>
|
|
||||||
<Text style={discoverStyle.categoryName} onPress={() => this.handleTagPress(title)}>
|
|
||||||
{formatTagTitle(title)}
|
|
||||||
</Text>
|
|
||||||
<TouchableOpacity onPress={() => this.handleTagPress(title)}>
|
|
||||||
<Icon name={'angle-double-down'} size={16} />
|
|
||||||
</TouchableOpacity>
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
sections={this.buildSections()}
|
sections={this.buildSections()}
|
||||||
keyExtractor={(item, index) => item}
|
keyExtractor={(item, index) => item}
|
||||||
/>
|
/>
|
||||||
{!showModalTagSelector && !showSortPicker && <FloatingWalletBalance navigation={navigation} />}
|
{!showModalTagSelector && !showSortPicker && !showTimePicker && (
|
||||||
|
<FloatingWalletBalance navigation={navigation} />
|
||||||
|
)}
|
||||||
{showModalTagSelector && (
|
{showModalTagSelector && (
|
||||||
<ModalTagSelector
|
<ModalTagSelector
|
||||||
onOverlayPress={() => this.setState({ showModalTagSelector: false })}
|
onOverlayPress={() => this.setState({ showModalTagSelector: false })}
|
||||||
@@ -303,10 +356,19 @@ class DiscoverPage extends React.PureComponent {
|
|||||||
title={__('Sort content by')}
|
title={__('Sort content by')}
|
||||||
onOverlayPress={() => this.setState({ showSortPicker: false })}
|
onOverlayPress={() => this.setState({ showSortPicker: false })}
|
||||||
onItemSelected={this.handleSortByItemSelected}
|
onItemSelected={this.handleSortByItemSelected}
|
||||||
selectedItem={currentSortByItem}
|
selectedItem={sortByItem}
|
||||||
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
|
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{showTimePicker && (
|
||||||
|
<ModalPicker
|
||||||
|
title={__('Content from')}
|
||||||
|
onOverlayPress={() => this.setState({ showTimePicker: false })}
|
||||||
|
onItemSelected={this.handleTimeItemSelected}
|
||||||
|
selectedItem={timeItem}
|
||||||
|
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,32 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
doFileList,
|
doFileList,
|
||||||
|
doFetchClaimListMine,
|
||||||
selectFileInfosDownloaded,
|
selectFileInfosDownloaded,
|
||||||
|
selectDownloadedUris,
|
||||||
selectMyClaimsWithoutChannels,
|
selectMyClaimsWithoutChannels,
|
||||||
|
selectIsFetchingClaimListMine,
|
||||||
selectIsFetchingFileList,
|
selectIsFetchingFileList,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
|
import { doDeleteFile } from 'redux/actions/file';
|
||||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import DownloadsPage from './view';
|
import DownloadsPage from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
claims: selectMyClaimsWithoutChannels(state),
|
claims: selectMyClaimsWithoutChannels(state),
|
||||||
currentRoute: selectCurrentRoute(state),
|
currentRoute: selectCurrentRoute(state),
|
||||||
fileInfos: selectFileInfosDownloaded(state),
|
fileInfos: selectFileInfosDownloaded(state),
|
||||||
fetching: selectIsFetchingFileList(state),
|
downloadedUris: selectDownloadedUris(state),
|
||||||
|
fetching: selectIsFetchingFileList(state) || selectIsFetchingClaimListMine(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
deleteFile: (fileInfo, deleteFromDevice, abandonClaim) => {
|
||||||
|
dispatch(doDeleteFile(fileInfo, deleteFromDevice, abandonClaim));
|
||||||
|
},
|
||||||
|
fetchMyClaims: () => dispatch(doFetchClaimListMine()),
|
||||||
fileList: () => dispatch(doFileList()),
|
fileList: () => dispatch(doFileList()),
|
||||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_MY_LBRY)),
|
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_MY_LBRY)),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
|
|||||||
+138
-30
@@ -1,7 +1,17 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Lbry, buildURI } from 'lbry-redux';
|
import { Lbry, buildURI, normalizeURI } from 'lbry-redux';
|
||||||
import { ActivityIndicator, Button, FlatList, Text, TextInput, View, ScrollView } from 'react-native';
|
import {
|
||||||
import { navigateToUri, uriFromFileInfo } from 'utils/helper';
|
ActivityIndicator,
|
||||||
|
Alert,
|
||||||
|
Button,
|
||||||
|
FlatList,
|
||||||
|
NativeModules,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
View,
|
||||||
|
ScrollView,
|
||||||
|
} from 'react-native';
|
||||||
|
import { __, navigateToUri, uriFromFileInfo } from 'utils/helper';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import PageHeader from 'component/pageHeader';
|
import PageHeader from 'component/pageHeader';
|
||||||
@@ -17,11 +27,17 @@ class DownloadsPage extends React.PureComponent {
|
|||||||
title: 'Downloads',
|
title: 'Downloads',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
state = {
|
||||||
|
selectionMode: false,
|
||||||
|
selectedUris: [],
|
||||||
|
selectedClaimsMap: {},
|
||||||
|
};
|
||||||
|
|
||||||
didFocusListener;
|
didFocusListener;
|
||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -31,9 +47,12 @@ class DownloadsPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
const { fileList, pushDrawerStack, setPlayerVisible } = this.props;
|
const { fetchMyClaims, fileList, pushDrawerStack, setPlayerVisible } = this.props;
|
||||||
pushDrawerStack();
|
pushDrawerStack();
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Library');
|
||||||
|
|
||||||
|
fetchMyClaims();
|
||||||
fileList();
|
fileList();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -44,49 +63,138 @@ class DownloadsPage extends React.PureComponent {
|
|||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { currentRoute } = nextProps;
|
const { currentRoute } = nextProps;
|
||||||
const { currentRoute: prevRoute } = this.props;
|
const { currentRoute: prevRoute } = this.props;
|
||||||
if (Constants.FULL_ROUTE_NAME_MY_LBRY === currentRoute && currentRoute !== prevRoute) {
|
if (Constants.DRAWER_ROUTE_MY_LBRY === currentRoute && currentRoute !== prevRoute) {
|
||||||
this.onComponentFocused();
|
this.onComponentFocused();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFilteredUris = () => {
|
||||||
|
const { claims, downloadedUris } = this.props;
|
||||||
|
const claimUris = claims.map(claim => normalizeURI(`${claim.name}#${claim.claim_id}`));
|
||||||
|
return downloadedUris.filter(uri => !claimUris.includes(uri));
|
||||||
|
};
|
||||||
|
|
||||||
|
getFilteredFileInfos = () => {
|
||||||
|
const { claims, fileInfos } = this.props;
|
||||||
|
const claimUris = claims.map(claim => normalizeURI(`${claim.name}#${claim.claim_id}`));
|
||||||
|
return fileInfos.filter(
|
||||||
|
fileInfo => !claimUris.includes(normalizeURI(`${fileInfo.claim_name}#${fileInfo.claim_id}`))
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
addOrRemoveItem = (uri, claim) => {
|
||||||
|
const { selectedClaimsMap } = this.state;
|
||||||
|
let selectedUris = [...this.state.selectedUris];
|
||||||
|
|
||||||
|
if (selectedUris.includes(uri)) {
|
||||||
|
delete selectedClaimsMap[uri];
|
||||||
|
selectedUris.splice(selectedUris.indexOf(uri), 1);
|
||||||
|
} else {
|
||||||
|
selectedClaimsMap[uri] = claim;
|
||||||
|
selectedUris.push(uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({ selectionMode: selectedUris.length > 0, selectedUris, selectedClaimsMap });
|
||||||
|
};
|
||||||
|
|
||||||
|
handleSelectItem = (uri, claim) => {
|
||||||
|
this.addOrRemoveItem(uri, claim);
|
||||||
|
};
|
||||||
|
|
||||||
|
handleItemLongPress = (uri, claim) => {
|
||||||
|
this.addOrRemoveItem(uri, claim);
|
||||||
|
};
|
||||||
|
|
||||||
|
onExitSelectionMode = () => {
|
||||||
|
this.setState({ selectionMode: false, selectedUris: [], selectedClaimsMap: {} });
|
||||||
|
};
|
||||||
|
|
||||||
|
onDeleteActionPressed = () => {
|
||||||
|
const { deleteFile, fileList } = this.props;
|
||||||
|
const { selectedClaimsMap } = this.state;
|
||||||
|
|
||||||
|
// show confirm alert
|
||||||
|
Alert.alert(
|
||||||
|
__('Delete files'),
|
||||||
|
__('Are you sure you want to delete the selected content?'),
|
||||||
|
[
|
||||||
|
{ text: __('No') },
|
||||||
|
{
|
||||||
|
text: __('Yes'),
|
||||||
|
onPress: () => {
|
||||||
|
const uris = Object.keys(selectedClaimsMap);
|
||||||
|
uris.forEach(uri => {
|
||||||
|
const { txid, nout } = selectedClaimsMap[uri];
|
||||||
|
deleteFile(`${txid}:${nout}`, true);
|
||||||
|
});
|
||||||
|
this.onExitSelectionMode();
|
||||||
|
fileList();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
{
|
||||||
|
cancelable: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { fetching, fileInfos, navigation } = this.props;
|
const { fetching, claims, downloadedUris, fileInfos, navigation } = this.props;
|
||||||
const hasDownloads = fileInfos && Object.values(fileInfos).length > 0;
|
const { selectionMode, selectedUris } = this.state;
|
||||||
|
const filteredUris = this.getFilteredUris();
|
||||||
|
const hasDownloads = filteredUris && filteredUris.length > 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={downloadsStyle.container}>
|
<View style={downloadsStyle.container}>
|
||||||
<UriBar navigation={navigation} />
|
<UriBar
|
||||||
{!fetching && !hasDownloads && (
|
navigation={navigation}
|
||||||
<View style={downloadsStyle.busyContainer}>
|
selectionMode={selectionMode}
|
||||||
<Text style={downloadsStyle.noDownloadsText}>
|
selectedItemCount={selectedUris.length}
|
||||||
You have not watched or downloaded any content from LBRY yet.
|
onExitSelectionMode={this.onExitSelectionMode}
|
||||||
</Text>
|
onDeleteActionPressed={this.onDeleteActionPressed}
|
||||||
</View>
|
/>
|
||||||
)}
|
|
||||||
{fetching && !hasDownloads && (
|
<View style={downloadsStyle.subContainer}>
|
||||||
<View style={downloadsStyle.busyContainer}>
|
{hasDownloads && <StorageStatsCard fileInfos={this.getFilteredFileInfos()} />}
|
||||||
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={downloadsStyle.loading} />
|
{fetching && (
|
||||||
</View>
|
<View style={downloadsStyle.busyContainer}>
|
||||||
)}
|
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={downloadsStyle.loading} />
|
||||||
{hasDownloads && (
|
</View>
|
||||||
<View style={downloadsStyle.subContainer}>
|
)}
|
||||||
<StorageStatsCard fileInfos={fileInfos} />
|
{!fetching && !hasDownloads && (
|
||||||
|
<View style={downloadsStyle.busyContainer}>
|
||||||
|
<Text style={downloadsStyle.noDownloadsText}>You do not have any downloaded content on this device.</Text>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
{!fetching && hasDownloads && (
|
||||||
<FlatList
|
<FlatList
|
||||||
|
extraData={this.state}
|
||||||
style={downloadsStyle.scrollContainer}
|
style={downloadsStyle.scrollContainer}
|
||||||
contentContainerStyle={downloadsStyle.scrollPadding}
|
contentContainerStyle={downloadsStyle.scrollPadding}
|
||||||
renderItem={({ item }) => (
|
renderItem={({ item }) => (
|
||||||
<FileListItem
|
<FileListItem
|
||||||
|
autoplay
|
||||||
|
key={item}
|
||||||
|
uri={item}
|
||||||
style={fileListStyle.item}
|
style={fileListStyle.item}
|
||||||
uri={uriFromFileInfo(item)}
|
selected={selectedUris.includes(item)}
|
||||||
|
onPress={claim => {
|
||||||
|
if (selectionMode) {
|
||||||
|
this.handleSelectItem(item, claim);
|
||||||
|
} else {
|
||||||
|
// TODO: when shortUrl is available for my claims, navigate to that URL instead
|
||||||
|
navigateToUri(navigation, item, { autoplay: true });
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onLongPress={claim => this.handleItemLongPress(item, claim)}
|
||||||
navigation={navigation}
|
navigation={navigation}
|
||||||
onPress={() => navigateToUri(navigation, uriFromFileInfo(item), { autoplay: true })}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
data={fileInfos}
|
data={downloadedUris}
|
||||||
keyExtractor={(item, index) => item.outpoint}
|
keyExtractor={(item, index) => item}
|
||||||
/>
|
/>
|
||||||
</View>
|
)}
|
||||||
)}
|
</View>
|
||||||
<FloatingWalletBalance navigation={navigation} />
|
<FloatingWalletBalance navigation={navigation} />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
+14
-4
@@ -1,6 +1,8 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
doFetchFileInfo,
|
doFetchFileInfo,
|
||||||
|
doFetchChannelListMine,
|
||||||
|
doFetchClaimListMine,
|
||||||
doFileGet,
|
doFileGet,
|
||||||
doPurchaseUri,
|
doPurchaseUri,
|
||||||
doDeletePurchasedUri,
|
doDeletePurchasedUri,
|
||||||
@@ -18,11 +20,14 @@ import {
|
|||||||
makeSelectThumbnailForUri,
|
makeSelectThumbnailForUri,
|
||||||
makeSelectTitleForUri,
|
makeSelectTitleForUri,
|
||||||
selectBalance,
|
selectBalance,
|
||||||
|
selectMyChannelClaims,
|
||||||
|
selectMyClaimUrisWithoutChannels,
|
||||||
selectPurchasedUris,
|
selectPurchasedUris,
|
||||||
selectFailedPurchaseUris,
|
selectFailedPurchaseUris,
|
||||||
selectPurchaseUriErrorMessage,
|
selectPurchaseUriErrorMessage,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import {
|
import {
|
||||||
|
doClaimEligiblePurchaseRewards,
|
||||||
doFetchCostInfoForUri,
|
doFetchCostInfoForUri,
|
||||||
makeSelectCostInfoForUri,
|
makeSelectCostInfoForUri,
|
||||||
selectRewardContentClaimIds,
|
selectRewardContentClaimIds,
|
||||||
@@ -44,20 +49,22 @@ const select = (state, props) => {
|
|||||||
return {
|
return {
|
||||||
balance: selectBalance(state),
|
balance: selectBalance(state),
|
||||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||||
|
channels: selectMyChannelClaims(state),
|
||||||
claim: makeSelectClaimForUri(selectProps.uri)(state),
|
claim: makeSelectClaimForUri(selectProps.uri)(state),
|
||||||
drawerStack: selectDrawerStack(state),
|
drawerStack: selectDrawerStack(state),
|
||||||
isResolvingUri: makeSelectIsUriResolving(selectProps.uri)(state),
|
isResolvingUri: makeSelectIsUriResolving(selectProps.uri)(state),
|
||||||
contentType: makeSelectContentTypeForUri(selectProps.uri)(state),
|
contentType: makeSelectContentTypeForUri(selectProps.uri)(state),
|
||||||
costInfo: makeSelectCostInfoForUri(selectProps.uri)(state),
|
costInfo: makeSelectCostInfoForUri(selectProps.uri)(state),
|
||||||
metadata: makeSelectMetadataForUri(selectProps.uri)(state),
|
metadata: makeSelectMetadataForUri(selectProps.uri)(state),
|
||||||
//obscureNsfw: !selectShowNsfw(state),
|
// obscureNsfw: !selectShowNsfw(state),
|
||||||
//tab: makeSelectCurrentParam('tab')(state),
|
// tab: makeSelectCurrentParam('tab')(state),
|
||||||
fileInfo: makeSelectFileInfoForUri(selectProps.uri)(state),
|
fileInfo: makeSelectFileInfoForUri(selectProps.uri)(state),
|
||||||
rewardedContentClaimIds: selectRewardContentClaimIds(state, selectProps),
|
rewardedContentClaimIds: selectRewardContentClaimIds(state, selectProps),
|
||||||
channelUri: makeSelectChannelForClaimUri(selectProps.uri, true)(state),
|
channelUri: makeSelectChannelForClaimUri(selectProps.uri, true)(state),
|
||||||
position: makeSelectContentPositionForUri(selectProps.uri)(state),
|
position: makeSelectContentPositionForUri(selectProps.uri)(state),
|
||||||
purchasedUris: selectPurchasedUris(state),
|
purchasedUris: selectPurchasedUris(state),
|
||||||
failedPurchaseUris: selectFailedPurchaseUris(state),
|
failedPurchaseUris: selectFailedPurchaseUris(state),
|
||||||
|
myClaimUris: selectMyClaimUrisWithoutChannels(state),
|
||||||
purchaseUriErrorMessage: selectPurchaseUriErrorMessage(state),
|
purchaseUriErrorMessage: selectPurchaseUriErrorMessage(state),
|
||||||
streamingUrl: makeSelectStreamingUrlForUri(selectProps.uri)(state),
|
streamingUrl: makeSelectStreamingUrlForUri(selectProps.uri)(state),
|
||||||
thumbnail: makeSelectThumbnailForUri(selectProps.uri)(state),
|
thumbnail: makeSelectThumbnailForUri(selectProps.uri)(state),
|
||||||
@@ -66,19 +73,22 @@ const select = (state, props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
claimEligibleRewards: () => dispatch(doClaimEligiblePurchaseRewards()),
|
||||||
deleteFile: (fileInfo, deleteFromDevice, abandonClaim) => {
|
deleteFile: (fileInfo, deleteFromDevice, abandonClaim) => {
|
||||||
dispatch(doDeleteFile(fileInfo, deleteFromDevice, abandonClaim));
|
dispatch(doDeleteFile(fileInfo, deleteFromDevice, abandonClaim));
|
||||||
},
|
},
|
||||||
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
||||||
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
||||||
|
fetchMyClaims: () => dispatch(doFetchClaimListMine()),
|
||||||
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||||
fileGet: (uri, saveFile) => dispatch(doFileGet(uri, saveFile)),
|
fileGet: (uri, saveFile) => dispatch(doFileGet(uri, saveFile)),
|
||||||
notify: data => dispatch(doToast(data)),
|
notify: data => dispatch(doToast(data)),
|
||||||
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
||||||
purchaseUri: (uri, costInfo, saveFile) => dispatch(doPurchaseUri(uri, costInfo, saveFile)),
|
purchaseUri: (uri, costInfo, saveFile) => dispatch(doPurchaseUri(uri, costInfo, saveFile)),
|
||||||
deletePurchasedUri: uri => dispatch(doDeletePurchasedUri(uri)),
|
deletePurchasedUri: uri => dispatch(doDeletePurchasedUri(uri)),
|
||||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||||
sendTip: (amount, claimId, uri, successCallback, errorCallback) =>
|
sendTip: (amount, claimId, isSupport, successCallback, errorCallback) =>
|
||||||
dispatch(doSendTip(amount, claimId, uri, successCallback, errorCallback)),
|
dispatch(doSendTip(amount, claimId, isSupport, successCallback, errorCallback)),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(true)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(true)),
|
||||||
stopDownload: (uri, fileInfo) => dispatch(doStopDownloadingFile(uri, fileInfo)),
|
stopDownload: (uri, fileInfo) => dispatch(doStopDownloadingFile(uri, fileInfo)),
|
||||||
startDownload: (uri, outpoint, fileInfo) => dispatch(doStartDownload(uri, outpoint, fileInfo)),
|
startDownload: (uri, outpoint, fileInfo) => dispatch(doStartDownload(uri, outpoint, fileInfo)),
|
||||||
|
|||||||
+93
-25
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Lbry, normalizeURI } from 'lbry-redux';
|
import { Lbry, normalizeURI, parseURI } from 'lbry-redux';
|
||||||
import { Lbryio } from 'lbryinc';
|
import { Lbryio } from 'lbryinc';
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
@@ -70,6 +70,7 @@ class FilePage extends React.PureComponent {
|
|||||||
mediaLoaded: false,
|
mediaLoaded: false,
|
||||||
pageSuspended: false,
|
pageSuspended: false,
|
||||||
relatedContentY: 0,
|
relatedContentY: 0,
|
||||||
|
sendTipStarted: false,
|
||||||
showDescription: false,
|
showDescription: false,
|
||||||
showImageViewer: false,
|
showImageViewer: false,
|
||||||
showWebView: false,
|
showWebView: false,
|
||||||
@@ -88,17 +89,18 @@ class FilePage extends React.PureComponent {
|
|||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
StatusBar.setHidden(false);
|
StatusBar.setHidden(false);
|
||||||
|
NativeModules.Firebase.setCurrentScreen('File');
|
||||||
|
|
||||||
DeviceEventEmitter.addListener('onDownloadStarted', this.handleDownloadStarted);
|
DeviceEventEmitter.addListener('onDownloadStarted', this.handleDownloadStarted);
|
||||||
DeviceEventEmitter.addListener('onDownloadUpdated', this.handleDownloadUpdated);
|
DeviceEventEmitter.addListener('onDownloadUpdated', this.handleDownloadUpdated);
|
||||||
DeviceEventEmitter.addListener('onDownloadCompleted', this.handleDownloadCompleted);
|
DeviceEventEmitter.addListener('onDownloadCompleted', this.handleDownloadCompleted);
|
||||||
|
|
||||||
const { fileInfo, isResolvingUri, resolveUri, navigation } = this.props;
|
const { fetchChannelListMine, fileInfo, isResolvingUri, resolveUri, navigation } = this.props;
|
||||||
const { uri, uriVars } = navigation.state.params;
|
const { uri, uriVars } = navigation.state.params;
|
||||||
this.setState({ uri, uriVars });
|
this.setState({ uri, uriVars });
|
||||||
|
|
||||||
@@ -106,6 +108,7 @@ class FilePage extends React.PureComponent {
|
|||||||
|
|
||||||
this.fetchFileInfo(this.props);
|
this.fetchFileInfo(this.props);
|
||||||
this.fetchCostInfo(this.props);
|
this.fetchCostInfo(this.props);
|
||||||
|
fetchChannelListMine();
|
||||||
|
|
||||||
if (NativeModules.Firebase) {
|
if (NativeModules.Firebase) {
|
||||||
NativeModules.Firebase.track('open_file_page', { uri: uri });
|
NativeModules.Firebase.track('open_file_page', { uri: uri });
|
||||||
@@ -230,6 +233,11 @@ class FilePage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onEditPressed = () => {
|
||||||
|
const { claim, navigation } = this.props;
|
||||||
|
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_PUBLISH, params: { editMode: true, claimToEdit: claim } });
|
||||||
|
};
|
||||||
|
|
||||||
onDeletePressed = () => {
|
onDeletePressed = () => {
|
||||||
const { claim, deleteFile, deletePurchasedUri, fileInfo, navigation } = this.props;
|
const { claim, deleteFile, deletePurchasedUri, fileInfo, navigation } = this.props;
|
||||||
|
|
||||||
@@ -242,11 +250,11 @@ class FilePage extends React.PureComponent {
|
|||||||
text: 'Yes',
|
text: 'Yes',
|
||||||
onPress: () => {
|
onPress: () => {
|
||||||
const { uri } = navigation.state.params;
|
const { uri } = navigation.state.params;
|
||||||
|
|
||||||
deleteFile(`${claim.txid}:${claim.nout}`, true);
|
deleteFile(`${claim.txid}:${claim.nout}`, true);
|
||||||
deletePurchasedUri(uri);
|
deletePurchasedUri(uri);
|
||||||
if (NativeModules.UtilityModule) {
|
|
||||||
NativeModules.UtilityModule.deleteDownload(uri);
|
NativeModules.UtilityModule.deleteDownload(uri);
|
||||||
}
|
|
||||||
this.setState({
|
this.setState({
|
||||||
downloadPressed: false,
|
downloadPressed: false,
|
||||||
fileViewLogged: false,
|
fileViewLogged: false,
|
||||||
@@ -470,6 +478,7 @@ class FilePage extends React.PureComponent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { claimEligibleRewards } = this.props;
|
||||||
const { nout, claim_id: claimId, txid } = claim;
|
const { nout, claim_id: claimId, txid } = claim;
|
||||||
const outpoint = `${txid}:${nout}`;
|
const outpoint = `${txid}:${nout}`;
|
||||||
const params = {
|
const params = {
|
||||||
@@ -481,7 +490,9 @@ class FilePage extends React.PureComponent {
|
|||||||
params.time_to_start = timeToStart;
|
params.time_to_start = timeToStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
Lbryio.call('file', 'view', params).catch(() => {});
|
Lbryio.call('file', 'view', params)
|
||||||
|
.then(() => claimEligibleRewards())
|
||||||
|
.catch(() => {});
|
||||||
this.setState({ fileViewLogged: true });
|
this.setState({ fileViewLogged: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -497,9 +508,25 @@ class FilePage extends React.PureComponent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendTip(tipAmount, claim.claim_id, uri, () => {
|
const suffix = 'credit' + (parseInt(tipAmount, 10) === 1 ? '' : 's');
|
||||||
this.setState({ tipAmount: 0, showTipView: false });
|
Alert.alert(
|
||||||
});
|
'Send tip',
|
||||||
|
`Are you sure you want to tip ${tipAmount} ${suffix}?`,
|
||||||
|
[
|
||||||
|
{ text: 'No' },
|
||||||
|
{
|
||||||
|
text: 'Yes',
|
||||||
|
onPress: () => {
|
||||||
|
this.setState({ sendTipStarted: true }, () =>
|
||||||
|
sendTip(tipAmount, claim.claim_id, false, () => {
|
||||||
|
this.setState({ tipAmount: null, showTipView: false, sendTipStarted: false });
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
{ cancelable: true }
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
renderTags = tags => {
|
renderTags = tags => {
|
||||||
@@ -544,6 +571,7 @@ class FilePage extends React.PureComponent {
|
|||||||
const {
|
const {
|
||||||
balance,
|
balance,
|
||||||
claim,
|
claim,
|
||||||
|
channels,
|
||||||
channelUri,
|
channelUri,
|
||||||
costInfo,
|
costInfo,
|
||||||
fileInfo,
|
fileInfo,
|
||||||
@@ -553,6 +581,7 @@ class FilePage extends React.PureComponent {
|
|||||||
rewardedContentClaimIds,
|
rewardedContentClaimIds,
|
||||||
isResolvingUri,
|
isResolvingUri,
|
||||||
blackListedOutpoints,
|
blackListedOutpoints,
|
||||||
|
myClaimUris,
|
||||||
navigation,
|
navigation,
|
||||||
position,
|
position,
|
||||||
purchaseUri,
|
purchaseUri,
|
||||||
@@ -561,6 +590,10 @@ class FilePage extends React.PureComponent {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const { uri, autoplay } = navigation.state.params;
|
const { uri, autoplay } = navigation.state.params;
|
||||||
|
|
||||||
|
const myChannelUris = channels ? channels.map(channel => channel.permanent_url) : [];
|
||||||
|
const ownedClaim = myClaimUris.includes(uri) || myChannelUris.includes(uri);
|
||||||
|
const { isChannel } = parseURI(uri);
|
||||||
|
|
||||||
let innerContent = null;
|
let innerContent = null;
|
||||||
if ((isResolvingUri && !claim) || !claim) {
|
if ((isResolvingUri && !claim) || !claim) {
|
||||||
return (
|
return (
|
||||||
@@ -573,7 +606,14 @@ class FilePage extends React.PureComponent {
|
|||||||
)}
|
)}
|
||||||
{claim === null && !isResolvingUri && (
|
{claim === null && !isResolvingUri && (
|
||||||
<View style={filePageStyle.container}>
|
<View style={filePageStyle.container}>
|
||||||
<Text style={filePageStyle.emptyClaimText}>There's nothing at this location.</Text>
|
{ownedClaim && (
|
||||||
|
<Text style={filePageStyle.emptyClaimText}>
|
||||||
|
{isChannel
|
||||||
|
? 'It looks like you just created this channel. It will appear in a few minutes.'
|
||||||
|
: 'It looks you just published this content. It will appear in a few minutes.'}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
{!ownedClaim && <Text style={filePageStyle.emptyClaimText}>There's nothing at this location.</Text>}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
<UriBar value={uri} navigation={navigation} />
|
<UriBar value={uri} navigation={navigation} />
|
||||||
@@ -582,7 +622,7 @@ class FilePage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (claim) {
|
if (claim) {
|
||||||
if (claim && claim.name.length && claim.name[0] === '@') {
|
if (isChannel) {
|
||||||
return <ChannelPage uri={uri} navigation={navigation} />;
|
return <ChannelPage uri={uri} navigation={navigation} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -625,20 +665,25 @@ class FilePage extends React.PureComponent {
|
|||||||
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||||
const { height, signing_channel: signingChannel, value } = claim;
|
const { height, signing_channel: signingChannel, value } = claim;
|
||||||
const channelName = signingChannel && signingChannel.name;
|
const channelName = signingChannel && signingChannel.name;
|
||||||
|
const channelClaimId = claim && claim.signing_channel && claim.signing_channel.claim_id;
|
||||||
|
const canSendTip = this.state.tipAmount > 0;
|
||||||
|
const fullUri = `${claim.name}#${claim.claim_id}`;
|
||||||
|
const canEdit = myClaimUris.includes(normalizeURI(fullUri));
|
||||||
const showActions =
|
const showActions =
|
||||||
fileInfo &&
|
(canEdit || (fileInfo && fileInfo.download_path)) &&
|
||||||
fileInfo.download_path &&
|
|
||||||
!this.state.fullscreenMode &&
|
!this.state.fullscreenMode &&
|
||||||
!this.state.showImageViewer &&
|
!this.state.showImageViewer &&
|
||||||
!this.state.showWebView;
|
!this.state.showWebView;
|
||||||
const showFileActions =
|
const showFileActions =
|
||||||
fileInfo &&
|
canEdit ||
|
||||||
fileInfo.download_path &&
|
(fileInfo &&
|
||||||
(completed || (fileInfo && !fileInfo.stopped && fileInfo.written_bytes < fileInfo.total_bytes));
|
fileInfo.download_path &&
|
||||||
const channelClaimId = claim && claim.signing_channel && claim.signing_channel.claim_id;
|
(completed || (fileInfo && !fileInfo.stopped && fileInfo.written_bytes < fileInfo.total_bytes)));
|
||||||
const canSendTip = this.state.tipAmount > 0;
|
|
||||||
const fullChannelUri =
|
const fullChannelUri =
|
||||||
channelClaimId && channelClaimId.trim().length > 0 ? `${channelName}#${channelClaimId}` : channelName;
|
channelClaimId && channelClaimId.trim().length > 0
|
||||||
|
? normalizeURI(`${channelName}#${channelClaimId}`)
|
||||||
|
: normalizeURI(channelName);
|
||||||
|
const shortChannelUri = signingChannel ? signingChannel.short_url : null;
|
||||||
|
|
||||||
const playerStyle = [
|
const playerStyle = [
|
||||||
filePageStyle.player,
|
filePageStyle.player,
|
||||||
@@ -654,6 +699,7 @@ class FilePage extends React.PureComponent {
|
|||||||
const canLoadMedia =
|
const canLoadMedia =
|
||||||
this.state.streamingMode ||
|
this.state.streamingMode ||
|
||||||
(fileInfo && (fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes === fileInfo.total_bytes)); // 2MB = 1024*1024*2
|
(fileInfo && (fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes === fileInfo.total_bytes)); // 2MB = 1024*1024*2
|
||||||
|
const duration = claim && claim.value && claim.value.video ? claim.value.video.duration : null;
|
||||||
const isViewable = mediaType === 'image' || mediaType === 'text';
|
const isViewable = mediaType === 'image' || mediaType === 'text';
|
||||||
const isWebViewable = mediaType === 'text';
|
const isWebViewable = mediaType === 'text';
|
||||||
const canOpen = isViewable && completed;
|
const canOpen = isViewable && completed;
|
||||||
@@ -721,7 +767,12 @@ class FilePage extends React.PureComponent {
|
|||||||
>
|
>
|
||||||
<View style={filePageStyle.mediaContainer}>
|
<View style={filePageStyle.mediaContainer}>
|
||||||
{(canOpen || (!fileInfo || (isPlayable && !canLoadMedia)) || (!canOpen && fileInfo)) && (
|
{(canOpen || (!fileInfo || (isPlayable && !canLoadMedia)) || (!canOpen && fileInfo)) && (
|
||||||
<FileItemMedia style={filePageStyle.thumbnail} title={title} thumbnail={thumbnail} />
|
<FileItemMedia
|
||||||
|
duration={duration}
|
||||||
|
style={filePageStyle.thumbnail}
|
||||||
|
title={title}
|
||||||
|
thumbnail={thumbnail}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{(!this.state.downloadButtonShown || this.state.downloadPressed) && !this.state.mediaLoaded && (
|
{(!this.state.downloadButtonShown || this.state.downloadPressed) && !this.state.mediaLoaded && (
|
||||||
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={filePageStyle.loading} />
|
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={filePageStyle.loading} />
|
||||||
@@ -798,6 +849,16 @@ class FilePage extends React.PureComponent {
|
|||||||
<View style={filePageStyle.actions}>
|
<View style={filePageStyle.actions}>
|
||||||
{showFileActions && (
|
{showFileActions && (
|
||||||
<View style={filePageStyle.fileActions}>
|
<View style={filePageStyle.fileActions}>
|
||||||
|
{canEdit && (
|
||||||
|
<Button
|
||||||
|
style={[filePageStyle.actionButton, filePageStyle.editButton]}
|
||||||
|
theme={'light'}
|
||||||
|
icon={'edit'}
|
||||||
|
text={'Edit'}
|
||||||
|
onPress={this.onEditPressed}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{completed && (
|
{completed && (
|
||||||
<Button
|
<Button
|
||||||
style={filePageStyle.actionButton}
|
style={filePageStyle.actionButton}
|
||||||
@@ -840,6 +901,7 @@ class FilePage extends React.PureComponent {
|
|||||||
<Text style={filePageStyle.title} selectable>
|
<Text style={filePageStyle.title} selectable>
|
||||||
{title}
|
{title}
|
||||||
</Text>
|
</Text>
|
||||||
|
{isRewardContent && <Icon name="award" style={filePageStyle.rewardIcon} size={16} />}
|
||||||
<View style={filePageStyle.descriptionToggle}>
|
<View style={filePageStyle.descriptionToggle}>
|
||||||
<Icon name={this.state.showDescription ? 'caret-up' : 'caret-down'} size={24} />
|
<Icon name={this.state.showDescription ? 'caret-up' : 'caret-down'} size={24} />
|
||||||
</View>
|
</View>
|
||||||
@@ -855,7 +917,7 @@ class FilePage extends React.PureComponent {
|
|||||||
numberOfLines={1}
|
numberOfLines={1}
|
||||||
ellipsizeMode={'tail'}
|
ellipsizeMode={'tail'}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
navigateToUri(navigation, normalizeURI(fullChannelUri));
|
navigateToUri(navigation, normalizeURI(shortChannelUri || fullChannelUri));
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -911,15 +973,19 @@ class FilePage extends React.PureComponent {
|
|||||||
<View style={filePageStyle.row}>
|
<View style={filePageStyle.row}>
|
||||||
<View style={filePageStyle.amountRow}>
|
<View style={filePageStyle.amountRow}>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
editable={!this.state.sendTipStarted}
|
||||||
ref={ref => (this.tipAmountInput = ref)}
|
ref={ref => (this.tipAmountInput = ref)}
|
||||||
onChangeText={value => this.setState({ tipAmount: value })}
|
onChangeText={value => this.setState({ tipAmount: value })}
|
||||||
|
underlineColorAndroid={Colors.NextLbryGreen}
|
||||||
keyboardType={'numeric'}
|
keyboardType={'numeric'}
|
||||||
placeholder={'0'}
|
placeholder={'0'}
|
||||||
value={this.state.tipAmount}
|
value={this.state.tipAmount}
|
||||||
|
selectTextOnFocus
|
||||||
style={[filePageStyle.input, filePageStyle.tipAmountInput]}
|
style={[filePageStyle.input, filePageStyle.tipAmountInput]}
|
||||||
/>
|
/>
|
||||||
<Text style={[filePageStyle.text, filePageStyle.currency]}>LBC</Text>
|
<Text style={[filePageStyle.text, filePageStyle.currency]}>LBC</Text>
|
||||||
</View>
|
</View>
|
||||||
|
{this.state.sendTipStarted && <ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />}
|
||||||
<Link
|
<Link
|
||||||
style={[filePageStyle.link, filePageStyle.cancelTipLink]}
|
style={[filePageStyle.link, filePageStyle.cancelTipLink]}
|
||||||
text={'Cancel'}
|
text={'Cancel'}
|
||||||
@@ -928,7 +994,7 @@ class FilePage extends React.PureComponent {
|
|||||||
<Button
|
<Button
|
||||||
text={'Send a tip'}
|
text={'Send a tip'}
|
||||||
style={[filePageStyle.button, filePageStyle.sendButton]}
|
style={[filePageStyle.button, filePageStyle.sendButton]}
|
||||||
disabled={!canSendTip}
|
disabled={!canSendTip || this.state.sendTipStarted}
|
||||||
onPress={this.handleSendTip}
|
onPress={this.handleSendTip}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
@@ -952,10 +1018,12 @@ class FilePage extends React.PureComponent {
|
|||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{costInfo && parseFloat(costInfo.cost) > balance && <FileRewardsDriver navigation={navigation} />}
|
{costInfo && parseFloat(costInfo.cost) > balance && !fileInfo && (
|
||||||
|
<FileRewardsDriver navigation={navigation} />
|
||||||
|
)}
|
||||||
|
|
||||||
<View onLayout={this.setRelatedContentPosition} />
|
<View onLayout={this.setRelatedContentPosition} />
|
||||||
<RelatedContent navigation={navigation} uri={uri} />
|
<RelatedContent navigation={navigation} uri={uri} fullUri={fullUri} />
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const perform = dispatch => ({
|
|||||||
syncApply: (hash, data, password) => dispatch(doSyncApply(hash, data, password)),
|
syncApply: (hash, data, password) => dispatch(doSyncApply(hash, data, password)),
|
||||||
getSync: password => dispatch(doGetSync(password)),
|
getSync: password => dispatch(doGetSync(password)),
|
||||||
checkSync: () => dispatch(doCheckSync()),
|
checkSync: () => dispatch(doCheckSync()),
|
||||||
setDefaultAccount: () => dispatch(doSetDefaultAccount()),
|
setDefaultAccount: (success, failure) => dispatch(doSetDefaultAccount(success, failure)),
|
||||||
notify: data => dispatch(doToast(data)),
|
notify: data => dispatch(doToast(data)),
|
||||||
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
|
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
|
||||||
});
|
});
|
||||||
|
|||||||
+31
-16
@@ -4,7 +4,7 @@ import { ActivityIndicator, Linking, NativeModules, Text, TouchableOpacity, View
|
|||||||
import { NavigationActions, StackActions } from 'react-navigation';
|
import { NavigationActions, StackActions } from 'react-navigation';
|
||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import WalletPage from './internal/wallet-page';
|
import WalletPage from './internal/wallet-page';
|
||||||
import WelcomePage from './internal/welcome-page';
|
import WelcomePage from './internal/welcome-page';
|
||||||
import EmailCollectPage from './internal/email-collect-page';
|
import EmailCollectPage from './internal/email-collect-page';
|
||||||
@@ -33,7 +33,7 @@ class FirstRunScreen extends React.PureComponent {
|
|||||||
isEmailVerified: false,
|
isEmailVerified: false,
|
||||||
skipAccountConfirmed: false,
|
skipAccountConfirmed: false,
|
||||||
showBottomContainer: false,
|
showBottomContainer: false,
|
||||||
walletPassword: null,
|
walletPassword: '',
|
||||||
syncApplyStarted: false,
|
syncApplyStarted: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -51,6 +51,7 @@ class FirstRunScreen extends React.PureComponent {
|
|||||||
this.setState({ isFirstRun: firstRun });
|
this.setState({ isFirstRun: firstRun });
|
||||||
|
|
||||||
if (firstRun) {
|
if (firstRun) {
|
||||||
|
NativeModules.Firebase.setCurrentScreen('First Run');
|
||||||
this.setState({ currentPage: FirstRunScreen.pages[0] });
|
this.setState({ currentPage: FirstRunScreen.pages[0] });
|
||||||
} else {
|
} else {
|
||||||
// Not the first run. Navigate to the splash screen right away
|
// Not the first run. Navigate to the splash screen right away
|
||||||
@@ -73,6 +74,7 @@ class FirstRunScreen extends React.PureComponent {
|
|||||||
notify({ message: String(emailNewErrorMessage), isError: true });
|
notify({ message: String(emailNewErrorMessage), isError: true });
|
||||||
} else {
|
} else {
|
||||||
// Request successful. Navigate to email verify page.
|
// Request successful. Navigate to email verify page.
|
||||||
|
NativeModules.Firebase.track('email_added', { email: this.state.email });
|
||||||
this.showPage(Constants.FIRST_RUN_PAGE_EMAIL_VERIFY);
|
this.showPage(Constants.FIRST_RUN_PAGE_EMAIL_VERIFY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,12 +86,25 @@ class FirstRunScreen extends React.PureComponent {
|
|||||||
this.setState({ showBottomContainer: true });
|
this.setState({ showBottomContainer: true });
|
||||||
} else {
|
} else {
|
||||||
// password successfully verified
|
// password successfully verified
|
||||||
if (NativeModules.UtilityModule) {
|
NativeModules.UtilityModule.setSecureValue(Constants.KEY_FIRST_RUN_PASSWORD, this.state.walletPassword);
|
||||||
NativeModules.UtilityModule.setSecureValue(Constants.KEY_FIRST_RUN_PASSWORD, this.state.walletPassword);
|
setDefaultAccount(
|
||||||
}
|
() => {
|
||||||
setDefaultAccount();
|
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
|
||||||
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
|
|
||||||
this.closeFinalPage();
|
// unlock the wallet
|
||||||
|
Lbry.account_unlock({ password: this.state.walletPassword ? this.state.walletPassword : '' })
|
||||||
|
.then(() => this.closeFinalPage())
|
||||||
|
.catch(err =>
|
||||||
|
notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' })
|
||||||
|
);
|
||||||
|
},
|
||||||
|
err => {
|
||||||
|
notify({
|
||||||
|
message:
|
||||||
|
'The account restore operation could not be completed successfully. Please restart the app and try again.',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +243,7 @@ class FirstRunScreen extends React.PureComponent {
|
|||||||
|
|
||||||
onEmailChanged = email => {
|
onEmailChanged = email => {
|
||||||
this.setState({ email });
|
this.setState({ email });
|
||||||
if (Constants.FIRST_RUN_PAGE_EMAIL_COLLECT == this.state.currentPage) {
|
if (Constants.FIRST_RUN_PAGE_EMAIL_COLLECT === this.state.currentPage) {
|
||||||
this.setState({ showSkip: !email || email.trim().length === 0 });
|
this.setState({ showSkip: !email || email.trim().length === 0 });
|
||||||
} else {
|
} else {
|
||||||
this.setState({ showSkip: false });
|
this.setState({ showSkip: false });
|
||||||
@@ -236,14 +251,14 @@ class FirstRunScreen extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onEmailViewLayout = phase => {
|
onEmailViewLayout = phase => {
|
||||||
if ('collect' === phase) {
|
if (phase === 'collect') {
|
||||||
if (!this.state.emailCollectTracked) {
|
if (!this.state.emailCollectTracked) {
|
||||||
// we only want to track this once
|
// we only want to track this once
|
||||||
this.setState({ emailCollectTracked: true }, () =>
|
this.setState({ emailCollectTracked: true }, () =>
|
||||||
NativeModules.Firebase.track('first_run_email_collect', null)
|
NativeModules.Firebase.track('first_run_email_collect', null)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if ('verify' === phase) {
|
} else if (phase === 'verify') {
|
||||||
NativeModules.Firebase.track('first_run_email_verify', null);
|
NativeModules.Firebase.track('first_run_email_verify', null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,7 +266,7 @@ class FirstRunScreen extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onWalletPasswordChanged = password => {
|
onWalletPasswordChanged = password => {
|
||||||
this.setState({ walletPassword: password });
|
this.setState({ walletPassword: password !== null ? password : '' });
|
||||||
};
|
};
|
||||||
|
|
||||||
onWalletViewLayout = () => {
|
onWalletViewLayout = () => {
|
||||||
@@ -402,10 +417,10 @@ class FirstRunScreen extends React.PureComponent {
|
|||||||
|
|
||||||
{Constants.FIRST_RUN_PAGE_SKIP_ACCOUNT !== this.state.currentPage &&
|
{Constants.FIRST_RUN_PAGE_SKIP_ACCOUNT !== this.state.currentPage &&
|
||||||
Constants.FIRST_RUN_PAGE_EMAIL_VERIFY !== this.state.currentPage && (
|
Constants.FIRST_RUN_PAGE_EMAIL_VERIFY !== this.state.currentPage && (
|
||||||
<Text style={firstRunStyle.buttonText}>
|
<Text style={firstRunStyle.buttonText}>
|
||||||
{Constants.FIRST_RUN_PAGE_WALLET === this.state.currentPage ? 'Use LBRY' : 'Continue'} »
|
{Constants.FIRST_RUN_PAGE_WALLET === this.state.currentPage ? 'Use LBRY' : 'Continue'} »
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -3,25 +3,36 @@ import {
|
|||||||
doPublish,
|
doPublish,
|
||||||
doResolveUri,
|
doResolveUri,
|
||||||
doToast,
|
doToast,
|
||||||
|
doUpdatePublishForm,
|
||||||
doUploadThumbnail,
|
doUploadThumbnail,
|
||||||
selectBalance,
|
selectBalance,
|
||||||
selectPublishFormValues,
|
selectPublishFormValues,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||||
import Constants from 'constants';
|
import { doUpdatePublishFormState, doClearPublishFormState } from 'redux/actions/form';
|
||||||
|
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
|
import { selectPublishFormState, selectHasPublishFormState } from 'redux/selectors/form';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import PublishPage from './view';
|
import PublishPage from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
balance: selectBalance(state),
|
balance: selectBalance(state),
|
||||||
|
drawerStack: selectDrawerStack(state),
|
||||||
|
hasFormState: selectHasPublishFormState(state),
|
||||||
|
publishFormState: selectPublishFormState(state),
|
||||||
publishFormValues: selectPublishFormValues(state),
|
publishFormValues: selectPublishFormValues(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
notify: data => dispatch(doToast(data)),
|
notify: data => dispatch(doToast(data)),
|
||||||
|
clearPublishFormState: () => dispatch(doClearPublishFormState()),
|
||||||
|
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
|
||||||
|
updatePublishFormState: data => dispatch(doUpdatePublishFormState(data)),
|
||||||
uploadThumbnail: (filePath, fsAdapter) => dispatch(doUploadThumbnail(filePath, null, fsAdapter)),
|
uploadThumbnail: (filePath, fsAdapter) => dispatch(doUploadThumbnail(filePath, null, fsAdapter)),
|
||||||
publish: params => dispatch(doPublish(params)),
|
publish: (success, fail) => dispatch(doPublish(success, fail)),
|
||||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH)),
|
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
||||||
|
popDrawerStack: () => dispatch(doPopDrawerStack()),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+522
-186
File diff suppressed because it is too large.
Load diff
@@ -1,5 +1,11 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCheckPendingPublishes, selectMyClaimUrisWithoutChannels, selectIsFetchingClaimListMine } from 'lbry-redux';
|
import {
|
||||||
|
doAbandonClaim,
|
||||||
|
doCheckPendingPublishes,
|
||||||
|
doFetchClaimListMine,
|
||||||
|
selectMyClaimUrisWithoutChannels,
|
||||||
|
selectIsFetchingClaimListMine,
|
||||||
|
} from 'lbry-redux';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import PublishesPage from './view';
|
import PublishesPage from './view';
|
||||||
@@ -10,6 +16,8 @@ const select = state => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)),
|
||||||
|
fetchMyClaims: () => dispatch(doFetchClaimListMine()),
|
||||||
checkPendingPublishes: () => dispatch(doCheckPendingPublishes()),
|
checkPendingPublishes: () => dispatch(doCheckPendingPublishes()),
|
||||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_PUBLISHES)),
|
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_PUBLISHES)),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
|
|||||||
+127
-9
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ActivityIndicator, FlatList, Text, TouchableOpacity, View } from 'react-native';
|
import { ActivityIndicator, Alert, FlatList, NativeModules, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
@@ -7,14 +7,20 @@ import FileListItem from 'component/fileListItem';
|
|||||||
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
import publishStyle from 'styles/publish';
|
import publishStyle from 'styles/publish';
|
||||||
import { __ } from 'utils/helper';
|
import { __, navigateToUri } from 'utils/helper';
|
||||||
|
|
||||||
class PublishesPage extends React.PureComponent {
|
class PublishesPage extends React.PureComponent {
|
||||||
|
state = {
|
||||||
|
selectionMode: false,
|
||||||
|
selectedUris: [],
|
||||||
|
selectedClaimsMap: {},
|
||||||
|
};
|
||||||
|
|
||||||
didFocusListener;
|
didFocusListener;
|
||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -23,23 +29,110 @@ class PublishesPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onComponentFocused = () => {
|
componentDidMount() {
|
||||||
const { checkPendingPublishes, pushDrawerStack, setPlayerVisible } = this.props;
|
this.onComponentFocused();
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
const { currentRoute } = nextProps;
|
||||||
|
const { currentRoute: prevRoute } = this.props;
|
||||||
|
|
||||||
|
if (Constants.DRAWER_ROUTE_PUBLISHES === currentRoute && currentRoute !== prevRoute) {
|
||||||
|
this.onComponentFocused();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onComponentFocused = () => {
|
||||||
|
const { checkPendingPublishes, fetchMyClaims, pushDrawerStack, setPlayerVisible } = this.props;
|
||||||
pushDrawerStack();
|
pushDrawerStack();
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
checkPendingPublishes();
|
NativeModules.Firebase.setCurrentScreen('Publishes').then(result => {
|
||||||
|
fetchMyClaims();
|
||||||
|
checkPendingPublishes();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
addOrRemoveItem = (uri, claim) => {
|
||||||
|
const { selectedClaimsMap } = this.state;
|
||||||
|
let selectedUris = [...this.state.selectedUris];
|
||||||
|
|
||||||
|
if (selectedUris.includes(uri)) {
|
||||||
|
delete selectedClaimsMap[uri];
|
||||||
|
selectedUris.splice(selectedUris.indexOf(uri), 1);
|
||||||
|
} else {
|
||||||
|
selectedClaimsMap[uri] = claim;
|
||||||
|
selectedUris.push(uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({ selectionMode: selectedUris.length > 0, selectedUris, selectedClaimsMap });
|
||||||
|
};
|
||||||
|
|
||||||
|
handleSelectItem = (uri, claim) => {
|
||||||
|
this.addOrRemoveItem(uri, claim);
|
||||||
|
};
|
||||||
|
|
||||||
|
handleItemLongPress = (uri, claim) => {
|
||||||
|
this.addOrRemoveItem(uri, claim);
|
||||||
|
};
|
||||||
|
|
||||||
|
onExitSelectionMode = () => {
|
||||||
|
this.setState({ selectionMode: false, selectedUris: [], selectedClaimsMap: {} });
|
||||||
|
};
|
||||||
|
|
||||||
|
onEditActionPressed = () => {
|
||||||
|
const { navigation } = this.props;
|
||||||
|
const { selectedClaimsMap, selectedUris } = this.state;
|
||||||
|
// only 1 item can be edited (and edit button should be visible only if there is a single selection)
|
||||||
|
const claim = selectedClaimsMap[selectedUris[0]];
|
||||||
|
this.onExitSelectionMode();
|
||||||
|
|
||||||
|
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_PUBLISH, params: { editMode: true, claimToEdit: claim } });
|
||||||
|
};
|
||||||
|
|
||||||
|
onDeleteActionPressed = () => {
|
||||||
|
const { abandonClaim } = this.props;
|
||||||
|
const { selectedClaimsMap } = this.state;
|
||||||
|
|
||||||
|
// show confirm alert
|
||||||
|
Alert.alert(
|
||||||
|
__('Unpublish'),
|
||||||
|
__('Are you sure you want to unpublish the selected content?'),
|
||||||
|
[
|
||||||
|
{ text: __('No') },
|
||||||
|
{
|
||||||
|
text: __('Yes'),
|
||||||
|
onPress: () => {
|
||||||
|
const uris = Object.keys(selectedClaimsMap);
|
||||||
|
uris.forEach(uri => {
|
||||||
|
const { txid, nout } = selectedClaimsMap[uri];
|
||||||
|
abandonClaim(txid, nout);
|
||||||
|
});
|
||||||
|
this.onExitSelectionMode();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
{ cancelable: true }
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { fetching, navigation, uris } = this.props;
|
const { fetching, navigation, uris } = this.props;
|
||||||
|
const { selectionMode, selectedUris } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={publishStyle.container}>
|
<View style={publishStyle.container}>
|
||||||
<UriBar navigation={navigation} />
|
<UriBar
|
||||||
|
allowEdit
|
||||||
|
navigation={navigation}
|
||||||
|
selectionMode={selectionMode}
|
||||||
|
selectedItemCount={selectedUris.length}
|
||||||
|
onDeleteActionPressed={this.onDeleteActionPressed}
|
||||||
|
onEditActionPressed={this.onEditActionPressed}
|
||||||
|
onExitSelectionMode={this.onExitSelectionMode}
|
||||||
|
/>
|
||||||
{fetching && (
|
{fetching && (
|
||||||
<View style={publishStyle.centered}>
|
<View style={publishStyle.centered}>
|
||||||
<ActivityIndicator size={'small'} color={Colors.LbryGreen} />
|
<ActivityIndicator size={'large'} color={Colors.NextLbryGreen} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -60,11 +153,36 @@ class PublishesPage extends React.PureComponent {
|
|||||||
<FlatList
|
<FlatList
|
||||||
style={publishStyle.publishesList}
|
style={publishStyle.publishesList}
|
||||||
contentContainerStyle={publishStyle.publishesScrollPadding}
|
contentContainerStyle={publishStyle.publishesScrollPadding}
|
||||||
|
extraData={this.state}
|
||||||
initialNumToRender={8}
|
initialNumToRender={8}
|
||||||
maxToRenderPerBatch={24}
|
maxToRenderPerBatch={24}
|
||||||
removeClippedSubviews
|
removeClippedSubviews
|
||||||
|
ListFooterComponent={
|
||||||
|
<View style={publishStyle.publishesFooter}>
|
||||||
|
<Button
|
||||||
|
style={publishStyle.publishesFooterButton}
|
||||||
|
text={__('Publish something new')}
|
||||||
|
onPress={() => navigation.navigate({ routeName: Constants.DRAWER_ROUTE_PUBLISH })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
}
|
||||||
renderItem={({ item }) => (
|
renderItem={({ item }) => (
|
||||||
<FileListItem hideChannel key={item} uri={item} style={publishStyle.listItem} navigation={navigation} />
|
<FileListItem
|
||||||
|
key={item}
|
||||||
|
uri={item}
|
||||||
|
style={publishStyle.listItem}
|
||||||
|
selected={selectedUris.includes(item)}
|
||||||
|
onPress={claim => {
|
||||||
|
if (selectionMode) {
|
||||||
|
this.handleSelectItem(item, claim);
|
||||||
|
} else {
|
||||||
|
// TODO: when shortUrl is available for my claims, navigate to that URL instead
|
||||||
|
navigateToUri(navigation, item);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onLongPress={claim => this.handleItemLongPress(item, claim)}
|
||||||
|
navigation={navigation}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
data={uris}
|
data={uris}
|
||||||
keyExtractor={(item, index) => item}
|
keyExtractor={(item, index) => item}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class RewardsPage extends React.PureComponent {
|
|||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -42,6 +42,8 @@ class RewardsPage extends React.PureComponent {
|
|||||||
|
|
||||||
pushDrawerStack();
|
pushDrawerStack();
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Rewards');
|
||||||
|
|
||||||
fetchRewards();
|
fetchRewards();
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|||||||
@@ -10,19 +10,21 @@ import {
|
|||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import SearchPage from './view';
|
import SearchPage from './view';
|
||||||
|
|
||||||
|
const numSearchResults = 50;
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
currentRoute: selectCurrentRoute(state),
|
currentRoute: selectCurrentRoute(state),
|
||||||
isSearching: selectIsSearching(state),
|
isSearching: selectIsSearching(state),
|
||||||
query: selectSearchValue(state),
|
query: selectSearchValue(state),
|
||||||
uris: makeSelectSearchUris(makeSelectQueryWithOptions(null, 25)(state))(state),
|
uris: makeSelectSearchUris(makeSelectQueryWithOptions(null, numSearchResults)(state))(state),
|
||||||
urisByQuery: selectSearchUrisByQuery(state),
|
urisByQuery: selectSearchUrisByQuery(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
search: query => dispatch(doSearch(query, 25)),
|
search: query => dispatch(doSearch(query, numSearchResults)),
|
||||||
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
||||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SEARCH)),
|
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SEARCH)),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
|
|||||||
+49
-48
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Lbry, parseURI, normalizeURI, isURIValid } from 'lbry-redux';
|
import { Lbry, parseURI, normalizeURI, isURIValid } from 'lbry-redux';
|
||||||
import { ActivityIndicator, Button, Text, TextInput, View, ScrollView } from 'react-native';
|
import { ActivityIndicator, Button, FlatList, NativeModules, Text, TextInput, View } from 'react-native';
|
||||||
import { navigateToUri } from 'utils/helper';
|
import { navigateToUri } from 'utils/helper';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
@@ -24,7 +24,7 @@ class SearchPage extends React.PureComponent {
|
|||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -37,15 +37,16 @@ class SearchPage extends React.PureComponent {
|
|||||||
const { pushDrawerStack, setPlayerVisible, query, search } = this.props;
|
const { pushDrawerStack, setPlayerVisible, query, search } = this.props;
|
||||||
pushDrawerStack();
|
pushDrawerStack();
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Search').then(result => {
|
||||||
const searchQuery = query || this.getSearchQuery();
|
const searchQuery = query || this.getSearchQuery();
|
||||||
if (searchQuery && searchQuery.trim().length > 0) {
|
if (searchQuery && searchQuery.trim().length > 0) {
|
||||||
this.setState({
|
this.setState({
|
||||||
currentQuery: searchQuery,
|
currentQuery: searchQuery,
|
||||||
currentUri: isURIValid(searchQuery) ? normalizeURI(searchQuery) : null,
|
currentUri: isURIValid(searchQuery) ? normalizeURI(searchQuery) : null,
|
||||||
});
|
});
|
||||||
search(searchQuery);
|
search(searchQuery);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -83,55 +84,55 @@ class SearchPage extends React.PureComponent {
|
|||||||
search(keywords);
|
search(keywords);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
listEmptyComponent = () => {
|
||||||
|
const { query } = this.props;
|
||||||
|
return (
|
||||||
|
<View style={searchStyle.noResults}>
|
||||||
|
<Text style={searchStyle.noResultsText}>
|
||||||
|
There are no results to display for <Text style={searchStyle.boldText}>{query}</Text>. Please try a different
|
||||||
|
search term.
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
listHeaderComponent = () => {
|
||||||
|
const { navigation } = this.props;
|
||||||
|
const { currentUri } = this.state;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FileListItem uri={currentUri} featuredResult style={searchStyle.featuredResultItem} navigation={navigation} />
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { isSearching, navigation, query, uris, urisByQuery } = this.props;
|
const { isSearching, navigation, query, uris, urisByQuery } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={searchStyle.container}>
|
<View style={searchStyle.container}>
|
||||||
<UriBar value={query} navigation={navigation} onSearchSubmitted={this.handleSearchSubmitted} />
|
<UriBar value={query} navigation={navigation} onSearchSubmitted={this.handleSearchSubmitted} />
|
||||||
|
|
||||||
{isSearching && (
|
{isSearching && (
|
||||||
<View style={searchStyle.busyContainer}>
|
<View style={searchStyle.busyContainer}>
|
||||||
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={searchStyle.loading} />
|
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={searchStyle.loading} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!isSearching && (
|
<FlatList
|
||||||
<ScrollView
|
style={searchStyle.scrollContainer}
|
||||||
style={searchStyle.scrollContainer}
|
contentContainerStyle={searchStyle.scrollPadding}
|
||||||
contentContainerStyle={searchStyle.scrollPadding}
|
keyboardShouldPersistTaps={'handled'}
|
||||||
keyboardShouldPersistTaps={'handled'}
|
data={uris}
|
||||||
>
|
keyExtractor={(item, index) => item}
|
||||||
{this.state.currentUri && (
|
initialNumToRender={10}
|
||||||
<FileListItem
|
maxToRenderPerBatch={20}
|
||||||
key={this.state.currentUri}
|
removeClippedSubviews
|
||||||
uri={this.state.currentUri}
|
ListEmptyComponent={!isSearching ? this.listEmptyComponent() : null}
|
||||||
featuredResult
|
ListHeaderComponent={this.state.currentUri ? this.listHeaderComponent() : null}
|
||||||
style={searchStyle.featuredResultItem}
|
renderItem={({ item }) => (
|
||||||
navigation={navigation}
|
<FileListItem key={item} uri={item} style={searchStyle.resultItem} navigation={navigation} />
|
||||||
onPress={() => navigateToUri(navigation, this.state.currentUri)}
|
)}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
{uris && uris.length
|
|
||||||
? uris.map(uri => (
|
|
||||||
<FileListItem
|
|
||||||
key={uri}
|
|
||||||
uri={uri}
|
|
||||||
style={searchStyle.resultItem}
|
|
||||||
navigation={navigation}
|
|
||||||
onPress={() => navigateToUri(navigation, uri)}
|
|
||||||
/>
|
|
||||||
))
|
|
||||||
: null}
|
|
||||||
{(!uris || uris.length === 0) && (
|
|
||||||
<View style={searchStyle.noResults}>
|
|
||||||
<Text style={searchStyle.noResultsText}>
|
|
||||||
There are no results to display for <Text style={searchStyle.boldText}>{query}</Text>. Please try a
|
|
||||||
different search term.
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
</ScrollView>
|
|
||||||
)}
|
|
||||||
<FloatingWalletBalance navigation={navigation} />
|
<FloatingWalletBalance navigation={navigation} />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { SETTINGS } from 'lbry-redux';
|
import { SETTINGS } from 'lbry-redux';
|
||||||
import { Text, View, ScrollView, Switch, NativeModules } from 'react-native';
|
import { Text, View, ScrollView, Switch, NativeModules } from 'react-native';
|
||||||
import { navigateBack } from 'utils/helper';
|
import { navigateBack } from 'utils/helper';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import PageHeader from 'component/pageHeader';
|
import PageHeader from 'component/pageHeader';
|
||||||
import settingsStyle from 'styles/settings';
|
import settingsStyle from 'styles/settings';
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ class SettingsPage extends React.PureComponent {
|
|||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -28,6 +28,7 @@ class SettingsPage extends React.PureComponent {
|
|||||||
const { pushDrawerStack, setPlayerVisible } = this.props;
|
const { pushDrawerStack, setPlayerVisible } = this.props;
|
||||||
pushDrawerStack();
|
pushDrawerStack();
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Settings');
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Lbry } from 'lbry-redux';
|
|||||||
import { ActivityIndicator, Linking, NativeModules, Platform, Text, View } from 'react-native';
|
import { ActivityIndicator, Linking, NativeModules, Platform, Text, View } from 'react-native';
|
||||||
import { NavigationActions, StackActions } from 'react-navigation';
|
import { NavigationActions, StackActions } from 'react-navigation';
|
||||||
import { decode as atob } from 'base-64';
|
import { decode as atob } from 'base-64';
|
||||||
import { navigateToUri } from 'utils/helper';
|
import { navigateToUri, transformUrl } from 'utils/helper';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
@@ -81,7 +81,7 @@ class SplashScreen extends React.PureComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
navigateToUri(navigation, launchUrl);
|
navigateToUri(navigation, transformUrl(launchUrl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -130,7 +130,7 @@ class SplashScreen extends React.PureComponent {
|
|||||||
if (user && user.id && user.has_verified_email) {
|
if (user && user.id && user.has_verified_email) {
|
||||||
// user already authenticated
|
// user already authenticated
|
||||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => {
|
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => {
|
||||||
if (walletPassword && walletPassword.trim().length > 0) {
|
if (walletPassword) {
|
||||||
getSync(walletPassword);
|
getSync(walletPassword);
|
||||||
}
|
}
|
||||||
this.navigateToMain();
|
this.navigateToMain();
|
||||||
@@ -166,14 +166,14 @@ class SplashScreen extends React.PureComponent {
|
|||||||
|
|
||||||
// For now, automatically unlock the wallet if a password is set so that downloads work
|
// 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 => {
|
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(password => {
|
||||||
if (password && password.trim().length > 0) {
|
if (password) {
|
||||||
this.setState({
|
this.setState({
|
||||||
message: 'Unlocking account',
|
message: 'Unlocking account',
|
||||||
details: 'Decrypting wallet',
|
details: 'Decrypting wallet',
|
||||||
});
|
});
|
||||||
|
|
||||||
// unlock the wallet and then finish the splash screen
|
// unlock the wallet and then finish the splash screen
|
||||||
Lbry.account_unlock({ password })
|
Lbry.account_unlock({ password: password || '' })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
message: testingNetwork,
|
message: testingNetwork,
|
||||||
@@ -239,6 +239,8 @@ class SplashScreen extends React.PureComponent {
|
|||||||
NativeModules.Firebase.track('app_launch', null);
|
NativeModules.Firebase.track('app_launch', null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Splash');
|
||||||
|
|
||||||
this.props.fetchRewardedContent();
|
this.props.fetchRewardedContent();
|
||||||
Linking.getInitialURL().then(url => {
|
Linking.getInitialURL().then(url => {
|
||||||
if (url) {
|
if (url) {
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import {
|
|||||||
selectShowSuggestedSubs,
|
selectShowSuggestedSubs,
|
||||||
} from 'lbryinc';
|
} from 'lbryinc';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { doSetClientSetting } from 'redux/actions/settings';
|
import { doSetClientSetting, doSetTimeItem } from 'redux/actions/settings';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting, selectTimeItem } from 'redux/selectors/settings';
|
||||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import SubscriptionsPage from './view';
|
import SubscriptionsPage from './view';
|
||||||
@@ -32,6 +32,7 @@ const select = state => ({
|
|||||||
viewMode: selectViewMode(state),
|
viewMode: selectViewMode(state),
|
||||||
firstRunCompleted: selectFirstRunCompleted(state),
|
firstRunCompleted: selectFirstRunCompleted(state),
|
||||||
showSuggestedSubs: selectShowSuggestedSubs(state),
|
showSuggestedSubs: selectShowSuggestedSubs(state),
|
||||||
|
timeItem: selectTimeItem(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
@@ -41,6 +42,7 @@ const perform = dispatch => ({
|
|||||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SUBSCRIPTIONS)),
|
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SUBSCRIPTIONS)),
|
||||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
|
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
View,
|
View,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { buildURI, parseURI } from 'lbry-redux';
|
import { buildURI, parseURI } from 'lbry-redux';
|
||||||
import { __, uriFromFileInfo } from 'utils/helper';
|
import { __, getOrderBy } from 'utils/helper';
|
||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
@@ -33,6 +33,7 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
state = {
|
state = {
|
||||||
showingSuggestedSubs: false,
|
showingSuggestedSubs: false,
|
||||||
showSortPicker: false,
|
showSortPicker: false,
|
||||||
|
showTimePicker: false,
|
||||||
orderBy: ['release_time'],
|
orderBy: ['release_time'],
|
||||||
filteredChannels: [],
|
filteredChannels: [],
|
||||||
currentSortByItem: Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1], // should always default to sorting subscriptions by new
|
currentSortByItem: Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1], // should always default to sorting subscriptions by new
|
||||||
@@ -42,7 +43,7 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -63,6 +64,8 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
|
|
||||||
pushDrawerStack();
|
pushDrawerStack();
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Subscriptions');
|
||||||
|
|
||||||
doFetchMySubscriptions();
|
doFetchMySubscriptions();
|
||||||
doFetchRecommendedSubscriptions();
|
doFetchRecommendedSubscriptions();
|
||||||
};
|
};
|
||||||
@@ -74,28 +77,19 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { currentRoute } = nextProps;
|
const { currentRoute } = nextProps;
|
||||||
const { currentRoute: prevRoute } = this.props;
|
const { currentRoute: prevRoute } = this.props;
|
||||||
if (Constants.FULL_ROUTE_NAME_MY_SUBSCRIPTIONS === currentRoute && currentRoute !== prevRoute) {
|
if (Constants.DRAWER_ROUTE_SUBSCRIPTIONS === currentRoute && currentRoute !== prevRoute) {
|
||||||
this.onComponentFocused();
|
this.onComponentFocused();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSortByItemSelected = item => {
|
handleSortByItemSelected = item => {
|
||||||
let orderBy = [];
|
this.setState({ currentSortByItem: item, orderBy: getOrderBy(item), showSortPicker: false });
|
||||||
switch (item.name) {
|
};
|
||||||
case Constants.SORT_BY_HOT:
|
|
||||||
orderBy = Constants.DEFAULT_ORDER_BY;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Constants.SORT_BY_NEW:
|
handleTimeItemSelected = item => {
|
||||||
orderBy = ['release_time'];
|
const { setTimeItem } = this.props;
|
||||||
break;
|
setTimeItem(item);
|
||||||
|
this.setState({ showTimePicker: false });
|
||||||
case Constants.SORT_BY_TOP:
|
|
||||||
orderBy = ['effective_amount'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setState({ currentSortByItem: item, orderBy, showSortPicker: false });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
handleChannelSelected = channelUri => {
|
handleChannelSelected = channelUri => {
|
||||||
@@ -118,18 +112,17 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
suggestedChannels,
|
suggestedChannels,
|
||||||
subscribedChannels,
|
subscribedChannels,
|
||||||
allSubscriptions,
|
allSubscriptions,
|
||||||
viewMode,
|
doCompleteFirstRun,
|
||||||
doSetViewMode,
|
doShowSuggestedSubs,
|
||||||
loading,
|
loading,
|
||||||
loadingSuggested,
|
loadingSuggested,
|
||||||
firstRunCompleted,
|
firstRunCompleted,
|
||||||
doCompleteFirstRun,
|
|
||||||
doShowSuggestedSubs,
|
|
||||||
showSuggestedSubs,
|
showSuggestedSubs,
|
||||||
|
timeItem,
|
||||||
unreadSubscriptions,
|
unreadSubscriptions,
|
||||||
navigation,
|
navigation,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { currentSortByItem, filteredChannels } = this.state;
|
const { currentSortByItem, filteredChannels, showSortPicker, showTimePicker } = this.state;
|
||||||
|
|
||||||
const numberOfSubscriptions = subscribedChannels ? subscribedChannels.length : 0;
|
const numberOfSubscriptions = subscribedChannels ? subscribedChannels.length : 0;
|
||||||
const hasSubscriptions = numberOfSubscriptions > 0;
|
const hasSubscriptions = numberOfSubscriptions > 0;
|
||||||
@@ -155,7 +148,9 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
<UriBar navigation={navigation} belowOverlay={this.state.showSortPicker} />
|
<UriBar navigation={navigation} belowOverlay={this.state.showSortPicker} />
|
||||||
<View style={subscriptionsStyle.titleRow}>
|
<View style={subscriptionsStyle.titleRow}>
|
||||||
<Text style={subscriptionsStyle.pageTitle}>Channels you follow</Text>
|
<Text style={subscriptionsStyle.pageTitle}>Channels you follow</Text>
|
||||||
{!this.state.showingSuggestedSubs && hasSubscriptions && (
|
</View>
|
||||||
|
{!this.state.showingSuggestedSubs && hasSubscriptions && (
|
||||||
|
<View style={subscriptionsStyle.pickerRow}>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={subscriptionsStyle.tagSortBy}
|
style={subscriptionsStyle.tagSortBy}
|
||||||
onPress={() => this.setState({ showSortPicker: true })}
|
onPress={() => this.setState({ showSortPicker: true })}
|
||||||
@@ -163,8 +158,18 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
<Text style={subscriptionsStyle.tagSortText}>{currentSortByItem.label.split(' ')[0]}</Text>
|
<Text style={subscriptionsStyle.tagSortText}>{currentSortByItem.label.split(' ')[0]}</Text>
|
||||||
<Icon style={subscriptionsStyle.tagSortIcon} name={'sort-down'} size={14} />
|
<Icon style={subscriptionsStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
|
||||||
</View>
|
{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>
|
||||||
|
)}
|
||||||
{!this.state.showingSuggestedSubs && hasSubscriptions && !loading && (
|
{!this.state.showingSuggestedSubs && hasSubscriptions && !loading && (
|
||||||
<View style={subscriptionsStyle.subContainer}>
|
<View style={subscriptionsStyle.subContainer}>
|
||||||
<SubscribedChannelList
|
<SubscribedChannelList
|
||||||
@@ -175,6 +180,7 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
style={subscriptionsStyle.claimList}
|
style={subscriptionsStyle.claimList}
|
||||||
channelIds={channelIds}
|
channelIds={channelIds}
|
||||||
orderBy={this.state.orderBy}
|
orderBy={this.state.orderBy}
|
||||||
|
time={timeItem.name}
|
||||||
navigation={navigation}
|
navigation={navigation}
|
||||||
orientation={Constants.ORIENTATION_VERTICAL}
|
orientation={Constants.ORIENTATION_VERTICAL}
|
||||||
/>
|
/>
|
||||||
@@ -217,8 +223,8 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!this.state.showSortPicker && <FloatingWalletBalance navigation={navigation} />}
|
{!showSortPicker && !showTimePicker && <FloatingWalletBalance navigation={navigation} />}
|
||||||
{this.state.showSortPicker && (
|
{showSortPicker && (
|
||||||
<ModalPicker
|
<ModalPicker
|
||||||
title={__('Sort content by')}
|
title={__('Sort content by')}
|
||||||
onOverlayPress={() => this.setState({ showSortPicker: false })}
|
onOverlayPress={() => this.setState({ showSortPicker: false })}
|
||||||
@@ -227,6 +233,15 @@ class SubscriptionsPage extends React.PureComponent {
|
|||||||
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
|
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{showTimePicker && (
|
||||||
|
<ModalPicker
|
||||||
|
title={__('Content from')}
|
||||||
|
onOverlayPress={() => this.setState({ showTimePicker: false })}
|
||||||
|
onItemSelected={this.handleTimeItemSelected}
|
||||||
|
selectedItem={timeItem}
|
||||||
|
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-2
@@ -1,16 +1,24 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import { selectFollowedTags, doToggleTagFollow } from 'lbry-redux';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
|
import { doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
||||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||||
import Constants from 'constants';
|
import { selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||||
import TagPage from './view';
|
import TagPage from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
currentRoute: selectCurrentRoute(state),
|
currentRoute: selectCurrentRoute(state),
|
||||||
|
sortByItem: selectSortByItem(state),
|
||||||
|
timeItem: selectTimeItem(state),
|
||||||
|
followedTags: selectFollowedTags(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_TAG)),
|
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
|
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
||||||
|
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
||||||
|
toggleTagFollow: tag => dispatch(doToggleTagFollow(tag)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|||||||
+85
-52
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ActivityIndicator, NativeModules, FlatList, Text, TouchableOpacity, View } from 'react-native';
|
import { ActivityIndicator, NativeModules, FlatList, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { DEFAULT_FOLLOWED_TAGS, normalizeURI } from 'lbry-redux';
|
import { DEFAULT_FOLLOWED_TAGS, normalizeURI } from 'lbry-redux';
|
||||||
import { formatTagTitle } from 'utils/helper';
|
import { formatTagTitle, getOrderBy } from 'utils/helper';
|
||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import ClaimList from 'component/claimList';
|
import ClaimList from 'component/claimList';
|
||||||
@@ -12,6 +12,7 @@ import fileListStyle from 'styles/fileList';
|
|||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
||||||
|
import Link from 'component/link';
|
||||||
import ModalPicker from 'component/modalPicker';
|
import ModalPicker from 'component/modalPicker';
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
|
|
||||||
@@ -21,16 +22,13 @@ class TagPage extends React.PureComponent {
|
|||||||
showSortPicker: false,
|
showSortPicker: false,
|
||||||
showTimePicker: false,
|
showTimePicker: false,
|
||||||
orderBy: Constants.DEFAULT_ORDER_BY,
|
orderBy: Constants.DEFAULT_ORDER_BY,
|
||||||
time: Constants.TIME_WEEK,
|
|
||||||
currentSortByItem: Constants.CLAIM_SEARCH_SORT_BY_ITEMS[0],
|
|
||||||
currentTimeItem: Constants.CLAIM_SEARCH_TIME_ITEMS[1],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
didFocusListener;
|
didFocusListener;
|
||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -40,10 +38,12 @@ class TagPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
const { pushDrawerStack, setPlayerVisible, navigation } = this.props;
|
const { navigation, pushDrawerStack, setPlayerVisible, sortByItem } = this.props;
|
||||||
this.setState({ tag: navigation.state.params.tag });
|
const { tag } = navigation.state.params;
|
||||||
pushDrawerStack();
|
this.setState({ tag, orderBy: getOrderBy(sortByItem) });
|
||||||
|
pushDrawerStack(Constants.DRAWER_ROUTE_TAG, navigation.state.params);
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Tag');
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -59,65 +59,98 @@ class TagPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleSortByItemSelected = item => {
|
handleSortByItemSelected = item => {
|
||||||
let orderBy = [];
|
const { setSortByItem } = this.props;
|
||||||
switch (item.name) {
|
setSortByItem(item);
|
||||||
case Constants.SORT_BY_HOT:
|
this.setState({ orderBy: getOrderBy(item), showSortPicker: false });
|
||||||
orderBy = Constants.DEFAULT_ORDER_BY;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Constants.SORT_BY_NEW:
|
|
||||||
orderBy = ['release_time'];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Constants.SORT_BY_TOP:
|
|
||||||
orderBy = [Constants.ORDER_BY_EFFECTIVE_AMOUNT];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setState({ currentSortByItem: item, orderBy, showSortPicker: false });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
handleTimeItemSelected = item => {
|
handleTimeItemSelected = item => {
|
||||||
this.setState({ currentTimeItem: item, time: item.name, showTimePicker: false });
|
const { setTimeItem } = this.props;
|
||||||
|
setTimeItem(item);
|
||||||
|
this.setState({ showTimePicker: false });
|
||||||
|
};
|
||||||
|
|
||||||
|
isFollowingTag = tag => {
|
||||||
|
const { followedTags } = this.props;
|
||||||
|
return followedTags.map(tag => tag.name).includes(tag);
|
||||||
|
};
|
||||||
|
|
||||||
|
handleFollowTagToggle = () => {
|
||||||
|
const { toggleTagFollow } = this.props;
|
||||||
|
const { tag } = this.state;
|
||||||
|
const isFollowing = this.isFollowingTag(tag);
|
||||||
|
if (isFollowing) {
|
||||||
|
// unfollow
|
||||||
|
NativeModules.Firebase.track('tag_unfollow', { tag });
|
||||||
|
} else {
|
||||||
|
// follow
|
||||||
|
NativeModules.Firebase.track('tag_follow', { tag });
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleTagFollow(tag);
|
||||||
|
if (window.persistor) {
|
||||||
|
window.persistor.flush();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
listHeader = () => {
|
||||||
|
const { sortByItem, timeItem } = this.props;
|
||||||
|
const { tag } = this.state;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={discoverStyle.listHeader}>
|
||||||
|
<View style={discoverStyle.titleRow}>
|
||||||
|
<Text style={discoverStyle.pageTitle}>{formatTagTitle(tag)}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={discoverStyle.pickerRow}>
|
||||||
|
<View style={discoverStyle.leftPickerRow}>
|
||||||
|
<TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}>
|
||||||
|
<Text style={discoverStyle.tagSortText}>{sortByItem.label.split(' ')[0]}</Text>
|
||||||
|
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
{Constants.SORT_BY_TOP === sortByItem.name && (
|
||||||
|
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
|
||||||
|
<Text style={discoverStyle.tagSortText}>{timeItem.label}</Text>
|
||||||
|
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Link
|
||||||
|
style={discoverStyle.customizeLink}
|
||||||
|
text={this.isFollowingTag(tag) ? 'Unfollow' : 'Follow'}
|
||||||
|
onPress={this.handleFollowTagToggle}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { navigation } = this.props;
|
const { navigation, sortByItem, timeItem } = this.props;
|
||||||
const { tag, currentSortByItem, currentTimeItem, showSortPicker, showTimePicker } = this.state;
|
const { tag, showSortPicker, showTimePicker } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={discoverStyle.container}>
|
<View style={discoverStyle.container}>
|
||||||
<UriBar navigation={navigation} belowOverlay={showSortPicker || showTimePicker} />
|
<UriBar navigation={navigation} belowOverlay={showSortPicker || showTimePicker} />
|
||||||
<ClaimList
|
{this.state.tag && (
|
||||||
ListHeaderComponent={
|
<ClaimList
|
||||||
<View style={discoverStyle.tagTitleRow}>
|
ListHeaderComponent={this.listHeader}
|
||||||
<Text style={discoverStyle.tagPageTitle}>{formatTagTitle(tag)}</Text>
|
style={discoverStyle.tagPageClaimList}
|
||||||
{Constants.SORT_BY_TOP === currentSortByItem.name && (
|
orderBy={this.state.orderBy}
|
||||||
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
|
time={timeItem.name}
|
||||||
<Text style={discoverStyle.tagSortText}>{currentTimeItem.label}</Text>
|
tags={[tag]}
|
||||||
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
navigation={navigation}
|
||||||
</TouchableOpacity>
|
orientation={Constants.ORIENTATION_VERTICAL}
|
||||||
)}
|
/>
|
||||||
<TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}>
|
)}
|
||||||
<Text style={discoverStyle.tagSortText}>{currentSortByItem.label.split(' ')[0]}</Text>
|
|
||||||
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
|
||||||
</TouchableOpacity>
|
|
||||||
</View>
|
|
||||||
}
|
|
||||||
style={discoverStyle.tagPageClaimList}
|
|
||||||
orderBy={this.state.orderBy}
|
|
||||||
time={this.state.time}
|
|
||||||
tags={[tag]}
|
|
||||||
navigation={navigation}
|
|
||||||
orientation={Constants.ORIENTATION_VERTICAL}
|
|
||||||
/>
|
|
||||||
{!showSortPicker && !showTimePicker && <FloatingWalletBalance navigation={navigation} />}
|
{!showSortPicker && !showTimePicker && <FloatingWalletBalance navigation={navigation} />}
|
||||||
{showSortPicker && (
|
{showSortPicker && (
|
||||||
<ModalPicker
|
<ModalPicker
|
||||||
title={__('Sort content by')}
|
title={__('Sort content by')}
|
||||||
onOverlayPress={() => this.setState({ showSortPicker: false })}
|
onOverlayPress={() => this.setState({ showSortPicker: false })}
|
||||||
onItemSelected={this.handleSortByItemSelected}
|
onItemSelected={this.handleSortByItemSelected}
|
||||||
selectedItem={this.state.currentSortByItem}
|
selectedItem={sortByItem}
|
||||||
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
|
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -126,7 +159,7 @@ class TagPage extends React.PureComponent {
|
|||||||
title={__('Content from')}
|
title={__('Content from')}
|
||||||
onOverlayPress={() => this.setState({ showTimePicker: false })}
|
onOverlayPress={() => this.setState({ showTimePicker: false })}
|
||||||
onItemSelected={this.handleTimeItemSelected}
|
onItemSelected={this.handleTimeItemSelected}
|
||||||
selectedItem={this.state.currentTimeItem}
|
selectedItem={timeItem}
|
||||||
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
|
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View, ScrollView, Text } from 'react-native';
|
import { ActivityIndicator, NativeModules, View, ScrollView, Text } from 'react-native';
|
||||||
import Constants from 'constants';
|
import Colors from 'styles/colors';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import TransactionList from 'component/transactionList';
|
import TransactionList from 'component/transactionList';
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
import walletStyle from 'styles/wallet';
|
import walletStyle from 'styles/wallet';
|
||||||
@@ -10,7 +11,7 @@ class TransactionHistoryPage extends React.PureComponent {
|
|||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -23,7 +24,9 @@ class TransactionHistoryPage extends React.PureComponent {
|
|||||||
const { fetchTransactions, pushDrawerStack, setPlayerVisible } = this.props;
|
const { fetchTransactions, pushDrawerStack, setPlayerVisible } = this.props;
|
||||||
pushDrawerStack();
|
pushDrawerStack();
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
fetchTransactions();
|
NativeModules.Firebase.setCurrentScreen('Transaction History').then(result => {
|
||||||
|
fetchTransactions();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -42,13 +45,16 @@ class TransactionHistoryPage extends React.PureComponent {
|
|||||||
const { fetchingTransactions, transactions, navigation } = this.props;
|
const { fetchingTransactions, transactions, navigation } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View style={walletStyle.container}>
|
||||||
<UriBar navigation={navigation} />
|
<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}>
|
<ScrollView style={walletStyle.transactionHistoryScroll}>
|
||||||
<View style={walletStyle.historyList}>
|
<View style={walletStyle.historyList}>
|
||||||
{fetchingTransactions && !transactions.length && (
|
|
||||||
<Text style={walletStyle.infoText}>Loading transactions...</Text>
|
|
||||||
)}
|
|
||||||
{!fetchingTransactions && transactions.length === 0 && (
|
{!fetchingTransactions && transactions.length === 0 && (
|
||||||
<Text style={walletStyle.infoText}>No transactions to list.</Text>
|
<Text style={walletStyle.infoText}>No transactions to list.</Text>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,18 +1,23 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { selectFollowedTags } from 'lbry-redux';
|
import { selectFollowedTags } from 'lbry-redux';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
|
import { doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
||||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import { selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||||
import TrendingPage from './view';
|
import TrendingPage from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
currentRoute: selectCurrentRoute(state),
|
currentRoute: selectCurrentRoute(state),
|
||||||
|
sortByItem: selectSortByItem(state),
|
||||||
|
timeItem: selectTimeItem(state),
|
||||||
followedTags: selectFollowedTags(state),
|
followedTags: selectFollowedTags(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_TRENDING)),
|
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
|
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
||||||
|
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
|
|||||||
+114
-34
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ActivityIndicator, NativeModules, FlatList, Text, TouchableOpacity, View } from 'react-native';
|
import { ActivityIndicator, NativeModules, FlatList, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { DEFAULT_FOLLOWED_TAGS, normalizeURI } from 'lbry-redux';
|
import { normalizeURI } from 'lbry-redux';
|
||||||
|
import { getOrderBy } from 'utils/helper';
|
||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import ClaimList from 'component/claimList';
|
import ClaimList from 'component/claimList';
|
||||||
@@ -23,7 +24,10 @@ const TRENDING_FOR_ITEMS = [
|
|||||||
class TrendingPage extends React.PureComponent {
|
class TrendingPage extends React.PureComponent {
|
||||||
state = {
|
state = {
|
||||||
showModalTagSelector: false,
|
showModalTagSelector: false,
|
||||||
|
showSortByPicker: false,
|
||||||
|
showTimePicker: false,
|
||||||
showTrendingForPicker: false,
|
showTrendingForPicker: false,
|
||||||
|
orderBy: Constants.DEFAULT_ORDER_BY,
|
||||||
currentTrendingForItem: TRENDING_FOR_ITEMS[0],
|
currentTrendingForItem: TRENDING_FOR_ITEMS[0],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -31,7 +35,7 @@ class TrendingPage extends React.PureComponent {
|
|||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -41,9 +45,15 @@ class TrendingPage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onComponentFocused = () => {
|
onComponentFocused = () => {
|
||||||
const { pushDrawerStack, setPlayerVisible } = this.props;
|
const { pushDrawerStack, setPlayerVisible, navigation, sortByItem } = this.props;
|
||||||
pushDrawerStack();
|
const { filterForTags } = navigation.state.params ? navigation.state.params : { filterForTags: false };
|
||||||
|
this.setState({
|
||||||
|
currentTrendingForItem: TRENDING_FOR_ITEMS[filterForTags ? 1 : 0],
|
||||||
|
orderBy: getOrderBy(sortByItem),
|
||||||
|
});
|
||||||
|
pushDrawerStack(Constants.DRAWER_ROUTE_TRENDING, navigation.state.params);
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
NativeModules.Firebase.setCurrentScreen('All content');
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -53,7 +63,7 @@ class TrendingPage extends React.PureComponent {
|
|||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { currentRoute } = nextProps;
|
const { currentRoute } = nextProps;
|
||||||
const { currentRoute: prevRoute } = this.props;
|
const { currentRoute: prevRoute } = this.props;
|
||||||
if (Constants.FULL_ROUTE_NAME_TRENDING === currentRoute && currentRoute !== prevRoute) {
|
if (Constants.DRAWER_ROUTE_TRENDING === currentRoute && currentRoute !== prevRoute) {
|
||||||
this.onComponentFocused();
|
this.onComponentFocused();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,44 +72,96 @@ class TrendingPage extends React.PureComponent {
|
|||||||
this.setState({ currentTrendingForItem: item, showTrendingForPicker: false });
|
this.setState({ currentTrendingForItem: item, showTrendingForPicker: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleSortByItemSelected = item => {
|
||||||
|
const { setSortByItem } = this.props;
|
||||||
|
setSortByItem(item);
|
||||||
|
this.setState({ orderBy: getOrderBy(item), showSortPicker: false });
|
||||||
|
};
|
||||||
|
|
||||||
|
handleTimeItemSelected = item => {
|
||||||
|
const { setTimeItem } = this.props;
|
||||||
|
setTimeItem(item);
|
||||||
|
this.setState({ showTimePicker: false });
|
||||||
|
};
|
||||||
|
|
||||||
|
listHeader = () => {
|
||||||
|
const { sortByItem, timeItem } = this.props;
|
||||||
|
const { currentTrendingForItem } = this.state;
|
||||||
|
const sortByTop = Constants.SORT_BY_TOP === sortByItem.name;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={discoverStyle.listHeader}>
|
||||||
|
<View style={discoverStyle.titleRow}>
|
||||||
|
<Text style={discoverStyle.pageTitle}>All content</Text>
|
||||||
|
</View>
|
||||||
|
<View style={discoverStyle.pickerRow}>
|
||||||
|
<View style={discoverStyle.leftPickerRow}>
|
||||||
|
<TouchableOpacity
|
||||||
|
style={discoverStyle.allTagSortBy}
|
||||||
|
onPress={() => this.setState({ showSortPicker: true })}
|
||||||
|
>
|
||||||
|
<Text style={discoverStyle.tagSortText}>{sortByItem.label.split(' ')[0]}</Text>
|
||||||
|
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<Text style={discoverStyle.pickerLabel}>for</Text>
|
||||||
|
<TouchableOpacity
|
||||||
|
style={discoverStyle.allTagSortBy}
|
||||||
|
onPress={() => this.setState({ showTrendingForPicker: true })}
|
||||||
|
>
|
||||||
|
<Text style={discoverStyle.tagSortText}>{currentTrendingForItem.label.split(' ')[0]}</Text>
|
||||||
|
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
{sortByTop && <Text style={discoverStyle.pickerLabel}>from</Text>}
|
||||||
|
|
||||||
|
{sortByTop && (
|
||||||
|
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
|
||||||
|
<Text style={discoverStyle.tagSortText}>{timeItem.label}</Text>
|
||||||
|
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{TRENDING_FOR_ITEMS[1].name === currentTrendingForItem.name && (
|
||||||
|
<Link
|
||||||
|
style={discoverStyle.customizeLink}
|
||||||
|
text={'Customize'}
|
||||||
|
onPress={() => this.setState({ showModalTagSelector: true })}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { followedTags, navigation } = this.props;
|
const { followedTags, navigation, sortByItem, timeItem } = this.props;
|
||||||
const { currentTrendingForItem, showModalTagSelector, showTrendingForPicker } = this.state;
|
const {
|
||||||
|
currentTrendingForItem,
|
||||||
|
orderBy,
|
||||||
|
showModalTagSelector,
|
||||||
|
showSortPicker,
|
||||||
|
showTimePicker,
|
||||||
|
showTrendingForPicker,
|
||||||
|
} = this.state;
|
||||||
|
const filteredForTags = TRENDING_FOR_ITEMS[1].name === currentTrendingForItem.name;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={discoverStyle.container}>
|
<View style={discoverStyle.container}>
|
||||||
<UriBar navigation={navigation} />
|
<UriBar navigation={navigation} />
|
||||||
<ClaimList
|
<ClaimList
|
||||||
ListHeaderComponent={
|
ListHeaderComponent={this.listHeader}
|
||||||
<View style={discoverStyle.titleRow}>
|
|
||||||
<Text style={discoverStyle.pageTitle}>Trending</Text>
|
|
||||||
<View style={discoverStyle.rightTitleRow}>
|
|
||||||
{TRENDING_FOR_ITEMS[1].name === currentTrendingForItem.name && (
|
|
||||||
<Link
|
|
||||||
style={discoverStyle.customizeLink}
|
|
||||||
text={'Customize'}
|
|
||||||
onPress={() => this.setState({ showModalTagSelector: true })}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<TouchableOpacity
|
|
||||||
style={discoverStyle.tagSortBy}
|
|
||||||
onPress={() => this.setState({ showTrendingForPicker: true })}
|
|
||||||
>
|
|
||||||
<Text style={discoverStyle.tagSortText}>{currentTrendingForItem.label.split(' ')[0]}</Text>
|
|
||||||
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
|
|
||||||
</TouchableOpacity>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
}
|
|
||||||
style={discoverStyle.verticalClaimList}
|
style={discoverStyle.verticalClaimList}
|
||||||
orderBy={Constants.DEFAULT_ORDER_BY}
|
orderBy={orderBy}
|
||||||
trendingForAll={TRENDING_FOR_ITEMS[0].name === currentTrendingForItem.name}
|
tags={filteredForTags ? followedTags.map(tag => tag.name) : null}
|
||||||
tags={followedTags.map(tag => tag.name)}
|
time={timeItem.name}
|
||||||
time={null}
|
|
||||||
navigation={navigation}
|
navigation={navigation}
|
||||||
orientation={Constants.ORIENTATION_VERTICAL}
|
orientation={Constants.ORIENTATION_VERTICAL}
|
||||||
/>
|
/>
|
||||||
{!showModalTagSelector && <FloatingWalletBalance navigation={navigation} />}
|
{!showModalTagSelector && !showTrendingForPicker && !showSortPicker && !showTimePicker && (
|
||||||
|
<FloatingWalletBalance navigation={navigation} />
|
||||||
|
)}
|
||||||
{showModalTagSelector && (
|
{showModalTagSelector && (
|
||||||
<ModalTagSelector
|
<ModalTagSelector
|
||||||
onOverlayPress={() => this.setState({ showModalTagSelector: false })}
|
onOverlayPress={() => this.setState({ showModalTagSelector: false })}
|
||||||
@@ -108,13 +170,31 @@ class TrendingPage extends React.PureComponent {
|
|||||||
)}
|
)}
|
||||||
{showTrendingForPicker && (
|
{showTrendingForPicker && (
|
||||||
<ModalPicker
|
<ModalPicker
|
||||||
title={'Trending for'}
|
title={'Filter for'}
|
||||||
onOverlayPress={() => this.setState({ showTrendingForPicker: false })}
|
onOverlayPress={() => this.setState({ showTrendingForPicker: false })}
|
||||||
onItemSelected={this.handleTrendingForItemSelected}
|
onItemSelected={this.handleTrendingForItemSelected}
|
||||||
selectedItem={currentTrendingForItem}
|
selectedItem={currentTrendingForItem}
|
||||||
items={TRENDING_FOR_ITEMS}
|
items={TRENDING_FOR_ITEMS}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{showSortPicker && (
|
||||||
|
<ModalPicker
|
||||||
|
title={__('Sort content by')}
|
||||||
|
onOverlayPress={() => this.setState({ showSortPicker: false })}
|
||||||
|
onItemSelected={this.handleSortByItemSelected}
|
||||||
|
selectedItem={sortByItem}
|
||||||
|
items={Constants.CLAIM_SEARCH_SORT_BY_ITEMS}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{showTimePicker && (
|
||||||
|
<ModalPicker
|
||||||
|
title={__('Content from')}
|
||||||
|
onOverlayPress={() => this.setState({ showTimePicker: false })}
|
||||||
|
onItemSelected={this.handleTimeItemSelected}
|
||||||
|
selectedItem={timeItem}
|
||||||
|
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import {
|
|||||||
} from 'lbryinc';
|
} from 'lbryinc';
|
||||||
import { doSetClientSetting } from 'redux/actions/settings';
|
import { doSetClientSetting } from 'redux/actions/settings';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import Verification from './view';
|
import Verification from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
@@ -54,13 +54,13 @@ const select = state => ({
|
|||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
addUserEmail: email => dispatch(doUserEmailNew(email)),
|
addUserEmail: email => dispatch(doUserEmailNew(email)),
|
||||||
addUserPhone: (phone, country_code) => dispatch(doUserPhoneNew(phone, country_code)),
|
addUserPhone: (phone, countryCode) => dispatch(doUserPhoneNew(phone, countryCode)),
|
||||||
getSync: password => dispatch(doGetSync(password)),
|
getSync: password => dispatch(doGetSync(password)),
|
||||||
checkSync: () => dispatch(doCheckSync()),
|
checkSync: () => dispatch(doCheckSync()),
|
||||||
verifyPhone: verificationCode => dispatch(doUserPhoneVerify(verificationCode)),
|
verifyPhone: verificationCode => dispatch(doUserPhoneVerify(verificationCode)),
|
||||||
notify: data => dispatch(doToast(data)),
|
notify: data => dispatch(doToast(data)),
|
||||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||||
setDefaultAccount: () => dispatch(doSetDefaultAccount()),
|
setDefaultAccount: (success, failure) => dispatch(doSetDefaultAccount(success, failure)),
|
||||||
setEmailToVerify: email => dispatch(doUserEmailToVerify(email)),
|
setEmailToVerify: email => dispatch(doUserEmailToVerify(email)),
|
||||||
syncApply: (hash, data, password) => dispatch(doSyncApply(hash, data, password)),
|
syncApply: (hash, data, password) => dispatch(doSyncApply(hash, data, password)),
|
||||||
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
|
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Lbry } from 'lbry-redux';
|
import { Lbry } from 'lbry-redux';
|
||||||
import { ActivityIndicator, View, Text, TextInput } from 'react-native';
|
import { ActivityIndicator, NativeModules, View, Text, TextInput } from 'react-native';
|
||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import firstRunStyle from 'styles/firstRun';
|
import firstRunStyle from 'styles/firstRun';
|
||||||
import rewardStyle from 'styles/reward';
|
import rewardStyle from 'styles/reward';
|
||||||
|
|
||||||
@@ -44,11 +44,12 @@ class EmailVerifyPage extends React.PureComponent {
|
|||||||
notify({ message: String(emailNewErrorMessage), isError: true });
|
notify({ message: String(emailNewErrorMessage), isError: true });
|
||||||
this.setState({ verifyStarted: false });
|
this.setState({ verifyStarted: false });
|
||||||
} else {
|
} else {
|
||||||
|
NativeModules.Firebase.track('email_added', { email: this.state.email });
|
||||||
this.setState({ phase: Constants.PHASE_VERIFICATION });
|
this.setState({ phase: Constants.PHASE_VERIFICATION });
|
||||||
if (setEmailVerificationPhase) {
|
if (setEmailVerificationPhase) {
|
||||||
setEmailVerificationPhase(true);
|
setEmailVerificationPhase(true);
|
||||||
}
|
}
|
||||||
//notify({ message: 'Please follow the instructions in the email sent to your address to continue.' });
|
// notify({ message: 'Please follow the instructions in the email sent to your address to continue.' });
|
||||||
AsyncStorage.setItem(Constants.KEY_EMAIL_VERIFY_PENDING, 'true');
|
AsyncStorage.setItem(Constants.KEY_EMAIL_VERIFY_PENDING, 'true');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { BarPasswordStrengthDisplay } from 'react-native-password-strength-meter
|
|||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import firstRunStyle from 'styles/firstRun';
|
import firstRunStyle from 'styles/firstRun';
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import rewardStyle from 'styles/reward';
|
import rewardStyle from 'styles/reward';
|
||||||
@@ -62,11 +62,29 @@ class SyncVerifyPage extends React.PureComponent {
|
|||||||
} else {
|
} else {
|
||||||
// password successfully verified
|
// password successfully verified
|
||||||
if (NativeModules.UtilityModule) {
|
if (NativeModules.UtilityModule) {
|
||||||
NativeModules.UtilityModule.setSecureValue(Constants.KEY_FIRST_RUN_PASSWORD, this.state.password);
|
NativeModules.UtilityModule.setSecureValue(
|
||||||
|
Constants.KEY_FIRST_RUN_PASSWORD,
|
||||||
|
this.state.password ? this.state.password : ''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
setDefaultAccount();
|
setDefaultAccount(
|
||||||
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
|
() => {
|
||||||
navigation.goBack();
|
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.' })
|
||||||
|
);
|
||||||
|
},
|
||||||
|
err => {
|
||||||
|
notify({
|
||||||
|
message:
|
||||||
|
'The account restore operation could not be completed successfully. Please restart the app and try again.',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { ActivityIndicator, Linking, NativeModules, Text, TouchableOpacity, View
|
|||||||
import { NavigationActions, StackActions } from 'react-navigation';
|
import { NavigationActions, StackActions } from 'react-navigation';
|
||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import EmailVerifyPage from './internal/email-verify-page';
|
import EmailVerifyPage from './internal/email-verify-page';
|
||||||
import ManualVerifyPage from './internal/manual-verify-page';
|
import ManualVerifyPage from './internal/manual-verify-page';
|
||||||
import PhoneVerifyPage from './internal/phone-verify-page';
|
import PhoneVerifyPage from './internal/phone-verify-page';
|
||||||
@@ -29,6 +29,7 @@ class VerificationScreen extends React.PureComponent {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { user } = this.props;
|
const { user } = this.props;
|
||||||
this.checkVerificationStatus(user);
|
this.checkVerificationStatus(user);
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Verification');
|
||||||
}
|
}
|
||||||
|
|
||||||
setEmailVerificationPhase = value => {
|
setEmailVerificationPhase = value => {
|
||||||
@@ -68,6 +69,9 @@ class VerificationScreen extends React.PureComponent {
|
|||||||
if (this.state.isEmailVerified && this.state.isRewardApproved) {
|
if (this.state.isEmailVerified && this.state.isRewardApproved) {
|
||||||
// verification steps already completed
|
// verification steps already completed
|
||||||
// simply navigate back to the rewards page
|
// simply navigate back to the rewards page
|
||||||
|
if (user.primary_email) {
|
||||||
|
NativeModules.Firebase.track('reward_eligibility_completed', { email: user.primary_email });
|
||||||
|
}
|
||||||
navigation.goBack();
|
navigation.goBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import WalletSyncDriver from 'component/walletSyncDriver';
|
|||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import walletStyle from 'styles/wallet';
|
import walletStyle from 'styles/wallet';
|
||||||
|
|
||||||
class WalletPage extends React.PureComponent {
|
class WalletPage extends React.PureComponent {
|
||||||
@@ -17,7 +17,7 @@ class WalletPage extends React.PureComponent {
|
|||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -42,11 +42,12 @@ class WalletPage extends React.PureComponent {
|
|||||||
const { pushDrawerStack, setPlayerVisible } = this.props;
|
const { pushDrawerStack, setPlayerVisible } = this.props;
|
||||||
pushDrawerStack();
|
pushDrawerStack();
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
|
NativeModules.Firebase.setCurrentScreen('Wallet');
|
||||||
|
|
||||||
const { deviceWalletSynced, getSync, user } = this.props;
|
const { deviceWalletSynced, getSync, user } = this.props;
|
||||||
if (deviceWalletSynced && user && user.has_verified_email) {
|
if (deviceWalletSynced && user && user.has_verified_email) {
|
||||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => {
|
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => {
|
||||||
if (walletPassword && walletPassword.trim().length > 0) {
|
if (walletPassword) {
|
||||||
getSync(walletPassword);
|
getSync(walletPassword);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
|
||||||
export const doPushDrawerStack = routeName => dispatch =>
|
export const doPushDrawerStack = (routeName, params) => dispatch =>
|
||||||
dispatch({
|
dispatch({
|
||||||
type: Constants.ACTION_PUSH_DRAWER_STACK,
|
type: Constants.ACTION_PUSH_DRAWER_STACK,
|
||||||
data: routeName,
|
data: { routeName, params },
|
||||||
});
|
});
|
||||||
|
|
||||||
export const doPopDrawerStack = () => dispatch =>
|
export const doPopDrawerStack = () => dispatch =>
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
|
||||||
|
export const doUpdatePublishFormState = publishFormValue => dispatch =>
|
||||||
|
dispatch({
|
||||||
|
type: Constants.ACTION_UPDATE_PUBLISH_FORM_STATE,
|
||||||
|
data: { ...publishFormValue },
|
||||||
|
});
|
||||||
|
|
||||||
|
export const doUpdateChannelFormState = channelFormValue => dispatch =>
|
||||||
|
dispatch({
|
||||||
|
type: Constants.ACTION_UPDATE_CHANNEL_FORM_STATE,
|
||||||
|
data: { ...channelFormValue },
|
||||||
|
});
|
||||||
|
|
||||||
|
export const doClearPublishFormState = () => dispatch =>
|
||||||
|
dispatch({
|
||||||
|
type: Constants.ACTION_CLEAR_PUBLISH_FORM_STATE,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const doClearChannelFormState = () => dispatch =>
|
||||||
|
dispatch({
|
||||||
|
type: Constants.ACTION_CLEAR_CHANNEL_FORM_STATE,
|
||||||
|
});
|
||||||
@@ -88,7 +88,6 @@ export const doNativeSearch = (
|
|||||||
dispatch(batchActions(...actions));
|
dispatch(batchActions(...actions));
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
console.log(e);
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.SEARCH_FAIL,
|
type: ACTIONS.SEARCH_FAIL,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { ACTIONS } from 'lbry-redux';
|
import { ACTIONS } from 'lbry-redux';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
|
||||||
export function doSetClientSetting(key, value) {
|
export function doSetClientSetting(key, value) {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
@@ -15,3 +16,25 @@ export function doSetClientSetting(key, value) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function doSetSortByItem(item) {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch({
|
||||||
|
type: Constants.ACTION_SORT_BY_ITEM_CHANGED,
|
||||||
|
data: {
|
||||||
|
name: item.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function doSetTimeItem(item) {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch({
|
||||||
|
type: Constants.ACTION_TIME_ITEM_CHANGED,
|
||||||
|
data: {
|
||||||
|
name: item.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import Constants from 'constants';
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
|
||||||
const reducers = {};
|
const reducers = {};
|
||||||
const defaultState = {
|
const defaultState = {
|
||||||
stack: [Constants.DRAWER_ROUTE_DISCOVER], // Discover is always the first drawer route
|
stack: [{ route: Constants.DRAWER_ROUTE_DISCOVER, params: {} }], // Discover is always the first drawer route
|
||||||
playerVisible: false,
|
playerVisible: false,
|
||||||
currentRoute: null,
|
currentRoute: null,
|
||||||
};
|
};
|
||||||
@@ -13,11 +13,23 @@ reducers[Constants.ACTION_SET_PLAYER_VISIBLE] = (state, action) =>
|
|||||||
});
|
});
|
||||||
|
|
||||||
reducers[Constants.ACTION_PUSH_DRAWER_STACK] = (state, action) => {
|
reducers[Constants.ACTION_PUSH_DRAWER_STACK] = (state, action) => {
|
||||||
const routeName = action.data;
|
const { routeName, params } = action.data;
|
||||||
const newStack = state.stack.slice();
|
const newStack = state.stack.slice();
|
||||||
|
|
||||||
if (routeName !== newStack[newStack.length - 1]) {
|
const lastRoute = newStack[newStack.length - 1].route;
|
||||||
newStack.push(routeName);
|
let canPushStack = routeName !== lastRoute;
|
||||||
|
if (
|
||||||
|
lastRoute === Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM &&
|
||||||
|
routeName === Constants.DRAWER_ROUTE_CHANNEL_CREATOR
|
||||||
|
) {
|
||||||
|
canPushStack = false;
|
||||||
|
}
|
||||||
|
if (lastRoute === Constants.DRAWER_ROUTE_PUBLISH_FORM && routeName === Constants.DRAWER_ROUTE_PUBLISH) {
|
||||||
|
canPushStack = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canPushStack) {
|
||||||
|
newStack.push({ route: routeName, params });
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
|
||||||
|
const reducers = {};
|
||||||
|
const defaultState = {
|
||||||
|
channelFormValues: {},
|
||||||
|
publishFormValues: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
reducers[Constants.ACTION_UPDATE_PUBLISH_FORM_STATE] = (state, action) => {
|
||||||
|
const { data } = action;
|
||||||
|
const publishFormValues = Object.assign({}, state.publishFormValues);
|
||||||
|
const newPublishFormValues = Object.assign(publishFormValues, data);
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
publishFormValues: newPublishFormValues,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
reducers[Constants.ACTION_UPDATE_CHANNEL_FORM_STATE] = (state, action) => {
|
||||||
|
const { data } = action;
|
||||||
|
const channelFormValues = Object.assign({}, state.channelFormValues);
|
||||||
|
const newChannelFormValues = Object.assign(channelFormValues, data);
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
channelFormValues: newChannelFormValues,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
reducers[Constants.ACTION_CLEAR_PUBLISH_FORM_STATE] = state => {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
publishFormValues: {},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
reducers[Constants.ACTION_CLEAR_CHANNEL_FORM_STATE] = state => {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
channelFormValues: {},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function reducer(state = defaultState, action) {
|
||||||
|
const handler = reducers[action.type];
|
||||||
|
if (handler) return handler(state, action);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
import { ACTIONS } from 'lbry-redux';
|
import { ACTIONS } from 'lbry-redux';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
|
||||||
const reducers = {};
|
const reducers = {};
|
||||||
const defaultState = {
|
const defaultState = {
|
||||||
clientSettings: {},
|
clientSettings: {},
|
||||||
|
sortByItemName: Constants.SORT_BY_HOT,
|
||||||
|
timeItemName: Constants.TIME_WEEK,
|
||||||
};
|
};
|
||||||
|
|
||||||
reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => {
|
reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => {
|
||||||
@@ -16,6 +19,16 @@ reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
reducers[Constants.ACTION_SORT_BY_ITEM_CHANGED] = (state, action) =>
|
||||||
|
Object.assign({}, state, {
|
||||||
|
sortByItemName: action.data.name,
|
||||||
|
});
|
||||||
|
|
||||||
|
reducers[Constants.ACTION_TIME_ITEM_CHANGED] = (state, action) =>
|
||||||
|
Object.assign({}, state, {
|
||||||
|
timeItemName: action.data.name,
|
||||||
|
});
|
||||||
|
|
||||||
export default function reducer(state = defaultState, action) {
|
export default function reducer(state = defaultState, action) {
|
||||||
const handler = reducers[action.type];
|
const handler = reducers[action.type];
|
||||||
if (handler) return handler(state, action);
|
if (handler) return handler(state, action);
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { createSelector } from 'reselect';
|
||||||
|
|
||||||
|
export const selectState = state => state.form || {};
|
||||||
|
|
||||||
|
export const selectPublishFormState = createSelector(
|
||||||
|
selectState,
|
||||||
|
state => state.publishFormValues || {}
|
||||||
|
);
|
||||||
|
|
||||||
|
export const selectChannelFormState = createSelector(
|
||||||
|
selectState,
|
||||||
|
state => state.channelFormValues || {}
|
||||||
|
);
|
||||||
|
|
||||||
|
export const selectHasPublishFormState = createSelector(
|
||||||
|
selectPublishFormState,
|
||||||
|
values => Object.keys(values).length > 0
|
||||||
|
);
|
||||||
|
|
||||||
|
export const selectHasChannelFormState = createSelector(
|
||||||
|
selectChannelFormState,
|
||||||
|
values => Object.keys(values).length > 0
|
||||||
|
);
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { SETTINGS } from 'lbry-redux';
|
import { SETTINGS } from 'lbry-redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
|
import { getSortByItemForName, getTimeItemForName } from 'utils/helper';
|
||||||
|
|
||||||
const selectState = state => state.settings || {};
|
const selectState = state => state.settings || {};
|
||||||
|
|
||||||
@@ -13,6 +14,16 @@ export const selectClientSettings = createSelector(
|
|||||||
state => state.clientSettings || {}
|
state => state.clientSettings || {}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const selectSortByItem = createSelector(
|
||||||
|
selectState,
|
||||||
|
state => getSortByItemForName(state.sortByItemName)
|
||||||
|
);
|
||||||
|
|
||||||
|
export const selectTimeItem = createSelector(
|
||||||
|
selectState,
|
||||||
|
state => getTimeItemForName(state.timeItemName)
|
||||||
|
);
|
||||||
|
|
||||||
export const makeSelectClientSetting = setting =>
|
export const makeSelectClientSetting = setting =>
|
||||||
createSelector(
|
createSelector(
|
||||||
selectClientSettings,
|
selectClientSettings,
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
|
const autothumbStyle = StyleSheet.create({
|
||||||
|
autothumbPurple: {
|
||||||
|
backgroundColor: '#9c27b0',
|
||||||
|
},
|
||||||
|
autothumbDeepPurple: {
|
||||||
|
backgroundColor: '#5e35b1',
|
||||||
|
},
|
||||||
|
autothumbRed: {
|
||||||
|
backgroundColor: '#e53935',
|
||||||
|
},
|
||||||
|
autothumbPink: {
|
||||||
|
backgroundColor: '#e91e63',
|
||||||
|
},
|
||||||
|
autothumbIndigo: {
|
||||||
|
backgroundColor: '#3f51b5',
|
||||||
|
},
|
||||||
|
autothumbBlue: {
|
||||||
|
backgroundColor: '#2196f3',
|
||||||
|
},
|
||||||
|
autothumbLightBlue: {
|
||||||
|
backgroundColor: '#039be5',
|
||||||
|
},
|
||||||
|
autothumbCyan: {
|
||||||
|
backgroundColor: '#00acc1',
|
||||||
|
},
|
||||||
|
autothumbTeal: {
|
||||||
|
backgroundColor: '#009688',
|
||||||
|
},
|
||||||
|
autothumbGreen: {
|
||||||
|
backgroundColor: '#43a047',
|
||||||
|
},
|
||||||
|
autothumbYellow: {
|
||||||
|
backgroundColor: '#ffeb3b',
|
||||||
|
},
|
||||||
|
autothumbOrange: {
|
||||||
|
backgroundColor: '#ffa726',
|
||||||
|
},
|
||||||
|
autothumbAmber: {
|
||||||
|
backgroundColor: '#ffb300',
|
||||||
|
},
|
||||||
|
autothumbLime: {
|
||||||
|
backgroundColor: '#c0ca33',
|
||||||
|
},
|
||||||
|
autothumbLightGreen: {
|
||||||
|
backgroundColor: '#7cb342',
|
||||||
|
},
|
||||||
|
autothumbDeepOrange: {
|
||||||
|
backgroundColor: '#f4511e',
|
||||||
|
},
|
||||||
|
autothumbBrown: {
|
||||||
|
backgroundColor: '#6d4c41',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default autothumbStyle;
|
||||||
@@ -33,7 +33,7 @@ const buttonStyle = StyleSheet.create({
|
|||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
textWithIcon: {
|
textWithIcon: {
|
||||||
marginLeft: 8,
|
marginLeft: 4,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,259 @@
|
|||||||
|
import { Dimensions, StyleSheet } from 'react-native';
|
||||||
|
import Colors from './colors';
|
||||||
|
|
||||||
|
const screenDimension = Dimensions.get('window');
|
||||||
|
const screenWidth = screenDimension.width;
|
||||||
|
|
||||||
|
const channelCreatorStyle = StyleSheet.create({
|
||||||
|
card: {
|
||||||
|
backgroundColor: Colors.White,
|
||||||
|
marginTop: 16,
|
||||||
|
marginLeft: 16,
|
||||||
|
marginRight: 16,
|
||||||
|
padding: 16,
|
||||||
|
},
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: Colors.PageBackground,
|
||||||
|
},
|
||||||
|
channelPicker: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
height: 52,
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
bidRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
},
|
||||||
|
channelNameInput: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
paddingLeft: 20,
|
||||||
|
},
|
||||||
|
bidAmountInput: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
marginLeft: 16,
|
||||||
|
textAlign: 'right',
|
||||||
|
width: 80,
|
||||||
|
},
|
||||||
|
helpText: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 12,
|
||||||
|
},
|
||||||
|
channelTitleInput: {
|
||||||
|
marginBottom: 4,
|
||||||
|
},
|
||||||
|
createChannelContainer: {
|
||||||
|
marginTop: 60,
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
channelAt: {
|
||||||
|
position: 'absolute',
|
||||||
|
left: 4,
|
||||||
|
top: 13,
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
},
|
||||||
|
buttonContainer: {
|
||||||
|
marginTop: 24,
|
||||||
|
marginBottom: 16,
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
marginLeft: 16,
|
||||||
|
marginRight: 16,
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
cancelLink: {
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
|
createButton: {
|
||||||
|
backgroundColor: Colors.LbryGreen,
|
||||||
|
alignSelf: 'flex-end',
|
||||||
|
},
|
||||||
|
inlineError: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.Red,
|
||||||
|
marginTop: 2,
|
||||||
|
},
|
||||||
|
imageSelectors: {
|
||||||
|
width: '100%',
|
||||||
|
height: 160,
|
||||||
|
},
|
||||||
|
coverImageTouchArea: {
|
||||||
|
position: 'absolute',
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
top: 0,
|
||||||
|
bottom: 0,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
coverImage: {
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
},
|
||||||
|
avatarImageContainer: {
|
||||||
|
position: 'absolute',
|
||||||
|
left: screenWidth / 2 - 80 / 2,
|
||||||
|
bottom: -16,
|
||||||
|
width: 80,
|
||||||
|
height: 80,
|
||||||
|
borderRadius: 160,
|
||||||
|
overflow: 'hidden',
|
||||||
|
},
|
||||||
|
avatarTouchArea: {
|
||||||
|
width: 80,
|
||||||
|
height: 80,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
avatarImage: {
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
},
|
||||||
|
listFooter: {
|
||||||
|
marginTop: 24,
|
||||||
|
},
|
||||||
|
createChannelButton: {
|
||||||
|
backgroundColor: Colors.LbryGreen,
|
||||||
|
alignSelf: 'flex-start',
|
||||||
|
},
|
||||||
|
scrollContainer: {
|
||||||
|
marginTop: 60,
|
||||||
|
},
|
||||||
|
scrollPadding: {
|
||||||
|
padding: 16,
|
||||||
|
},
|
||||||
|
channelListItem: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
marginBottom: 16,
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
channelListTitle: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 18,
|
||||||
|
marginBottom: 4,
|
||||||
|
},
|
||||||
|
channelListName: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 14,
|
||||||
|
},
|
||||||
|
channelListAvatar: {
|
||||||
|
marginRight: 16,
|
||||||
|
width: 80,
|
||||||
|
height: 80,
|
||||||
|
borderRadius: 160,
|
||||||
|
overflow: 'hidden',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
selectedOverlay: {
|
||||||
|
position: 'absolute',
|
||||||
|
left: 0,
|
||||||
|
top: 0,
|
||||||
|
width: 80,
|
||||||
|
height: 80,
|
||||||
|
borderRadius: 160,
|
||||||
|
overflow: 'hidden',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
backgroundColor: '#000000aa',
|
||||||
|
},
|
||||||
|
listHeader: {
|
||||||
|
alignItems: 'center',
|
||||||
|
marginTop: 16,
|
||||||
|
marginBottom: 16,
|
||||||
|
},
|
||||||
|
textInputLayout: {
|
||||||
|
marginBottom: 4,
|
||||||
|
},
|
||||||
|
textInputTitle: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 12,
|
||||||
|
marginBottom: -10,
|
||||||
|
marginLeft: 4,
|
||||||
|
},
|
||||||
|
inputText: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
},
|
||||||
|
toggleContainer: {
|
||||||
|
marginTop: 24,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'flex-end',
|
||||||
|
},
|
||||||
|
modeLink: {
|
||||||
|
color: Colors.LbryGreen,
|
||||||
|
alignSelf: 'flex-end',
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
|
cardTitle: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 20,
|
||||||
|
marginBottom: 8,
|
||||||
|
},
|
||||||
|
tag: {
|
||||||
|
marginRight: 4,
|
||||||
|
marginBottom: 4,
|
||||||
|
},
|
||||||
|
tagList: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
},
|
||||||
|
editOverlay: {
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
borderRadius: 24,
|
||||||
|
position: 'absolute',
|
||||||
|
padding: 8,
|
||||||
|
left: 4,
|
||||||
|
bottom: 4,
|
||||||
|
backgroundColor: '#00000077',
|
||||||
|
},
|
||||||
|
thumbnailEditOverlay: {
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
borderRadius: 24,
|
||||||
|
position: 'absolute',
|
||||||
|
padding: 8,
|
||||||
|
left: 80 / 2 - 32 / 2,
|
||||||
|
bottom: 4,
|
||||||
|
backgroundColor: '#00000077',
|
||||||
|
},
|
||||||
|
editIcon: {
|
||||||
|
color: Colors.White,
|
||||||
|
fontFamily: 'Inter-UI-SemiBold',
|
||||||
|
fontSize: 12,
|
||||||
|
},
|
||||||
|
uploadProgress: {
|
||||||
|
alignItems: 'center',
|
||||||
|
borderRadius: 16,
|
||||||
|
flexDirection: 'row',
|
||||||
|
position: 'absolute',
|
||||||
|
top: 8,
|
||||||
|
right: 8,
|
||||||
|
backgroundColor: '#00000077',
|
||||||
|
paddingLeft: 8,
|
||||||
|
paddingRight: 8,
|
||||||
|
paddingTop: 4,
|
||||||
|
paddingBottom: 4,
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
uploadText: {
|
||||||
|
color: Colors.White,
|
||||||
|
fontFamily: 'Inter-UI-SemiBold',
|
||||||
|
fontSize: 12,
|
||||||
|
marginLeft: 4,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default channelCreatorStyle;
|
||||||
@@ -18,6 +18,8 @@ const channelIconStyle = StyleSheet.create({
|
|||||||
height: 80,
|
height: 80,
|
||||||
borderRadius: 160,
|
borderRadius: 160,
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
borderedThumbnailContainer: {
|
borderedThumbnailContainer: {
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
@@ -43,6 +45,11 @@ const channelIconStyle = StyleSheet.create({
|
|||||||
marginTop: 4,
|
marginTop: 4,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
},
|
},
|
||||||
|
autothumbCharacter: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 48,
|
||||||
|
color: Colors.White,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default channelIconStyle;
|
export default channelIconStyle;
|
||||||
@@ -31,13 +31,12 @@ const channelPageStyle = StyleSheet.create({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flexDirection: 'row',
|
padding: 24,
|
||||||
},
|
},
|
||||||
infoText: {
|
infoText: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
marginLeft: 10,
|
|
||||||
},
|
},
|
||||||
pageButtons: {
|
pageButtons: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
@@ -66,15 +65,21 @@ const channelPageStyle = StyleSheet.create({
|
|||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
},
|
},
|
||||||
|
subscribeButtonContainer: {
|
||||||
|
position: 'absolute',
|
||||||
|
flexDirection: 'row',
|
||||||
|
right: 8,
|
||||||
|
bottom: -90,
|
||||||
|
zIndex: 100,
|
||||||
|
},
|
||||||
subscribeButton: {
|
subscribeButton: {
|
||||||
alignSelf: 'flex-start',
|
alignSelf: 'flex-start',
|
||||||
backgroundColor: Colors.White,
|
backgroundColor: Colors.White,
|
||||||
paddingLeft: 16,
|
paddingLeft: 16,
|
||||||
paddingRight: 16,
|
paddingRight: 16,
|
||||||
position: 'absolute',
|
},
|
||||||
right: 8,
|
bellButton: {
|
||||||
bottom: -88,
|
marginLeft: 8,
|
||||||
zIndex: 100,
|
|
||||||
},
|
},
|
||||||
cover: {
|
cover: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
@@ -120,6 +125,7 @@ const channelPageStyle = StyleSheet.create({
|
|||||||
marginBottom: 24,
|
marginBottom: 24,
|
||||||
},
|
},
|
||||||
aboutScrollContent: {
|
aboutScrollContent: {
|
||||||
|
paddingTop: 52,
|
||||||
padding: 24,
|
padding: 24,
|
||||||
},
|
},
|
||||||
aboutTitle: {
|
aboutTitle: {
|
||||||
@@ -141,11 +147,28 @@ const channelPageStyle = StyleSheet.create({
|
|||||||
left: 24,
|
left: 24,
|
||||||
bottom: -40,
|
bottom: -40,
|
||||||
zIndex: 100,
|
zIndex: 100,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
avatarImage: {
|
avatarImage: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
},
|
},
|
||||||
|
listHeader: {
|
||||||
|
marginTop: 16,
|
||||||
|
marginBottom: 8,
|
||||||
|
marginLeft: 16,
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
|
claimList: {
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
claimListContent: {
|
||||||
|
paddingTop: 16,
|
||||||
|
},
|
||||||
|
actionButton: {
|
||||||
|
backgroundColor: Colors.White,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default channelPageStyle;
|
export default channelPageStyle;
|
||||||
@@ -65,6 +65,12 @@ const channelSelectorStyle = StyleSheet.create({
|
|||||||
createButton: {
|
createButton: {
|
||||||
backgroundColor: Colors.NextLbryGreen,
|
backgroundColor: Colors.NextLbryGreen,
|
||||||
},
|
},
|
||||||
|
inlineError: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.Red,
|
||||||
|
marginTop: 2,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default channelSelectorStyle;
|
export default channelSelectorStyle;
|
||||||
@@ -11,6 +11,13 @@ const claimListStyle = StyleSheet.create({
|
|||||||
verticalScrollContainer: {
|
verticalScrollContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
|
noContentText: {
|
||||||
|
color: Colors.DescriptionGrey,
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 14,
|
||||||
|
margin: 16,
|
||||||
|
textAlign: 'center',
|
||||||
|
},
|
||||||
verticalScrollPadding: {
|
verticalScrollPadding: {
|
||||||
paddingBottom: 16,
|
paddingBottom: 16,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const Colors = {
|
|||||||
BrighterLbryGreen: '#40b887',
|
BrighterLbryGreen: '#40b887',
|
||||||
NextLbryGreen: '#38d9a9',
|
NextLbryGreen: '#38d9a9',
|
||||||
TagGreen: '#e3f6f1',
|
TagGreen: '#e3f6f1',
|
||||||
|
TagGrape: '#da77f255',
|
||||||
LightGrey: '#cccccc',
|
LightGrey: '#cccccc',
|
||||||
LighterGrey: '#e5e5e5',
|
LighterGrey: '#e5e5e5',
|
||||||
Orange: '#ffbb00',
|
Orange: '#ffbb00',
|
||||||
|
|||||||
+97
-16
@@ -22,22 +22,35 @@ const discoverStyle = StyleSheet.create({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: Colors.PageBackground,
|
backgroundColor: Colors.PageBackground,
|
||||||
},
|
},
|
||||||
|
drawerContentArea: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: Colors.White,
|
||||||
|
},
|
||||||
drawerContentContainer: {
|
drawerContentContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
scrollContainer: {
|
scrollContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
|
listHeader: {
|
||||||
|
marginBottom: 8,
|
||||||
|
marginLeft: 16,
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
titleRow: {
|
titleRow: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
marginTop: 76,
|
marginTop: 76,
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
marginLeft: 16,
|
|
||||||
marginRight: 16,
|
|
||||||
},
|
},
|
||||||
rightTitleRow: {
|
pickerRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
marginBottom: 8,
|
||||||
|
},
|
||||||
|
leftPickerRow: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
@@ -48,7 +61,6 @@ const discoverStyle = StyleSheet.create({
|
|||||||
customizeLink: {
|
customizeLink: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
marginRight: 48,
|
|
||||||
},
|
},
|
||||||
trendingContainer: {
|
trendingContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@@ -76,6 +88,25 @@ const discoverStyle = StyleSheet.create({
|
|||||||
marginTop: 6,
|
marginTop: 6,
|
||||||
marginBottom: 6,
|
marginBottom: 6,
|
||||||
},
|
},
|
||||||
|
footer: {
|
||||||
|
marginTop: 12,
|
||||||
|
marginLeft: 16,
|
||||||
|
marginRight: 16,
|
||||||
|
marginBottom: 56,
|
||||||
|
},
|
||||||
|
footerTitle: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 20,
|
||||||
|
marginBottom: 10,
|
||||||
|
},
|
||||||
|
footerTags: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
},
|
||||||
|
footerTag: {
|
||||||
|
marginRight: 24,
|
||||||
|
marginBottom: 12,
|
||||||
|
},
|
||||||
categoryName: {
|
categoryName: {
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-UI-SemiBold',
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
@@ -121,6 +152,12 @@ const discoverStyle = StyleSheet.create({
|
|||||||
marginTop: 4,
|
marginTop: 4,
|
||||||
color: Colors.LbryGreen,
|
color: Colors.LbryGreen,
|
||||||
},
|
},
|
||||||
|
anonChannelName: {
|
||||||
|
fontFamily: 'Inter-UI-SemiBold',
|
||||||
|
fontSize: 12,
|
||||||
|
marginTop: 4,
|
||||||
|
color: Colors.DescriptionGrey,
|
||||||
|
},
|
||||||
downloadedIcon: {
|
downloadedIcon: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: 8,
|
right: 8,
|
||||||
@@ -142,14 +179,6 @@ const discoverStyle = StyleSheet.create({
|
|||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
color: '#0c604b',
|
color: '#0c604b',
|
||||||
},
|
},
|
||||||
drawerMenuButton: {
|
|
||||||
height: '100%',
|
|
||||||
justifyContent: 'center',
|
|
||||||
},
|
|
||||||
drawerHamburger: {
|
|
||||||
marginLeft: 16,
|
|
||||||
marginRight: 16,
|
|
||||||
},
|
|
||||||
rightHeaderIcon: {
|
rightHeaderIcon: {
|
||||||
marginRight: 16,
|
marginRight: 16,
|
||||||
},
|
},
|
||||||
@@ -163,8 +192,8 @@ const discoverStyle = StyleSheet.create({
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 0,
|
left: 0,
|
||||||
top: 0,
|
top: 0,
|
||||||
width: '100%',
|
right: 0,
|
||||||
height: '100%',
|
bottom: 0,
|
||||||
},
|
},
|
||||||
overlayText: {
|
overlayText: {
|
||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
@@ -178,7 +207,7 @@ const discoverStyle = StyleSheet.create({
|
|||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
},
|
},
|
||||||
rewardIcon: {
|
rewardIcon: {
|
||||||
color: Colors.Red,
|
color: Colors.NextLbryGreen,
|
||||||
flex: 0.1,
|
flex: 0.1,
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
marginTop: 6,
|
marginTop: 6,
|
||||||
@@ -241,7 +270,12 @@ const discoverStyle = StyleSheet.create({
|
|||||||
tagSortBy: {
|
tagSortBy: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
marginRight: 4,
|
marginRight: 24,
|
||||||
|
},
|
||||||
|
allTagSortBy: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginRight: 8,
|
||||||
},
|
},
|
||||||
tagTime: {
|
tagTime: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
@@ -255,6 +289,53 @@ const discoverStyle = StyleSheet.create({
|
|||||||
tagSortIcon: {
|
tagSortIcon: {
|
||||||
marginTop: -6,
|
marginTop: -6,
|
||||||
},
|
},
|
||||||
|
pickerLabel: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.DescriptionGrey,
|
||||||
|
marginRight: 6,
|
||||||
|
},
|
||||||
|
menuScrollContent: {
|
||||||
|
paddingTop: 16,
|
||||||
|
},
|
||||||
|
menuGroup: {
|
||||||
|
marginTop: 8,
|
||||||
|
marginBottom: 8,
|
||||||
|
},
|
||||||
|
menuGroupName: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.DescriptionGrey,
|
||||||
|
textTransform: 'uppercase',
|
||||||
|
marginBottom: 4,
|
||||||
|
marginLeft: 16,
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
|
menuItemTouchArea: {
|
||||||
|
flex: 1,
|
||||||
|
flexDirection: 'row',
|
||||||
|
paddingTop: 12,
|
||||||
|
paddingBottom: 12,
|
||||||
|
paddingLeft: 16,
|
||||||
|
paddingRight: 16,
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
menuItemTouchAreaFocused: {
|
||||||
|
backgroundColor: Colors.VeryLightGrey,
|
||||||
|
},
|
||||||
|
menuItemFocused: {
|
||||||
|
color: Colors.LbryGreen,
|
||||||
|
},
|
||||||
|
menuItemIcon: {
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
width: 24,
|
||||||
|
},
|
||||||
|
menuItem: {
|
||||||
|
marginLeft: 8,
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default discoverStyle;
|
export default discoverStyle;
|
||||||
+17
-33
@@ -15,39 +15,6 @@ const fileItemMediaStyle = StyleSheet.create({
|
|||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
fontSize: 40,
|
fontSize: 40,
|
||||||
},
|
},
|
||||||
autothumbPurple: {
|
|
||||||
backgroundColor: '#9c27b0',
|
|
||||||
},
|
|
||||||
autothumbRed: {
|
|
||||||
backgroundColor: '#e53935',
|
|
||||||
},
|
|
||||||
autothumbPink: {
|
|
||||||
backgroundColor: '#e91e63',
|
|
||||||
},
|
|
||||||
autothumbIndigo: {
|
|
||||||
backgroundColor: '#3f51b5',
|
|
||||||
},
|
|
||||||
autothumbBlue: {
|
|
||||||
backgroundColor: '#2196f3',
|
|
||||||
},
|
|
||||||
autothumbLightBlue: {
|
|
||||||
backgroundColor: '#039be5',
|
|
||||||
},
|
|
||||||
autothumbCyan: {
|
|
||||||
backgroundColor: '#00acc1',
|
|
||||||
},
|
|
||||||
autothumbTeal: {
|
|
||||||
backgroundColor: '#009688',
|
|
||||||
},
|
|
||||||
autothumbGreen: {
|
|
||||||
backgroundColor: '#43a047',
|
|
||||||
},
|
|
||||||
autothumbYellow: {
|
|
||||||
backgroundColor: '#ffeb3b',
|
|
||||||
},
|
|
||||||
autothumbOrange: {
|
|
||||||
backgroundColor: '#ffa726',
|
|
||||||
},
|
|
||||||
resolving: {
|
resolving: {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@@ -59,12 +26,29 @@ const fileItemMediaStyle = StyleSheet.create({
|
|||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
marginTop: 8,
|
marginTop: 8,
|
||||||
},
|
},
|
||||||
|
image: {
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
},
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: 200,
|
height: 200,
|
||||||
shadowColor: 'transparent',
|
shadowColor: 'transparent',
|
||||||
},
|
},
|
||||||
|
duration: {
|
||||||
|
backgroundColor: Colors.Black,
|
||||||
|
position: 'absolute',
|
||||||
|
right: 4,
|
||||||
|
bottom: 4,
|
||||||
|
paddingLeft: 2,
|
||||||
|
paddingRight: 2,
|
||||||
|
},
|
||||||
|
durationText: {
|
||||||
|
fontFamily: 'Inter-UI-SemiBold',
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.White,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default fileItemMediaStyle;
|
export default fileItemMediaStyle;
|
||||||
@@ -38,6 +38,16 @@ const fileListStyle = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
|
selectedOverlay: {
|
||||||
|
position: 'absolute',
|
||||||
|
left: 0,
|
||||||
|
top: 0,
|
||||||
|
width: thumbnailWidth,
|
||||||
|
height: thumbnailHeight,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
backgroundColor: '#000000aa',
|
||||||
|
},
|
||||||
title: {
|
title: {
|
||||||
fontFamily: 'Inter-UI-SemiBold',
|
fontFamily: 'Inter-UI-SemiBold',
|
||||||
fontSize: screenWidthPixels <= 720 ? 12 : 14,
|
fontSize: screenWidthPixels <= 720 ? 12 : 14,
|
||||||
@@ -95,6 +105,16 @@ const fileListStyle = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
|
titleContainer: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
|
rewardIcon: {
|
||||||
|
color: Colors.NextLbryGreen,
|
||||||
|
textAlign: 'right',
|
||||||
|
marginLeft: 4,
|
||||||
|
marginTop: 4,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default fileListStyle;
|
export default fileListStyle;
|
||||||
+10
-4
@@ -41,8 +41,8 @@ const filePageStyle = StyleSheet.create({
|
|||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
marginLeft: 16,
|
marginLeft: 24,
|
||||||
marginRight: 16,
|
marginRight: 24,
|
||||||
},
|
},
|
||||||
scrollContainer: {
|
scrollContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@@ -194,6 +194,10 @@ const filePageStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
fileActions: {
|
fileActions: {
|
||||||
alignSelf: 'flex-end',
|
alignSelf: 'flex-end',
|
||||||
|
flexDirection: 'row',
|
||||||
|
},
|
||||||
|
editButton: {
|
||||||
|
marginRight: 8,
|
||||||
},
|
},
|
||||||
socialActions: {
|
socialActions: {
|
||||||
alignSelf: 'flex-start',
|
alignSelf: 'flex-start',
|
||||||
@@ -289,6 +293,7 @@ const filePageStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
tipAmountInput: {
|
tipAmountInput: {
|
||||||
alignSelf: 'flex-start',
|
alignSelf: 'flex-start',
|
||||||
|
textAlign: 'right',
|
||||||
width: 80,
|
width: 80,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
letterSpacing: 1,
|
letterSpacing: 1,
|
||||||
@@ -353,8 +358,9 @@ const filePageStyle = StyleSheet.create({
|
|||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
rewardIcon: {
|
rewardIcon: {
|
||||||
color: Colors.White,
|
color: Colors.NextLbryGreen,
|
||||||
marginRight: 8,
|
marginTop: -8,
|
||||||
|
marginLeft: 8,
|
||||||
},
|
},
|
||||||
backButton: {
|
backButton: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ const firstRunStyle = StyleSheet.create({
|
|||||||
marginBottom: 24,
|
marginBottom: 24,
|
||||||
},
|
},
|
||||||
passwordWarningText: {
|
passwordWarningText: {
|
||||||
color: Colors.BrightRed,
|
color: Colors.NextLbryGreen,
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,13 +13,14 @@ const floatingButtonStyle = StyleSheet.create({
|
|||||||
container: {
|
container: {
|
||||||
zIndex: 100,
|
zIndex: 100,
|
||||||
borderRadius: 24,
|
borderRadius: 24,
|
||||||
padding: 14,
|
padding: 10,
|
||||||
paddingLeft: 20,
|
paddingLeft: 16,
|
||||||
paddingRight: 20,
|
paddingRight: 16,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
backgroundColor: Colors.LbryGreen,
|
backgroundColor: Colors.LbryGreen,
|
||||||
shadowColor: 'black',
|
shadowColor: Colors.Black,
|
||||||
shadowOpacity: 0.1,
|
shadowOpacity: 0.1,
|
||||||
shadowRadius: StyleSheet.hairlineWidth,
|
shadowRadius: StyleSheet.hairlineWidth,
|
||||||
shadowOffset: {
|
shadowOffset: {
|
||||||
@@ -29,10 +30,10 @@ const floatingButtonStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
pendingContainer: {
|
pendingContainer: {
|
||||||
borderRadius: 24,
|
borderRadius: 24,
|
||||||
padding: 14,
|
padding: 10,
|
||||||
paddingLeft: 20,
|
paddingLeft: 12,
|
||||||
paddingRight: 70,
|
paddingRight: 58,
|
||||||
marginRight: -60,
|
marginRight: -52,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
backgroundColor: Colors.BrighterLbryGreen,
|
backgroundColor: Colors.BrighterLbryGreen,
|
||||||
@@ -41,8 +42,8 @@ const floatingButtonStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
fontFamily: 'Inter-UI-Bold',
|
fontFamily: 'Inter-UI-SemiBold',
|
||||||
fontSize: 18,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
bottomRight: {
|
bottomRight: {
|
||||||
right: 10,
|
right: 10,
|
||||||
@@ -50,7 +51,12 @@ const floatingButtonStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
rewardIcon: {
|
rewardIcon: {
|
||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
marginRight: 4,
|
marginRight: 3,
|
||||||
|
},
|
||||||
|
balanceIcon: {
|
||||||
|
color: Colors.White,
|
||||||
|
marginRight: 3,
|
||||||
|
marginTop: -1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -96,12 +96,17 @@ const mediaPlayerStyle = StyleSheet.create({
|
|||||||
seekerCircle: {
|
seekerCircle: {
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
top: 14,
|
|
||||||
left: 15,
|
left: 15,
|
||||||
height: 12,
|
height: 12,
|
||||||
width: 12,
|
width: 12,
|
||||||
backgroundColor: Colors.LbryGreen,
|
backgroundColor: Colors.LbryGreen,
|
||||||
},
|
},
|
||||||
|
seekerCircleTop: {
|
||||||
|
top: 14,
|
||||||
|
},
|
||||||
|
seekerCircleTopFs: {
|
||||||
|
top: 15,
|
||||||
|
},
|
||||||
seekerHandle: {
|
seekerHandle: {
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
|||||||
+84
-15
@@ -16,7 +16,7 @@ const publishStyle = StyleSheet.create({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
galleryGridImage: {
|
galleryGridImage: {
|
||||||
width: 134,
|
width: '100%',
|
||||||
height: 90,
|
height: 90,
|
||||||
},
|
},
|
||||||
inputText: {
|
inputText: {
|
||||||
@@ -64,15 +64,20 @@ const publishStyle = StyleSheet.create({
|
|||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
},
|
},
|
||||||
record: {
|
record: {
|
||||||
backgroundColor: 'transparent',
|
|
||||||
flex: 0.5,
|
flex: 0.5,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
|
actionBackground: {
|
||||||
|
backgroundColor: Colors.Black,
|
||||||
|
},
|
||||||
|
transparentBackground: {
|
||||||
|
backgroundColor: 'transparent',
|
||||||
|
},
|
||||||
subActions: {
|
subActions: {
|
||||||
flex: 0.5,
|
flex: 0.5,
|
||||||
borderLeftWidth: 2,
|
borderLeftWidth: 2,
|
||||||
borderLeftColor: Colors.DarkerGrey,
|
borderLeftColor: Colors.DarkGrey,
|
||||||
},
|
},
|
||||||
actionText: {
|
actionText: {
|
||||||
color: Colors.White,
|
color: Colors.White,
|
||||||
@@ -81,8 +86,7 @@ const publishStyle = StyleSheet.create({
|
|||||||
marginTop: 8,
|
marginTop: 8,
|
||||||
},
|
},
|
||||||
photo: {
|
photo: {
|
||||||
backgroundColor: 'transparent',
|
height: 120,
|
||||||
height: 240,
|
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
@@ -90,7 +94,7 @@ const publishStyle = StyleSheet.create({
|
|||||||
backgroundColor: Colors.Black,
|
backgroundColor: Colors.Black,
|
||||||
height: 120,
|
height: 120,
|
||||||
borderTopWidth: 2,
|
borderTopWidth: 2,
|
||||||
borderTopColor: Colors.DarkerGrey,
|
borderTopColor: Colors.DarkGrey,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
@@ -114,6 +118,7 @@ const publishStyle = StyleSheet.create({
|
|||||||
width: 80,
|
width: 80,
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
|
textAlign: 'right',
|
||||||
},
|
},
|
||||||
currency: {
|
currency: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
@@ -143,6 +148,17 @@ const publishStyle = StyleSheet.create({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
|
},
|
||||||
|
loadingText: {
|
||||||
|
color: Colors.White,
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
marginLeft: 8,
|
||||||
|
},
|
||||||
|
listEmptyText: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
titleRow: {
|
titleRow: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
@@ -228,6 +244,9 @@ const publishStyle = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
},
|
},
|
||||||
|
backButtonControl: {
|
||||||
|
flex: 0.1,
|
||||||
|
},
|
||||||
mainControlsRow: {
|
mainControlsRow: {
|
||||||
flex: 0.8,
|
flex: 0.8,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
@@ -236,6 +255,7 @@ const publishStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
switchCameraToggle: {
|
switchCameraToggle: {
|
||||||
marginRight: 48,
|
marginRight: 48,
|
||||||
|
color: Colors.White,
|
||||||
},
|
},
|
||||||
cameraAction: {
|
cameraAction: {
|
||||||
width: 72,
|
width: 72,
|
||||||
@@ -266,6 +286,12 @@ const publishStyle = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
},
|
},
|
||||||
|
warning: {
|
||||||
|
marginTop: 24,
|
||||||
|
marginLeft: 16,
|
||||||
|
marginRight: 16,
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
rewardDriverCard: {
|
rewardDriverCard: {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
backgroundColor: Colors.BrighterLbryGreen,
|
backgroundColor: Colors.BrighterLbryGreen,
|
||||||
@@ -302,18 +328,24 @@ const publishStyle = StyleSheet.create({
|
|||||||
marginLeft: 4,
|
marginLeft: 4,
|
||||||
},
|
},
|
||||||
thumbnailUploadContainer: {
|
thumbnailUploadContainer: {
|
||||||
marginTop: 16,
|
|
||||||
marginLeft: 16,
|
|
||||||
marginRight: 16,
|
|
||||||
paddingLeft: 2,
|
|
||||||
paddingRight: 2,
|
|
||||||
flexDirection: 'row',
|
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
borderRadius: 16,
|
||||||
|
flexDirection: 'row',
|
||||||
|
position: 'absolute',
|
||||||
|
top: 8,
|
||||||
|
right: 8,
|
||||||
|
backgroundColor: '#00000077',
|
||||||
|
paddingLeft: 8,
|
||||||
|
paddingRight: 8,
|
||||||
|
paddingTop: 4,
|
||||||
|
paddingBottom: 4,
|
||||||
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
thumbnailUploadText: {
|
thumbnailUploadText: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
color: Colors.White,
|
||||||
fontSize: 14,
|
fontFamily: 'Inter-UI-SemiBold',
|
||||||
marginLeft: 8,
|
fontSize: 12,
|
||||||
|
marginLeft: 4,
|
||||||
},
|
},
|
||||||
toggleField: {
|
toggleField: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
@@ -326,6 +358,11 @@ const publishStyle = StyleSheet.create({
|
|||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
marginLeft: 8,
|
marginLeft: 8,
|
||||||
},
|
},
|
||||||
|
relativeCentered: {
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
padding: 16,
|
||||||
|
},
|
||||||
centered: {
|
centered: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 0,
|
left: 0,
|
||||||
@@ -335,6 +372,18 @@ const publishStyle = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
|
currencyPicker: {
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
fullCentered: {
|
||||||
|
position: 'absolute',
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
top: 0,
|
||||||
|
bottom: 0,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
noPublishes: {
|
noPublishes: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 0,
|
left: 0,
|
||||||
@@ -374,6 +423,26 @@ const publishStyle = StyleSheet.create({
|
|||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
|
cameraInfo: {
|
||||||
|
color: Colors.White,
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
},
|
||||||
|
warningText: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.DescriptionGrey,
|
||||||
|
},
|
||||||
|
publishesFooter: {
|
||||||
|
marginTop: 16,
|
||||||
|
marginLeft: 16,
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
|
publishesFooterButton: {
|
||||||
|
alignSelf: 'flex-start',
|
||||||
|
backgroundColor: Colors.LbryGreen,
|
||||||
|
marginTop: 16,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default publishStyle;
|
export default publishStyle;
|
||||||
@@ -12,6 +12,11 @@ const searchStyle = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
busyContainer: {
|
busyContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
position: 'absolute',
|
||||||
|
top: 60,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
bottom: 0,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -156,10 +156,18 @@ const subscriptionsStyle = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
},
|
},
|
||||||
|
pickerRow: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginLeft: 16,
|
||||||
|
marginRight: 16,
|
||||||
|
marginTop: 8,
|
||||||
|
marginBottom: 8,
|
||||||
|
},
|
||||||
tagSortBy: {
|
tagSortBy: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
marginRight: 4,
|
marginRight: 24,
|
||||||
},
|
},
|
||||||
tagSortText: {
|
tagSortText: {
|
||||||
fontFamily: 'Inter-UI-Regular',
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ const tagStyle = StyleSheet.create({
|
|||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
},
|
},
|
||||||
|
nsfwTagsContainer: {
|
||||||
|
marginTop: 8,
|
||||||
|
},
|
||||||
|
nsfwTagsTitle: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 16,
|
||||||
|
marginBottom: 4,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default tagStyle;
|
export default tagStyle;
|
||||||
@@ -17,6 +17,9 @@ const transactionListStyle = StyleSheet.create({
|
|||||||
topRow: {
|
topRow: {
|
||||||
marginBottom: 4,
|
marginBottom: 4,
|
||||||
},
|
},
|
||||||
|
leftCol: {
|
||||||
|
flex: 0.7,
|
||||||
|
},
|
||||||
col: {
|
col: {
|
||||||
alignSelf: 'stretch',
|
alignSelf: 'stretch',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ const uriBarStyle = StyleSheet.create({
|
|||||||
containerElevated: {
|
containerElevated: {
|
||||||
elevation: 4,
|
elevation: 4,
|
||||||
},
|
},
|
||||||
|
drawerHamburger: {
|
||||||
|
marginLeft: 16,
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
uriText: {
|
uriText: {
|
||||||
backgroundColor: Colors.VeryLightGrey,
|
backgroundColor: Colors.VeryLightGrey,
|
||||||
borderRadius: 24,
|
borderRadius: 24,
|
||||||
@@ -73,6 +77,39 @@ const uriBarStyle = StyleSheet.create({
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
flex: 3,
|
flex: 3,
|
||||||
},
|
},
|
||||||
|
selectionModeBar: {
|
||||||
|
flex: 1,
|
||||||
|
height: 46,
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
selectionModeLeftBar: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginLeft: 16,
|
||||||
|
},
|
||||||
|
selectionModeActions: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
|
backTouchArea: {
|
||||||
|
height: '100%',
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
leftAction: {
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
|
actionTouchArea: {
|
||||||
|
height: '100%',
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
itemCount: {
|
||||||
|
fontFamily: 'Inter-UI-Regular',
|
||||||
|
fontSize: 20,
|
||||||
|
marginLeft: 30,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default uriBarStyle;
|
export default uriBarStyle;
|
||||||
Loaded 100 of 102 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user