in src/views/inbox-threads/inbox-threads__item-comment.tsx [32:94]
export default function ThreadCommentItem({
group,
currentUser,
target,
onNavigate,
}: Props) {
const [isReactionPanelVisible, updateReactionPanelVisible] = useState(false);
if (!group.comment) {
return null;
}
const comment = firstActivityChange(group.comment as Activity) as IssueComment;
return (
<>
<ThreadItem
author={group.comment.author}
avatar={
<Avatar
userName={getEntityPresentation(group.comment.author)}
size={30}
source={{
uri: ApiHelper.convertRelativeUrl(
group.comment.author,
'avatarUrl',
getApi().config.backendUrl,
).avatarUrl,
}}
/>
}
avatarStyle={styles.avatarComment}
change={
<>
<StreamComment
activity={group.comment}
attachments={comment.attachments || []}
/>
<ThreadCommentReactions
activity={group.comment}
currentUser={currentUser}
isPanelVisible={isReactionPanelVisible}
/>
</>
}
group={group}
reason={i18n('commented')}
timestamp={group.comment.timestamp}
/>
<View style={styles.threadChangeActions}>
<TouchableOpacity
hitSlop={HIT_SLOP}
style={styles.threadButton}
onPress={() => {
onNavigate(target, group.comment?.id);
}}
>
<Text style={styles.threadButtonText}>{i18n('View comment')}</Text>
</TouchableOpacity>
<ThreadAddReactionButton
onPress={() => updateReactionPanelVisible(true)}
/>
</View>
</>
);
}