diff options
author | Shravya Ramesh <shravs1208@gmail.com> | 2021-03-18 13:44:19 -0700 |
---|---|---|
committer | Shravya Ramesh <shravs1208@gmail.com> | 2021-03-18 13:44:19 -0700 |
commit | f81a4e1a05ca3fa66c2798b047d4bfd6995f462d (patch) | |
tree | fe9507ce9fe8076d12cbf53da576bedcd46c65a5 /src/screens/profile/InviteFriendsScreen.tsx | |
parent | a44e8d02c117783c19618d3af204299ae5c7a9ff (diff) |
Support modified endpoints + refactoring
Diffstat (limited to 'src/screens/profile/InviteFriendsScreen.tsx')
-rw-r--r-- | src/screens/profile/InviteFriendsScreen.tsx | 32 |
1 files changed, 10 insertions, 22 deletions
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<InviteFriendsScreenProps> = ({ }); const [query, setQuery] = useState(''); - const extractContacts = async () => { - let retrievedContacts: Array<ContactType> = []; - 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<InviteFriendsScreenProps> = ({ <SafeAreaView> <StatusBar barStyle="dark-content" /> <View style={styles.body}> - <View style={{width: 319, height: 42, alignSelf: 'center', marginBottom: '2%',}}> + <View + style={{ + width: 319, + height: 42, + alignSelf: 'center', + marginBottom: '2%', + }}> <Text style={[styles.subheaderText, {textAlign: 'center'}]}> Sharing is caring, invite friends, and create moments together! </Text> @@ -224,9 +213,7 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({ </Animated.View> </View> <View style={styles.subheader}> - <Text style={[styles.subheaderText, {marginBottom: '5%'}]}> - Add Friends - </Text> + <Text style={styles.subheaderText}>Add Friends</Text> <UsersFromContacts /> </View> <View style={styles.subheader}> @@ -257,6 +244,7 @@ const styles = StyleSheet.create({ fontSize: normalize(12), fontWeight: '600', lineHeight: normalize(14.32), + marginBottom: '5%', }, container: { alignSelf: 'center', |