Skip to content

Commit

Permalink
fix x collectors admired this copy count (#1695)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitoo1 authored Jul 13, 2023
1 parent 44c33d5 commit cabcb6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 5 additions & 4 deletions apps/mobile/src/components/Feed/Socialize/AdmireLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import { MainTabStackNavigatorProp } from '~/navigation/types';
type AdmireLineProps = {
style?: ViewProps['style'];
userRefs: AdmireLineFragment$key;
totalAdmires: number;

onMultiUserPress: () => void;
};

export function AdmireLine({ userRefs, onMultiUserPress, style }: AdmireLineProps) {
export function AdmireLine({ userRefs, totalAdmires, onMultiUserPress, style }: AdmireLineProps) {
const users = useFragment(
graphql`
fragment AdmireLineFragment on GalleryUser @relay(plural: true) {
Expand All @@ -29,7 +30,7 @@ export function AdmireLine({ userRefs, onMultiUserPress, style }: AdmireLineProp
const navigation = useNavigation<MainTabStackNavigatorProp>();

const [firstUser] = users;
if (users.length === 1 && firstUser) {
if (totalAdmires === 1 && firstUser) {
function handleUserPress() {
if (firstUser?.username) {
navigation.push('Profile', { username: firstUser.username, hideBackButton: false });
Expand All @@ -54,7 +55,7 @@ export function AdmireLine({ userRefs, onMultiUserPress, style }: AdmireLineProp
</Typography>
</View>
);
} else if (users.length > 1) {
} else if (totalAdmires > 1) {
return (
<View style={style} className="flex flex-row items-center">
<GalleryTouchableOpacity
Expand All @@ -63,7 +64,7 @@ export function AdmireLine({ userRefs, onMultiUserPress, style }: AdmireLineProp
eventName={'AdmireLine Single User'}
>
<Typography className="text-xs" font={{ family: 'ABCDiatype', weight: 'Bold' }}>
{users.length} collectors{' '}
{totalAdmires} collectors{' '}
</Typography>
</GalleryTouchableOpacity>

Expand Down
6 changes: 5 additions & 1 deletion apps/mobile/src/components/Feed/Socialize/Interactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ export function Interactions({ eventRef }: Props) {
totalCount={totalAdmires}
/>

<AdmireLine onMultiUserPress={handleSeeAllAdmires} userRefs={admireUsers} />
<AdmireLine
onMultiUserPress={handleSeeAllAdmires}
userRefs={admireUsers}
totalAdmires={totalAdmires}
/>
</View>

{previewComments.map((comment) => {
Expand Down

0 comments on commit cabcb6f

Please sign in to comment.