diff --git a/src/autocomplete/PeopleAutocomplete.js b/src/autocomplete/PeopleAutocomplete.js index b82b2e3fd90..1a19088dfd4 100644 --- a/src/autocomplete/PeopleAutocomplete.js +++ b/src/autocomplete/PeopleAutocomplete.js @@ -11,7 +11,7 @@ import { getAutocompleteUserGroupSuggestions, } from '../users/userHelpers'; import { Popup } from '../common'; -import UserItem from '../users/UserItem'; +import { UserItemRaw } from '../users/UserItem'; import UserGroupItem from '../user-groups/UserGroupItem'; type Props = $ReadOnly<{| @@ -65,7 +65,11 @@ class PeopleAutocomplete extends PureComponent { { data: filteredUsers, renderItem: ({ item }) => ( - { data={recipients} keyExtractor={item => String(item)} renderItem={({ item }) => ( - + )} /> diff --git a/src/pm-conversations/PmConversationList.js b/src/pm-conversations/PmConversationList.js index a408565202f..093f185f422 100644 --- a/src/pm-conversations/PmConversationList.js +++ b/src/pm-conversations/PmConversationList.js @@ -47,7 +47,11 @@ export default class PmConversationList extends PureComponent { const users = item.keyRecipients; if (users.length === 1) { return ( - + ); } else { return ( diff --git a/src/reactions/MessageReactionList.js b/src/reactions/MessageReactionList.js index 0635814f801..6b9dd6ebd73 100644 --- a/src/reactions/MessageReactionList.js +++ b/src/reactions/MessageReactionList.js @@ -8,12 +8,11 @@ import * as NavigationService from '../nav/NavigationService'; import * as logging from '../utils/logging'; import ReactionUserList from './ReactionUserList'; import { connect } from '../react-redux'; -import type { Dispatch, EmojiType, Message, ReactionType, UserOrBot } from '../types'; +import type { Dispatch, EmojiType, Message, ReactionType } from '../types'; import { Screen, Label, RawLabel } from '../common'; import { getOwnUser } from '../selectors'; import aggregateReactions from './aggregateReactions'; import styles from '../styles'; -import { getAllUsersById } from '../users/userSelectors'; import { materialTopTabNavigatorConfig } from '../styles/tabs'; import Emoji from '../emoji/Emoji'; import { navigateBack } from '../nav/navActions'; @@ -30,7 +29,6 @@ const emojiTypeFromReactionType = (reactionType: ReactionType): EmojiType => { type SelectorProps = $ReadOnly<{| message: Message | void, ownUserId: number, - allUsersById: Map, |}>; type Props = $ReadOnly<{| @@ -68,7 +66,7 @@ class MessageReactionList extends PureComponent { } render() { - const { message, route, ownUserId, allUsersById } = this.props; + const { message, route, ownUserId } = this.props; const { reactionName } = route.params; const content: React$Node = (() => { @@ -110,12 +108,7 @@ class MessageReactionList extends PureComponent { ( - - )} + component={() => } options={{ tabBarLabel: () => ( @@ -147,5 +140,4 @@ export default connect((state, props) => ({ // message *can* be undefined; see componentDidUpdate for explanation and handling. message: state.messages.get(props.route.params.messageId), ownUserId: getOwnUser(state).user_id, - allUsersById: getAllUsersById(state), }))(MessageReactionList); diff --git a/src/reactions/ReactionUserList.js b/src/reactions/ReactionUserList.js index 3a4758f0f47..5b8c91dd16c 100644 --- a/src/reactions/ReactionUserList.js +++ b/src/reactions/ReactionUserList.js @@ -11,7 +11,6 @@ import { navigateToAccountDetails } from '../actions'; type Props = $ReadOnly<{| dispatch: Dispatch, reactedUserIds: $ReadOnlyArray, - allUsersById: Map, |}>; /** @@ -25,19 +24,13 @@ class ReactionUserList extends PureComponent { }; render() { - const { reactedUserIds, allUsersById } = this.props; + const { reactedUserIds } = this.props; return ( `${userId}`} - renderItem={({ item }) => { - const user = allUsersById.get(item); - if (!user) { - return null; - } - return ; - }} + renderItem={({ item }) => } /> ); } diff --git a/src/sharing/ChooseRecipientsScreen.js b/src/sharing/ChooseRecipientsScreen.js index 3a25f4caa59..32ed51bf386 100644 --- a/src/sharing/ChooseRecipientsScreen.js +++ b/src/sharing/ChooseRecipientsScreen.js @@ -7,7 +7,7 @@ import UserPickerCard from '../user-picker/UserPickerCard'; type Props = $ReadOnly<{| dispatch: Dispatch, - onComplete: (User[]) => void, + onComplete: ($ReadOnlyArray) => void, |}>; type State = {| @@ -23,7 +23,7 @@ class ChooseRecipientsScreen extends PureComponent { handleComplete = (selected: Array) => { const { onComplete } = this.props; - onComplete(selected); + onComplete(selected.map(u => u.user_id)); }; render() { diff --git a/src/sharing/ShareToPm.js b/src/sharing/ShareToPm.js index 8e0b26abd30..815b436df6e 100644 --- a/src/sharing/ShareToPm.js +++ b/src/sharing/ShareToPm.js @@ -4,7 +4,7 @@ import { View, Image, ScrollView, Modal, BackHandler } from 'react-native'; import type { SharingNavigationProp, SharingRouteProp } from './SharingScreen'; import * as NavigationService from '../nav/NavigationService'; -import type { Dispatch, User, Auth, GetText } from '../types'; +import type { Dispatch, Auth, GetText } from '../types'; import { createStyleSheet } from '../styles'; import { TranslationContext } from '../boot/TranslationProvider'; import { connect } from '../react-redux'; @@ -63,7 +63,7 @@ type Props = $ReadOnly<{| |}>; type State = $ReadOnly<{| - selectedRecipients: User[], + selectedRecipients: $ReadOnlyArray, message: string, choosingRecipients: boolean, sending: boolean, @@ -91,7 +91,7 @@ class ShareToPm extends React.Component { this.setState({ sending: true }); }; - handleChooseRecipients = (selectedRecipients: Array) => { + handleChooseRecipients = selectedRecipients => { this.setState({ selectedRecipients }); this.setState({ choosingRecipients: false }); }; @@ -135,8 +135,8 @@ class ShareToPm extends React.Component { return