diff options
Diffstat (limited to 'src/routes')
-rw-r--r-- | src/routes/main/MainStackNavigator.tsx | 3 | ||||
-rw-r--r-- | src/routes/main/MainStackScreen.tsx | 19 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/routes/main/MainStackNavigator.tsx b/src/routes/main/MainStackNavigator.tsx index bd838ef2..e038d2c2 100644 --- a/src/routes/main/MainStackNavigator.tsx +++ b/src/routes/main/MainStackNavigator.tsx @@ -14,6 +14,9 @@ export type MainStackParams = { Search: { screenType: ScreenType; }; + RequestContactsAccess: { + screenType: ScreenType; + }; Profile: { userXId: string | undefined; screenType: ScreenType; diff --git a/src/routes/main/MainStackScreen.tsx b/src/routes/main/MainStackScreen.tsx index 3e425101..8042d267 100644 --- a/src/routes/main/MainStackScreen.tsx +++ b/src/routes/main/MainStackScreen.tsx @@ -12,6 +12,7 @@ import { MomentUploadPromptScreen, NotificationsScreen, ProfileScreen, + RequestContactsAccess, SearchScreen, SocialMediaTaggs, } from '../../screens'; @@ -47,7 +48,14 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => { case ScreenType.Profile: return 'Profile'; case ScreenType.Search: - return 'Search'; + // Check if user responded to access contacts and return appropriate screen + // When app is opened, load the value from Async Storage to react native store + // Every time the user clicks on this tab + // Retrieve the information from the store + // If responded is true, show search screen + // Else, show RequestContactsAccess + // If user responds, update store and Async and remove popup + return 'RequestContactsAccess'; case ScreenType.Notifications: return 'Notifications'; } @@ -91,9 +99,14 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => { }} /> {isSearchTab && ( + // <MainStack.Screen + // name="Search" + // component={SearchScreen} + // initialParams={{screenType}} + // /> <MainStack.Screen - name="Search" - component={SearchScreen} + name="RequestContactsAccess" + component={RequestContactsAccess} initialParams={{screenType}} /> )} |