Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

checking list/feed owner on empty state when prompting to add users (#7247)

authored by

Ahmed Soliman and committed by
GitHub
1e4ea1a2 08a5f7a0

+32 -26
+32 -26
src/view/screens/ProfileList.tsx
··· 222 222 scrollElRef={scrollElRef as ListRef} 223 223 headerHeight={headerHeight} 224 224 isFocused={isScreenFocused && isFocused} 225 + isOwner={isOwner} 225 226 onPressAddUser={onPressAddUser} 226 227 /> 227 228 )} ··· 774 775 headerHeight: number 775 776 scrollElRef: ListRef 776 777 isFocused: boolean 778 + isOwner: boolean 777 779 onPressAddUser: () => void 778 780 } 779 781 const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( 780 782 function FeedSectionImpl( 781 - {feed, scrollElRef, headerHeight, isFocused, onPressAddUser}, 783 + {feed, scrollElRef, headerHeight, isFocused, isOwner, onPressAddUser}, 782 784 ref, 783 785 ) { 784 786 const queryClient = useQueryClient() ··· 810 812 return ( 811 813 <View style={[a.gap_xl, a.align_center]}> 812 814 <EmptyState icon="hashtag" message={_(msg`This feed is empty.`)} /> 813 - <NewButton 814 - label={_(msg`Start adding people`)} 815 - onPress={onPressAddUser} 816 - color="primary" 817 - size="small" 818 - variant="solid"> 819 - <ButtonIcon icon={PersonPlusIcon} /> 820 - <ButtonText> 821 - <Trans>Start adding people!</Trans> 822 - </ButtonText> 823 - </NewButton> 815 + {isOwner && ( 816 + <NewButton 817 + label={_(msg`Start adding people`)} 818 + onPress={onPressAddUser} 819 + color="primary" 820 + size="small" 821 + variant="solid"> 822 + <ButtonIcon icon={PersonPlusIcon} /> 823 + <ButtonText> 824 + <Trans>Start adding people!</Trans> 825 + </ButtonText> 826 + </NewButton> 827 + )} 824 828 </View> 825 829 ) 826 - }, [_, onPressAddUser]) 830 + }, [_, onPressAddUser, isOwner]) 827 831 828 832 return ( 829 833 <View> ··· 928 932 icon="users-slash" 929 933 message={_(msg`This list is empty.`)} 930 934 /> 931 - <NewButton 932 - testID="emptyStateAddUserBtn" 933 - label={_(msg`Start adding people`)} 934 - onPress={onPressAddUser} 935 - color="primary" 936 - size="small" 937 - variant="solid"> 938 - <ButtonIcon icon={PersonPlusIcon} /> 939 - <ButtonText> 940 - <Trans>Start adding people!</Trans> 941 - </ButtonText> 942 - </NewButton> 935 + {isOwner && ( 936 + <NewButton 937 + testID="emptyStateAddUserBtn" 938 + label={_(msg`Start adding people`)} 939 + onPress={onPressAddUser} 940 + color="primary" 941 + size="small" 942 + variant="solid"> 943 + <ButtonIcon icon={PersonPlusIcon} /> 944 + <ButtonText> 945 + <Trans>Start adding people!</Trans> 946 + </ButtonText> 947 + </NewButton> 948 + )} 943 949 </View> 944 950 ) 945 - }, [_, onPressAddUser]) 951 + }, [_, onPressAddUser, isOwner]) 946 952 947 953 return ( 948 954 <View>