aboutsummaryrefslogtreecommitdiff
path: root/src/routes/main/MainStackScreen.tsx
diff options
context:
space:
mode:
authorShravya Ramesh <shravs1208@gmail.com>2021-02-03 07:41:39 -0800
committerShravya Ramesh <shravs1208@gmail.com>2021-02-03 07:41:39 -0800
commit4ec594d00b897ac9882a65a60f0523bbe5dbcb0f (patch)
treea977dc447f58c2581b59f2cb24af9b672d206440 /src/routes/main/MainStackScreen.tsx
parent6cd49ed14f99fe953026e54969abc6232f3aec57 (diff)
New screen to request permission to contacts
Diffstat (limited to 'src/routes/main/MainStackScreen.tsx')
-rw-r--r--src/routes/main/MainStackScreen.tsx19
1 files changed, 16 insertions, 3 deletions
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}}
/>
)}