From f81a4e1a05ca3fa66c2798b047d4bfd6995f462d Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Thu, 18 Mar 2021 13:44:19 -0700 Subject: Support modified endpoints + refactoring --- src/screens/profile/InviteFriendsScreen.tsx | 32 +++++++++-------------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'src/screens') diff --git a/src/screens/profile/InviteFriendsScreen.tsx b/src/screens/profile/InviteFriendsScreen.tsx index 1a5de1ce..53215d8a 100644 --- a/src/screens/profile/InviteFriendsScreen.tsx +++ b/src/screens/profile/InviteFriendsScreen.tsx @@ -15,6 +15,7 @@ import { import {useDispatch, useStore} from 'react-redux'; import {ContactType, ProfilePreviewType, ScreenType} from '../../types'; import { + extractContacts, handleAddFriend, HeaderHeight, normalize, @@ -53,24 +54,6 @@ const InviteFriendsScreen: React.FC = ({ }); const [query, setQuery] = useState(''); - const extractContacts = async () => { - let retrievedContacts: Array = []; - await getAll().then((contacts) => { - contacts.map((contact) => { - let obj: ContactType = { - first_name: contact.givenName, - last_name: contact.familyName, - }; - contact.phoneNumbers.map(async (phoneNumber) => { - obj.phone_number = phoneNumber.number; - retrievedContacts.push(obj); - console.log('contact: ', obj); - }); - }); - }); - return retrievedContacts; - }; - useEffect(() => { const handleFindFriends = () => { extractContacts().then(async (retrievedContacts) => { @@ -190,7 +173,13 @@ const InviteFriendsScreen: React.FC = ({ - + Sharing is caring, invite friends, and create moments together! @@ -224,9 +213,7 @@ const InviteFriendsScreen: React.FC = ({ - - Add Friends - + Add Friends @@ -257,6 +244,7 @@ const styles = StyleSheet.create({ fontSize: normalize(12), fontWeight: '600', lineHeight: normalize(14.32), + marginBottom: '5%', }, container: { alignSelf: 'center', -- cgit v1.2.3-70-g09d2