Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sharing/ShareToPm.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class ShareToPm extends React.Component<Props, State> {
}
const preview = [];
selectedRecipients.forEach(userId => {
preview.push(<UserItem userId={userId} onPress={() => {}} key={userId} />);
preview.push(<UserItem userId={userId} key={userId} />);
});
return preview;
};
Expand Down
17 changes: 9 additions & 8 deletions src/users/UserItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Props<UserT> = $ReadOnly<{|
isSelected: boolean,
showEmail: boolean,
unreadCount?: number,
onPress: UserT => void,
onPress?: UserT => void,
|}>;

/**
Expand All @@ -56,21 +56,22 @@ export class UserItemRaw<

handlePress = () => {
const { user, onPress } = this.props;
// TODO cut this `user.email` condition -- it should never trigger, and
// looks like a fudge for the possibility of data coming from
// the late NULL_USER
if (user.email && onPress) {
if (onPress) {
onPress(user);
}
};

render() {
const { user, isSelected, unreadCount, showEmail } = this.props;
const { user, isSelected, onPress, unreadCount, showEmail } = this.props;

return (
<Touchable onPress={this.handlePress}>
<Touchable onPress={onPress && this.handlePress}>
<View style={[styles.listItem, isSelected && componentStyles.selectedRow]}>
<UserAvatarWithPresenceById size={48} userId={user.user_id} onPress={this.handlePress} />
<UserAvatarWithPresenceById
size={48}
userId={user.user_id}
onPress={onPress && this.handlePress}
/>
<View style={componentStyles.textWrapper}>
<RawLabel
style={[componentStyles.text, isSelected && componentStyles.selectedText]}
Expand Down