From f05d357fa7a201b6e80ee3a11ef24f1f859a0a6f Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Mon, 24 Feb 2020 15:20:03 +0100 Subject: [PATCH] Following rework (#124) * make following the default page. add suggested grd. * suggested grid vertical scrolling. semi-infinite scroll * search and related content fixes --- package-lock.json | 8 +- package.json | 4 +- src/component/AppNavigator.js | 27 ++--- src/component/drawerContent/view.js | 4 +- .../modalSuggestedSubscriptions/index.js | 7 +- .../modalSuggestedSubscriptions/view.js | 15 +-- src/component/subscribeButtonOverlay/index.js | 18 ++++ src/component/subscribeButtonOverlay/view.js | 36 +++++++ .../suggestedSubscriptionItem/index.js | 6 +- .../suggestedSubscriptionItem/view.js | 43 ++++---- .../suggestedSubscriptionsGrid/index.js | 30 ++++++ .../suggestedSubscriptionsGrid/view.js | 100 ++++++++++++++++++ src/component/tag/view.js | 6 +- src/page/discover/view.js | 4 +- src/page/search/index.js | 10 +- src/page/subscriptions/index.js | 7 +- src/page/subscriptions/view.js | 76 +++++++------ src/redux/reducers/drawer.js | 4 +- src/styles/modal.js | 12 +++ src/styles/subscriptions.js | 42 ++++++-- 20 files changed, 359 insertions(+), 100 deletions(-) create mode 100644 src/component/subscribeButtonOverlay/index.js create mode 100644 src/component/subscribeButtonOverlay/view.js create mode 100644 src/component/suggestedSubscriptionsGrid/index.js create mode 100644 src/component/suggestedSubscriptionsGrid/view.js diff --git a/package-lock.json b/package-lock.json index 5a36c0e..b8c3872 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7067,8 +7067,8 @@ } }, "lbry-redux": { - "version": "github:lbryio/lbry-redux#1de1d534c982db913f145a6171f39d7b8ebd61af", - "from": "github:lbryio/lbry-redux#1de1d534c982db913f145a6171f39d7b8ebd61af", + "version": "github:lbryio/lbry-redux#5c874e921769093428966fa7ecdf723719cb9067", + "from": "github:lbryio/lbry-redux#5c874e921769093428966fa7ecdf723719cb9067", "requires": { "proxy-polyfill": "0.1.6", "reselect": "^3.0.0", @@ -7076,8 +7076,8 @@ } }, "lbryinc": { - "version": "github:lbryio/lbryinc#138a053754ec8e3da8e9bf153d32f527c962f25c", - "from": "github:lbryio/lbryinc#138a053754ec8e3da8e9bf153d32f527c962f25c", + "version": "github:lbryio/lbryinc#0dc8829a319a708f45a855765f70a193ccb72676", + "from": "github:lbryio/lbryinc#0dc8829a319a708f45a855765f70a193ccb72676", "requires": { "reselect": "^3.0.0" } diff --git a/package.json b/package.json index 48ad368..22743f1 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "base-64": "^0.1.0", "@expo/vector-icons": "^8.1.0", "gfycat-style-urls": "^1.0.3", - "lbry-redux": "lbryio/lbry-redux#1de1d534c982db913f145a6171f39d7b8ebd61af", - "lbryinc": "lbryio/lbryinc#138a053754ec8e3da8e9bf153d32f527c962f25c", + "lbry-redux": "lbryio/lbry-redux#5c874e921769093428966fa7ecdf723719cb9067", + "lbryinc": "lbryio/lbryinc#0dc8829a319a708f45a855765f70a193ccb72676", "lodash": ">=4.17.11", "merge": ">=1.2.1", "moment": "^2.22.1", diff --git a/src/component/AppNavigator.js b/src/component/AppNavigator.js index db507e5..d119198 100644 --- a/src/component/AppNavigator.js +++ b/src/component/AppNavigator.js @@ -88,12 +88,13 @@ const menuNavigationButton = navigation => ( const discoverStack = createStackNavigator( { - Discover: { - screen: DiscoverPage, - navigationOptions: ({ navigation }) => ({ - title: 'Explore', + Subscriptions: { + screen: SubscriptionsPage, + navigationOptions: { + title: 'Following', header: null, - }), + drawerIcon: ({ tintColor }) => , + }, }, File: { screen: FilePage, @@ -160,10 +161,17 @@ const drawer = createDrawerNavigator( DiscoverStack: { screen: discoverStack, navigationOptions: { - title: 'Explore', + title: 'Following', drawerIcon: ({ tintColor }) => , }, }, + Discover: { + screen: DiscoverPage, + navigationOptions: ({ navigation }) => ({ + title: 'Your Tags', + header: null, + }), + }, Trending: { screen: TrendingPage, navigationOptions: { @@ -171,13 +179,6 @@ const drawer = createDrawerNavigator( drawerIcon: ({ tintColor }) => , }, }, - Subscriptions: { - screen: SubscriptionsPage, - navigationOptions: { - title: 'Subscriptions', - drawerIcon: ({ tintColor }) => , - }, - }, WalletStack: { screen: walletStack, navigationOptions: { diff --git a/src/component/drawerContent/view.js b/src/component/drawerContent/view.js index cdc2815..b8fa70d 100644 --- a/src/component/drawerContent/view.js +++ b/src/component/drawerContent/view.js @@ -9,8 +9,8 @@ import discoverStyle from 'styles/discover'; const groupedMenuItems = { 'Find content': [ - { icon: 'hashtag', label: 'Your Tags', route: Constants.DRAWER_ROUTE_DISCOVER }, { icon: 'heart', solid: true, label: 'Following', route: Constants.DRAWER_ROUTE_SUBSCRIPTIONS }, + { icon: 'hashtag', label: 'Your Tags', route: Constants.DRAWER_ROUTE_DISCOVER }, { icon: 'globe-americas', label: 'All Content', route: Constants.DRAWER_ROUTE_TRENDING }, ], 'Your content': [ @@ -145,7 +145,7 @@ class DrawerContent extends React.PureComponent { const focused = activeItemKey === item.route || (activeItemKey === Constants.FULL_ROUTE_NAME_DISCOVER && - item.route === Constants.DRAWER_ROUTE_DISCOVER) || + item.route === Constants.DRAWER_ROUTE_SUBSCRIPTIONS) || (activeItemKey === Constants.FULL_ROUTE_NAME_WALLET && item.route === Constants.DRAWER_ROUTE_WALLET); return ( diff --git a/src/component/modalSuggestedSubscriptions/index.js b/src/component/modalSuggestedSubscriptions/index.js index 6eef7f4..72f9c24 100644 --- a/src/component/modalSuggestedSubscriptions/index.js +++ b/src/component/modalSuggestedSubscriptions/index.js @@ -1,4 +1,9 @@ import { connect } from 'react-redux'; +import { selectFetchingClaimSearch } from 'lbry-redux'; import ModalSuggestedSubscriptions from './view'; -export default connect()(ModalSuggestedSubscriptions); +const select = state => ({ + loadingSuggested: selectFetchingClaimSearch(state), +}); + +export default connect(select)(ModalSuggestedSubscriptions); diff --git a/src/component/modalSuggestedSubscriptions/view.js b/src/component/modalSuggestedSubscriptions/view.js index d12e269..96f773e 100644 --- a/src/component/modalSuggestedSubscriptions/view.js +++ b/src/component/modalSuggestedSubscriptions/view.js @@ -1,23 +1,26 @@ import React from 'react'; -import { ScrollView, Text, TouchableOpacity, View } from 'react-native'; +import { ActivityIndicator, ScrollView, Text, TouchableOpacity, View } from 'react-native'; import modalStyle from 'styles/modal'; import subscriptionsStyle from 'styles/subscriptions'; import Button from 'component/button'; import Colors from 'styles/colors'; -import SuggestedSubscriptions from 'component/suggestedSubscriptions'; +import SuggestedSubscriptionsGrid from 'component/suggestedSubscriptionsGrid'; import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api import Icon from 'react-native-vector-icons/FontAwesome5'; export default class ModalSuggestedSubcriptions extends React.PureComponent { render() { - const { navigation, onDonePress, onOverlayPress } = this.props; + const { loadingSuggested, navigation, onDonePress, onOverlayPress } = this.props; return ( - - -