aboutsummaryrefslogtreecommitdiff
path: root/src/screens/profile/InviteFriendsScreen.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-20 16:44:12 -0400
committerIvan Chen <ivan@tagg.id>2021-04-20 16:44:12 -0400
commit2ee4ffc4c99f794941e9d3e2c7e47a145d89d83d (patch)
treea2fc1de1ad86b63fecba84b6737d44210d1bf125 /src/screens/profile/InviteFriendsScreen.tsx
parentfa39bb545fefefeea1a941c6610e6f072dba6f61 (diff)
added 5 invite limits
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) ||