From 6c776e005961ddd30af7e2f4b38f24225c6eb679 Mon Sep 17 00:00:00 2001 From: Joe Gambino Date: Tue, 22 Jun 2021 21:24:59 -0700 Subject: [PATCH] pass details obj --- src/pages/DetailsPage.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/pages/DetailsPage.js b/src/pages/DetailsPage.js index 7625db641fc7..937e8f0dbc93 100755 --- a/src/pages/DetailsPage.js +++ b/src/pages/DetailsPage.js @@ -42,18 +42,19 @@ const propTypes = { /** * Gets the phone number to display for SMS logins * - * @param {String} login - * @param {String} displayName + * @param {Object} details + * @param {String} details.login + * @param {String} details.displayName * @returns {String} */ -const getPhoneNumber = (login, displayName) => { +const getPhoneNumber = (details) => { // If the user hasn't set a displayName, it is set to their phone number, so use that - if (Str.isValidPhone(displayName)) { - return displayName; + if (Str.isValidPhone(details.displayName)) { + return details.displayName; } // If the user has set a displayName, get the phone number from the SMS login - return Str.removeSMSDomain(login); + return Str.removeSMSDomain(details.login); }; const DetailsPage = ({ @@ -104,7 +105,7 @@ const DetailsPage = ({ {isSMSLogin - ? toLocalPhone(getPhoneNumber(details.login, details.displayName)) + ? toLocalPhone(getPhoneNumber(details)) : details.login}