diff options
author | Ivan Chen <ivan@tagg.id> | 2021-03-19 15:11:12 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-03-19 15:11:12 -0400 |
commit | b3f9bb5a67b88f04ac1b54293569a4d950f8b8c8 (patch) | |
tree | 906d3f6020c2817fe00cc4974fda17828bfc3f32 /src | |
parent | 853b92cce77bd84fd93806b6519afa4ac4dde508 (diff) |
actually using route params
Diffstat (limited to 'src')
-rw-r--r-- | src/components/profile/Friends.tsx | 1 | ||||
-rw-r--r-- | src/screens/profile/InviteFriendsScreen.tsx | 16 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/components/profile/Friends.tsx b/src/components/profile/Friends.tsx index d87b0fb0..8a24485f 100644 --- a/src/components/profile/Friends.tsx +++ b/src/components/profile/Friends.tsx @@ -65,7 +65,6 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => { <TouchableOpacity style={styles.addFriendButton} onPress={() => { - console.log('screentype: ', screenType); handleAddFriend(screenType, profilePreview, dispatch, state).then( (success) => { if (success) { diff --git a/src/screens/profile/InviteFriendsScreen.tsx b/src/screens/profile/InviteFriendsScreen.tsx index d1142b7f..36aa8ada 100644 --- a/src/screens/profile/InviteFriendsScreen.tsx +++ b/src/screens/profile/InviteFriendsScreen.tsx @@ -31,15 +31,21 @@ import Animated from 'react-native-reanimated'; import Icon from 'react-native-vector-icons/Feather'; import {InviteFriendTile} from '../../components/friends'; import {TAGG_LIGHT_BLUE} from '../../constants'; +import {MainStackParams} from '../../routes'; +import {RouteProp} from '@react-navigation/native'; const AnimatedIcon = Animated.createAnimatedComponent(Icon); +type InviteFriendsScreenRouteProp = RouteProp< + MainStackParams, + 'InviteFriendsScreen' +>; + interface InviteFriendsScreenProps { - screenType: ScreenType; + route: InviteFriendsScreenRouteProp; } -const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({ - screenType, -}) => { +const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({route}) => { + const {screenType} = route.params; const dispatch = useDispatch(); const state = useStore().getState(); const [usersFromContacts, setUsersFromContacts] = useState< @@ -64,7 +70,6 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({ let response = await usersFromContactsService(retrievedContacts); await setUsersFromContacts(response.existing_tagg_users); await setNonUsersFromContacts(response.invite_from_contacts); - usersFromContacts.map((user) => console.log('user: ', user.username)); setResults({ usersFromContacts: response.existing_tagg_users, nonUsersFromContacts: response.invite_from_contacts, @@ -81,7 +86,6 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({ * Main handler for changes in query. */ useEffect(() => { - console.log('query is now ', query); const search = async () => { if (query.length > 0) { const searchResultsUsers = usersFromContacts.filter( |