diff --git a/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListItem.test.tsx b/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListItem.test.tsx index c754b39cdad..2227028fc8c 100644 --- a/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListItem.test.tsx +++ b/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListItem.test.tsx @@ -9,7 +9,7 @@ const commonProps = { amount: '24', comment: 'Hey thanks for the loan, Ill pay you back ASAP. LOVE YOU', updatePaymentRequestStatus: jest.fn(), - requester: { + requestee: { kind: RecipientKind.MobileNumber, e164PhoneNumber: '5126608970', displayId: '5126608970', diff --git a/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListItem.tsx b/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListItem.tsx index eb0c1386099..039d939c5b2 100644 --- a/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListItem.tsx +++ b/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListItem.tsx @@ -17,7 +17,7 @@ import { getCentAwareMoneyDisplay } from 'src/utils/formatting' import Logger from 'src/utils/Logger' interface OwnProps { - requester: Recipient + requestee: Recipient amount: string comment: string id: string @@ -56,27 +56,23 @@ export class OutgoingPaymentRequestListItem extends React.Component { ] } - isDisplayingNumber = () => { - return this.props.requester.displayId !== this.props.requester.displayName - } - render() { - const { requester, t } = this.props + const { requestee, t } = this.props return ( } title={t('outgoingPaymentRequestNotificationTitle', { - name: requester.displayName, + name: requestee.displayName, amount: CURRENCIES[CURRENCY_ENUM.DOLLAR].symbol + getCentAwareMoneyDisplay(this.props.amount), })} diff --git a/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListScreen.tsx b/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListScreen.tsx index 236d8356965..a6a6c9975b9 100644 --- a/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListScreen.tsx +++ b/packages/mobile/src/paymentRequest/OutgoingPaymentRequestListScreen.tsx @@ -8,14 +8,18 @@ import { PaymentRequest } from 'src/account/types' import { updatePaymentRequestNotified, updatePaymentRequestStatus } from 'src/firebase/actions' import i18n, { Namespaces } from 'src/i18n' import { fetchPhoneAddresses } from 'src/identity/actions' -import { e164NumberToAddressSelector, E164NumberToAddressType } from 'src/identity/reducer' +import { + AddressToE164NumberType, + e164NumberToAddressSelector, + E164NumberToAddressType, +} from 'src/identity/reducer' import { NotificationList, titleWithBalanceNavigationOptions, useBalanceInNavigationParam, } from 'src/notifications/NotificationList' import OutgoingPaymentRequestListItem from 'src/paymentRequest/OutgoingPaymentRequestListItem' -import { getRecipientFromPaymentRequest } from 'src/paymentRequest/utils' +import { getSenderFromPaymentRequest } from 'src/paymentRequest/utils' import { NumberToRecipient } from 'src/recipients/recipient' import { recipientCacheSelector } from 'src/recipients/reducer' import { RootState } from 'src/redux/reducers' @@ -25,6 +29,7 @@ interface StateProps { paymentRequests: PaymentRequest[] e164PhoneNumberAddressMapping: E164NumberToAddressType recipientCache: NumberToRecipient + addressToE164Number: AddressToE164NumberType } interface DispatchProps { @@ -38,16 +43,22 @@ const mapStateToProps = (state: RootState): StateProps => ({ paymentRequests: getOutgoingPaymentRequests(state), e164PhoneNumberAddressMapping: e164NumberToAddressSelector(state), recipientCache: recipientCacheSelector(state), + addressToE164Number: state.identity.addressToE164Number, }) type Props = NavigationInjectedProps & WithNamespaces & StateProps & DispatchProps export const listItemRenderer = (params: { recipientCache: NumberToRecipient + addressToE164Number: AddressToE164NumberType updatePaymentRequestStatus: typeof updatePaymentRequestStatus updatePaymentRequestNotified: typeof updatePaymentRequestNotified }) => (request: PaymentRequest, key: number | undefined = undefined) => { - const requester = getRecipientFromPaymentRequest(request, params.recipientCache) + const requestee = getSenderFromPaymentRequest( + request, + params.addressToE164Number, + params.recipientCache + ) return ( diff --git a/packages/mobile/src/paymentRequest/OutgoingPaymentRequestSummaryNotification.tsx b/packages/mobile/src/paymentRequest/OutgoingPaymentRequestSummaryNotification.tsx index 12eef3f50d8..82c2d4f8bde 100644 --- a/packages/mobile/src/paymentRequest/OutgoingPaymentRequestSummaryNotification.tsx +++ b/packages/mobile/src/paymentRequest/OutgoingPaymentRequestSummaryNotification.tsx @@ -76,6 +76,7 @@ export class OutgoingPaymentRequestSummaryNotification extends React.Component