aboutsummaryrefslogtreecommitdiff
path: root/src/screens/profile/InviteFriendsScreen.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-21 15:43:03 -0400
committerIvan Chen <ivan@tagg.id>2021-04-21 15:43:03 -0400
commit0dd0a4ac4343df036a1f16cbde070c524405bd21 (patch)
tree292a30ce0228560720214645805deb4b89f2eeae /src/screens/profile/InviteFriendsScreen.tsx
parent5c438df5f6787cdc6c393873a98590cc827667b9 (diff)
parent4e8e1c0d58424e6b63cfb8470fc0a73c0e6b102b (diff)
Merge branch 'master' into hotfix-linting-fixup
# Conflicts: # .eslintrc.js # src/components/notifications/Notification.tsx # src/screens/onboarding/legacy/SocialMedia.tsx # src/screens/onboarding/legacy/WaitlistSuccessScreen.tsx # src/screens/profile/CategorySelection.tsx
Diffstat (limited to 'src/screens/profile/InviteFriendsScreen.tsx')
-rw-r--r--src/screens/profile/InviteFriendsScreen.tsx17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/screens/profile/InviteFriendsScreen.tsx b/src/screens/profile/InviteFriendsScreen.tsx
index ad9e382e..e1f739c5 100644
--- a/src/screens/profile/InviteFriendsScreen.tsx
+++ b/src/screens/profile/InviteFriendsScreen.tsx
@@ -36,6 +36,17 @@ import {MainStackParams} from '../../routes';
import {RouteProp} from '@react-navigation/native';
const AnimatedIcon = Animated.createAnimatedComponent(Icon);
+export type InviteContactType = {
+ firstName: string;
+ lastName: string;
+ phoneNumber: string;
+};
+
+type SearchResultType = {
+ usersFromContacts: ProfilePreviewType[];
+ nonUsersFromContacts: InviteContactType[];
+};
+
type InviteFriendsScreenRouteProp = RouteProp<
MainStackParams,
'InviteFriendsScreen'
@@ -53,10 +64,6 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({route}) => {
ProfilePreviewType[]
>([]);
const [nonUsersFromContacts, setNonUsersFromContacts] = useState<[]>([]);
- type SearchResultType = {
- usersFromContacts: ProfilePreviewType[];
- nonUsersFromContacts: [];
- };
const [results, setResults] = useState<SearchResultType>({
usersFromContacts: usersFromContacts,
nonUsersFromContacts: nonUsersFromContacts,
@@ -98,7 +105,7 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({route}) => {
item.last_name.toLowerCase().startsWith(query),
);
const searchResultsNonUsers = nonUsersFromContacts.filter(
- (item) =>
+ (item: InviteContactType) =>
(item.firstName + ' ' + item.lastName)
.toLowerCase()
.startsWith(query) ||