Skip to content

Commit

Permalink
fix(activity): add copy boost parent txId
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr authored and limpbrains committed Jul 25, 2024
1 parent d35de01 commit e157d15
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions src/screens/Activity/ActivityDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,16 @@ const OnchainActivityDetail = ({
return boostedParents.length > 0;
}, [boostedParents.length]);

const handleBoostParentPress = useCallback(
(parentTxId) => {
const activityItem = activityItems.find((i) => {
return (
i.activityType === EActivityType.onchain && i.txId === parentTxId
);
});
if (activityItem) {
navigation.push('ActivityDetail', { id: activityItem.id });
}
},
[activityItems, navigation],
);
const handleBoostParentPress = (parentTxId): void => {
const activityItem = activityItems.find((i) => {
return i.activityType === EActivityType.onchain && i.txId === parentTxId;
});
if (activityItem) {
navigation.push('ActivityDetail', { id: activityItem.id });
} else {
onCopy(parentTxId);
}
};

const handleBoost = (): void => {
showBottomSheet('boostPrompt', { onchainActivityItem: item });
Expand Down Expand Up @@ -628,20 +625,20 @@ const OnchainActivityDetail = ({

return (
<View key={parent} style={styles.sectionContainer}>
<Section
title={title}
value={
<TouchableOpacity
activeOpacity={0.7}
onPress={(): void => {
handleBoostParentPress(parent);
}}>
<TouchableOpacity
activeOpacity={0.7}
onPress={(): void => {
handleBoostParentPress(parent);
}}>
<Section
title={title}
value={
<BodySSB numberOfLines={1} ellipsizeMode="middle">
{parent}
</BodySSB>
</TouchableOpacity>
}
/>
}
/>
</TouchableOpacity>
</View>
);
})}
Expand Down

0 comments on commit e157d15

Please sign in to comment.