aboutsummaryrefslogtreecommitdiff
path: root/src/routes/main/MainStackScreen.tsx
diff options
context:
space:
mode:
authorShravya Ramesh <37447613+shravyaramesh@users.noreply.github.com>2021-04-23 15:06:01 -0700
committerGitHub <noreply@github.com>2021-04-23 15:06:01 -0700
commita27963c51aa2c0b65dd23b5e7211addf5995046f (patch)
tree3c2b2328384630b6388ed77773ee6470e17df23d /src/routes/main/MainStackScreen.tsx
parentce5bf93fef3f5108e0dca35bf24accb4d9d654bb (diff)
parent5e247c2045fa53616008aae73f0192ffed048709 (diff)
Merge branch 'master' into tma-807-onpress-indicator
Diffstat (limited to 'src/routes/main/MainStackScreen.tsx')
-rw-r--r--src/routes/main/MainStackScreen.tsx47
1 files changed, 12 insertions, 35 deletions
diff --git a/src/routes/main/MainStackScreen.tsx b/src/routes/main/MainStackScreen.tsx
index 37867151..f5100e58 100644
--- a/src/routes/main/MainStackScreen.tsx
+++ b/src/routes/main/MainStackScreen.tsx
@@ -1,7 +1,6 @@
-import AsyncStorage from '@react-native-community/async-storage';
import {RouteProp} from '@react-navigation/native';
import {StackNavigationOptions} from '@react-navigation/stack';
-import React, {useEffect, useState} from 'react';
+import React from 'react';
import {StyleSheet, Text} from 'react-native';
import {normalize} from 'react-native-elements';
import BackIcon from '../../assets/icons/back-arrow.svg';
@@ -56,28 +55,9 @@ interface MainStackProps {
const MainStackScreen: React.FC<MainStackProps> = ({route}) => {
const {screenType} = route.params;
- // const isProfileTab = screenType === ScreenType.Profile;
const isSearchTab = screenType === ScreenType.Search;
const isNotificationsTab = screenType === ScreenType.Notifications;
const isSuggestedPeopleTab = screenType === ScreenType.SuggestedPeople;
- const [respondedToAccessContacts, setRespondedToAccessContacts] = useState(
- 'true',
- );
-
- useEffect(() => {
- loadResponseToAccessContacts();
- }, []);
-
- const loadResponseToAccessContacts = () => {
- AsyncStorage.getItem('respondedToAccessContacts')
- .then((value) => {
- setRespondedToAccessContacts(value ? value : 'false');
- })
- .catch((error) => {
- console.log('Something went wrong', error);
- setRespondedToAccessContacts('true');
- });
- };
const initialRouteName = (() => {
switch (screenType) {
@@ -131,20 +111,13 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => {
...headerBarOptions('white', ''),
}}
/>
- {isSuggestedPeopleTab &&
- (respondedToAccessContacts && respondedToAccessContacts === 'true' ? (
- <MainStack.Screen
- name="SuggestedPeople"
- component={SuggestedPeopleScreen}
- initialParams={{screenType}}
- />
- ) : (
- <MainStack.Screen
- name="SuggestedPeople"
- component={RequestContactsAccess}
- initialParams={{screenType}}
- />
- ))}
+ {isSuggestedPeopleTab && (
+ <MainStack.Screen
+ name="SuggestedPeople"
+ component={SuggestedPeopleScreen}
+ initialParams={{screenType}}
+ />
+ )}
{isNotificationsTab && (
<MainStack.Screen
name="Notifications"
@@ -271,6 +244,10 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => {
name="RequestContactsAccess"
component={RequestContactsAccess}
initialParams={{screenType}}
+ options={{
+ ...modalStyle,
+ gestureEnabled: false,
+ }}
/>
<MainStack.Screen
name="EditProfile"