From 8150101c41e63fae3e456fd285791ccfd253ef55 Mon Sep 17 00:00:00 2001 From: Ahmed Soliman Date: Sun, 22 Dec 2024 14:40:40 -0500 Subject: [PATCH] checking list/feed owner on empty state when prompting to add users --- src/view/screens/ProfileList.tsx | 58 ++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/src/view/screens/ProfileList.tsx b/src/view/screens/ProfileList.tsx index 788f41c559..4558a907b0 100644 --- a/src/view/screens/ProfileList.tsx +++ b/src/view/screens/ProfileList.tsx @@ -222,6 +222,7 @@ function ProfileListScreenLoaded({ scrollElRef={scrollElRef as ListRef} headerHeight={headerHeight} isFocused={isScreenFocused && isFocused} + isOwner={isOwner} onPressAddUser={onPressAddUser} /> )} @@ -774,11 +775,12 @@ interface FeedSectionProps { headerHeight: number scrollElRef: ListRef isFocused: boolean + isOwner: boolean onPressAddUser: () => void } const FeedSection = React.forwardRef( function FeedSectionImpl( - {feed, scrollElRef, headerHeight, isFocused, onPressAddUser}, + {feed, scrollElRef, headerHeight, isFocused, isOwner, onPressAddUser}, ref, ) { const queryClient = useQueryClient() @@ -810,20 +812,22 @@ const FeedSection = React.forwardRef( return ( - - - - Start adding people! - - + {isOwner && ( + + + + Start adding people! + + + )} ) - }, [_, onPressAddUser]) + }, [_, onPressAddUser, isOwner]) return ( @@ -928,21 +932,23 @@ const AboutSection = React.forwardRef( icon="users-slash" message={_(msg`This list is empty.`)} /> - - - - Start adding people! - - + {isOwner && ( + + + + Start adding people! + + + )} ) - }, [_, onPressAddUser]) + }, [_, onPressAddUser, isOwner]) return (