about summary refs log tree commit diff
path: root/src/view
diff options
context:
space:
mode:
Diffstat (limited to 'src/view')
-rw-r--r--src/view/com/modals/ContentLanguagesSettings.tsx4
-rw-r--r--src/view/com/pager/FeedsTabBar.web.tsx7
-rw-r--r--src/view/com/pager/FeedsTabBarMobile.tsx7
-rw-r--r--src/view/com/posts/CustomFeedEmptyState.tsx (renamed from src/view/com/posts/WhatsHotEmptyState.tsx)27
-rw-r--r--src/view/screens/Home.tsx35
5 files changed, 34 insertions, 46 deletions
diff --git a/src/view/com/modals/ContentLanguagesSettings.tsx b/src/view/com/modals/ContentLanguagesSettings.tsx
index 0c750fe0e..700f1cbcb 100644
--- a/src/view/com/modals/ContentLanguagesSettings.tsx
+++ b/src/view/com/modals/ContentLanguagesSettings.tsx
@@ -41,8 +41,8 @@ export function Component({}: {}) {
     <View testID="contentLanguagesModal" style={[pal.view, styles.container]}>
       <Text style={[pal.text, styles.title]}>Content Languages</Text>
       <Text style={[pal.text, styles.description]}>
-        Which languages would you like to see in the What's Hot feed? (Leave
-        them all unchecked to see any language.)
+        Which languages would you like to see in the your feed? (Leave them all
+        unchecked to see any language.)
       </Text>
       <ScrollView style={styles.scrollContainer}>
         {languages.map(lang => (
diff --git a/src/view/com/pager/FeedsTabBar.web.tsx b/src/view/com/pager/FeedsTabBar.web.tsx
index 56ca6f2a1..78937611b 100644
--- a/src/view/com/pager/FeedsTabBar.web.tsx
+++ b/src/view/com/pager/FeedsTabBar.web.tsx
@@ -28,12 +28,7 @@ const FeedsTabBarDesktop = observer(
   ) => {
     const store = useStores()
     const items = useMemo(
-      () => [
-        'Following',
-        "What's hot",
-        ...store.me.savedFeeds.pinnedFeedNames,
-        'My feeds',
-      ],
+      () => ['Following', ...store.me.savedFeeds.pinnedFeedNames, 'My feeds'],
       [store.me.savedFeeds.pinnedFeedNames],
     )
     const pal = usePalette('default')
diff --git a/src/view/com/pager/FeedsTabBarMobile.tsx b/src/view/com/pager/FeedsTabBarMobile.tsx
index cb910ccb9..a41f0ef32 100644
--- a/src/view/com/pager/FeedsTabBarMobile.tsx
+++ b/src/view/com/pager/FeedsTabBarMobile.tsx
@@ -33,12 +33,7 @@ export const FeedsTabBar = observer(
     }, [store])
 
     const items = useMemo(
-      () => [
-        'Following',
-        "What's hot",
-        ...store.me.savedFeeds.pinnedFeedNames,
-        'My feeds',
-      ],
+      () => ['Following', ...store.me.savedFeeds.pinnedFeedNames, 'My feeds'],
       [store.me.savedFeeds.pinnedFeedNames],
     )
 
diff --git a/src/view/com/posts/WhatsHotEmptyState.tsx b/src/view/com/posts/CustomFeedEmptyState.tsx
index ade94ca3f..69dd79902 100644
--- a/src/view/com/posts/WhatsHotEmptyState.tsx
+++ b/src/view/com/posts/CustomFeedEmptyState.tsx
@@ -1,5 +1,6 @@
 import React from 'react'
 import {StyleSheet, View} from 'react-native'
+import {useNavigation} from '@react-navigation/native'
 import {
   FontAwesomeIcon,
   FontAwesomeIconStyle,
@@ -7,14 +8,21 @@ import {
 import {Text} from '../util/text/Text'
 import {Button} from '../util/forms/Button'
 import {MagnifyingGlassIcon} from 'lib/icons'
+import {NavigationProp} from 'lib/routes/types'
 import {useStores} from 'state/index'
 import {usePalette} from 'lib/hooks/usePalette'
 import {s} from 'lib/styles'
 
-export function WhatsHotEmptyState() {
+export function CustomFeedEmptyState() {
   const pal = usePalette('default')
   const palInverted = usePalette('inverted')
   const store = useStores()
+  const navigation = useNavigation<NavigationProp>()
+
+  const onPressFindAccounts = React.useCallback(() => {
+    navigation.navigate('SearchTab')
+    navigation.popToTop()
+  }, [navigation])
 
   const onPressSettings = React.useCallback(() => {
     store.shell.openModal({name: 'content-languages-settings'})
@@ -26,9 +34,22 @@ export function WhatsHotEmptyState() {
         <MagnifyingGlassIcon style={[styles.emptyIcon, pal.text]} size={62} />
       </View>
       <Text type="xl-medium" style={[s.textCenter, pal.text]}>
-        Your What's Hot feed is empty! This is because there aren't enough users
-        posting in your selected language.
+        This feed is empty! You may need to follow more users or tune your
+        language settings.
       </Text>
+      <Button
+        type="inverted"
+        style={styles.emptyBtn}
+        onPress={onPressFindAccounts}>
+        <Text type="lg-medium" style={palInverted.text}>
+          Find accounts to follow
+        </Text>
+        <FontAwesomeIcon
+          icon="angle-right"
+          style={palInverted.text as FontAwesomeIconStyle}
+          size={14}
+        />
+      </Button>
       <Button type="inverted" style={styles.emptyBtn} onPress={onPressSettings}>
         <Text type="lg-medium" style={palInverted.text}>
           Update my settings
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx
index 54cec3b31..d761994f3 100644
--- a/src/view/screens/Home.tsx
+++ b/src/view/screens/Home.tsx
@@ -11,7 +11,7 @@ import {withAuthRequired} from 'view/com/auth/withAuthRequired'
 import {useTabFocusEffect} from 'lib/hooks/useTabFocusEffect'
 import {Feed} from '../com/posts/Feed'
 import {FollowingEmptyState} from 'view/com/posts/FollowingEmptyState'
-import {WhatsHotEmptyState} from 'view/com/posts/WhatsHotEmptyState'
+import {CustomFeedEmptyState} from 'view/com/posts/CustomFeedEmptyState'
 import {LoadLatestBtn} from '../com/util/load-latest/LoadLatestBtn'
 import {FeedsTabBar} from '../com/pager/FeedsTabBar'
 import {Pager, PagerRef, RenderTabBarFnProps} from 'view/com/pager/Pager'
@@ -34,15 +34,6 @@ export const HomeScreen = withAuthRequired(
     const pagerRef = React.useRef<PagerRef>(null)
     const [selectedPage, setSelectedPage] = React.useState(0)
     const [customFeeds, setCustomFeeds] = React.useState<PostsFeedModel[]>([])
-    const [initialLanguages] = React.useState(
-      store.preferences.contentLanguages,
-    )
-
-    const algoFeed: PostsFeedModel = React.useMemo(() => {
-      const feed = new PostsFeedModel(store, 'goodstuff', {})
-      feed.setup()
-      return feed
-    }, [store])
 
     React.useEffect(() => {
       const {pinned} = store.me.savedFeeds
@@ -66,13 +57,6 @@ export const HomeScreen = withAuthRequired(
       setCustomFeeds(feeds)
     }, [store, store.me.savedFeeds.pinned, customFeeds, setCustomFeeds])
 
-    React.useEffect(() => {
-      // refresh whats hot when lang preferences change
-      if (initialLanguages !== store.preferences.contentLanguages) {
-        algoFeed.refresh()
-      }
-    }, [initialLanguages, store.preferences.contentLanguages, algoFeed])
-
     useFocusEffect(
       React.useCallback(() => {
         store.shell.setMinimalShellMode(false)
@@ -113,8 +97,8 @@ export const HomeScreen = withAuthRequired(
       return <FollowingEmptyState />
     }, [])
 
-    const renderWhatsHotEmptyState = React.useCallback(() => {
-      return <WhatsHotEmptyState />
+    const renderCustomFeedEmptyState = React.useCallback(() => {
+      return <CustomFeedEmptyState />
     }, [])
 
     const initialPage = store.me.followsCount === 0 ? 1 : 0
@@ -133,26 +117,19 @@ export const HomeScreen = withAuthRequired(
           feed={store.me.mainFeed}
           renderEmptyState={renderFollowingEmptyState}
         />
-        <FeedPage
-          key="2"
-          testID="whatshotFeedPage"
-          isPageFocused={selectedPage === 1}
-          feed={algoFeed}
-          renderEmptyState={renderWhatsHotEmptyState}
-        />
         {customFeeds.map((f, index) => {
           return (
             <FeedPage
               key={(f.params as GetCustomFeed.QueryParams).feed}
               testID="customFeedPage"
-              isPageFocused={selectedPage === 2 + index}
+              isPageFocused={selectedPage === 1 + index}
               feed={f}
-              renderEmptyState={renderFollowingEmptyState}
+              renderEmptyState={renderCustomFeedEmptyState}
             />
           )
         })}
         <SavedFeeds
-          key={String(3 + store.me.savedFeeds.pinned.length)}
+          key={String(2 + store.me.savedFeeds.pinned.length)}
           headerOffset={HEADER_OFFSET}
           isPageFocused={selectedPage === 2 + store.me.savedFeeds.pinned.length}
         />