From a2c89b47a135d83057b34d0b0b7a1fa7551e0ad2 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 17 May 2023 22:12:14 -0500 Subject: [PATCH] Add custom feed liked by screen --- src/Navigation.tsx | 9 ++- src/lib/routes/types.ts | 3 +- src/routes.ts | 1 + src/view/com/feeds/CustomFeed.tsx | 2 +- .../{ProfileCustomFeed.tsx => CustomFeed.tsx} | 80 +++---------------- src/view/screens/CustomFeedLikedBy.tsx | 29 +++++++ 6 files changed, 51 insertions(+), 73 deletions(-) rename src/view/screens/{ProfileCustomFeed.tsx => CustomFeed.tsx} (80%) create mode 100644 src/view/screens/CustomFeedLikedBy.tsx diff --git a/src/Navigation.tsx b/src/Navigation.tsx index ea36b0f2..d84167d6 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -40,7 +40,8 @@ import {SettingsScreen} from './view/screens/Settings' import {ProfileScreen} from './view/screens/Profile' import {ProfileFollowersScreen} from './view/screens/ProfileFollowers' import {ProfileFollowsScreen} from './view/screens/ProfileFollows' -import {ProfileCustomFeed} from './view/screens/ProfileCustomFeed' +import {CustomFeedScreen} from './view/screens/CustomFeed' +import {CustomFeedLikedByScreen} from './view/screens/CustomFeedLikedBy' import {ProfileListScreen} from './view/screens/ProfileList' import {PostThreadScreen} from './view/screens/PostThread' import {PostLikedByScreen} from './view/screens/PostLikedBy' @@ -126,7 +127,6 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) { title: title(`People followed by @${route.params.name}`), })} /> - ({title: title(`Post by @${route.params.name}`)})} /> + + { - navigation.navigate('ProfileCustomFeed', { + navigation.navigate('CustomFeed', { name: item.data.creator.did, rkey: new AtUri(item.data.uri).rkey, }) diff --git a/src/view/screens/ProfileCustomFeed.tsx b/src/view/screens/CustomFeed.tsx similarity index 80% rename from src/view/screens/ProfileCustomFeed.tsx rename to src/view/screens/CustomFeed.tsx index 68179830..9f7f8169 100644 --- a/src/view/screens/ProfileCustomFeed.tsx +++ b/src/view/screens/CustomFeed.tsx @@ -21,8 +21,8 @@ import {Text} from 'view/com/util/text/Text' import * as Toast from 'view/com/util/Toast' import {isDesktopWeb} from 'platform/detection' -type Props = NativeStackScreenProps -export const ProfileCustomFeed = withAuthRequired( +type Props = NativeStackScreenProps +export const CustomFeedScreen = withAuthRequired( observer(({route}: Props) => { const store = useStores() const pal = usePalette('default') @@ -146,10 +146,15 @@ export const ProfileCustomFeed = withAuthRequired( {currentFeed.data.description} ) : null} - - Liked by {currentFeed?.data.likeCount}{' '} - {pluralize(currentFeed?.data.likeCount || 0, 'user')} - + {isDesktopWeb && (