From 0a002ac9f9dc51aa1c353a65bc96d33e3c5c5f0f Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Mon, 8 Feb 2021 19:01:14 -0800 Subject: Added SP screen to nav bar and main stack --- src/components/common/NavigationIcon.tsx | 13 ++++++++++++- src/routes/main/MainStackNavigator.tsx | 3 +++ src/routes/main/MainStackScreen.tsx | 12 ++++++++++++ src/routes/tabs/NavigationBar.tsx | 9 +++++++++ src/screens/index.ts | 1 + src/screens/suggestedPeople/index.ts | 1 + src/types/types.ts | 1 + 7 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/screens/suggestedPeople/index.ts (limited to 'src') diff --git a/src/components/common/NavigationIcon.tsx b/src/components/common/NavigationIcon.tsx index 4bf35360..1a9934f2 100644 --- a/src/components/common/NavigationIcon.tsx +++ b/src/components/common/NavigationIcon.tsx @@ -8,7 +8,13 @@ import { } from 'react-native'; interface NavigationIconProps extends TouchableOpacityProps { - tab: 'Home' | 'Search' | 'Upload' | 'Notifications' | 'Profile'; + tab: + | 'Home' + | 'Search' + | 'Upload' + | 'Notifications' + | 'Profile' + | 'SuggestedPeople'; disabled?: boolean; newIcon?: boolean; } @@ -43,6 +49,11 @@ const NavigationIcon = (props: NavigationIconProps) => { ? require('../../assets/navigationIcons/profile.png') : require('../../assets/navigationIcons/profile-clicked.png'); break; + case 'SuggestedPeople': + imgSrc = props.disabled + ? require('../../assets/navigationIcons/suggested-people.png') + : require('../../assets/navigationIcons/suggested-people-clicked.png'); + break; default: imgSrc = null; } diff --git a/src/routes/main/MainStackNavigator.tsx b/src/routes/main/MainStackNavigator.tsx index 74993af9..f3aa7fc6 100644 --- a/src/routes/main/MainStackNavigator.tsx +++ b/src/routes/main/MainStackNavigator.tsx @@ -11,6 +11,9 @@ import { } from '../../types'; export type MainStackParams = { + SuggestedPeople: { + screenType: ScreenType; + }; Search: { screenType: ScreenType; }; diff --git a/src/routes/main/MainStackScreen.tsx b/src/routes/main/MainStackScreen.tsx index c0cef3ea..37f9bef8 100644 --- a/src/routes/main/MainStackScreen.tsx +++ b/src/routes/main/MainStackScreen.tsx @@ -16,6 +16,7 @@ import { RequestContactsAccess, SearchScreen, SocialMediaTaggs, + SuggestedPeopleScreen, } from '../../screens'; import {ScreenType} from '../../types'; import {AvatarHeaderHeight, SCREEN_WIDTH} from '../../utils'; @@ -43,6 +44,7 @@ const MainStackScreen: React.FC = ({route}) => { // const isProfileTab = screenType === ScreenType.Profile; const isSearchTab = screenType === ScreenType.Search; const isNotificationsTab = screenType === ScreenType.Notifications; + const isSuggestedPeopleTab = screenType === ScreenType.SuggestedPeople; AsyncStorage.getItem('respondedToAccessContacts').then((value) => setRespondedToAccessContacts(value ? value : 'false'), @@ -60,6 +62,8 @@ const MainStackScreen: React.FC = ({route}) => { return 'Search'; case ScreenType.Notifications: return 'Notifications'; + case ScreenType.SuggestedPeople: + return 'SuggestedPeople'; } })(); @@ -77,6 +81,7 @@ const MainStackScreen: React.FC = ({route}) => { }), }; + console.log('screenType: ', screenType); return ( = ({route}) => { initialParams={{screenType}} /> )} + {isSuggestedPeopleTab && ( + + )} { ); case 'Profile': return ; + case 'SuggestedPeople': + return ( + + ); default: return ; } @@ -72,6 +76,11 @@ const NavigationBar: React.FC = () => { bottom: '1%', }, }}> +