aboutsummaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/main/MainStackNavigator.tsx20
-rw-r--r--src/routes/main/MainStackScreen.tsx10
-rw-r--r--src/routes/tabs/NavigationBar.tsx6
3 files changed, 31 insertions, 5 deletions
diff --git a/src/routes/main/MainStackNavigator.tsx b/src/routes/main/MainStackNavigator.tsx
index 950f3ffc..bd838ef2 100644
--- a/src/routes/main/MainStackNavigator.tsx
+++ b/src/routes/main/MainStackNavigator.tsx
@@ -2,7 +2,13 @@
* Note the name userXId here, it refers to the id of the user being visited
*/
import {createStackNavigator} from '@react-navigation/stack';
-import {MomentType, ScreenType} from '../../types';
+import {Image} from 'react-native-image-crop-picker';
+import {
+ CategorySelectionScreenType,
+ MomentType,
+ ScreenType,
+ UserType,
+} from '../../types';
export type MainStackParams = {
Search: {
@@ -19,7 +25,7 @@ export type MainStackParams = {
};
CaptionScreen: {
title: string;
- image: object;
+ image: Image;
screenType: ScreenType;
};
IndividualMoment: {
@@ -40,11 +46,19 @@ export type MainStackParams = {
userId: string;
username: string;
};
- CategorySelection: {};
+ CategorySelection: {
+ screenType: CategorySelectionScreenType;
+ user: UserType;
+ newCustomCategory: string | undefined;
+ };
CreateCustomCategory: {};
Notifications: {
screenType: ScreenType;
};
+ MomentUploadPrompt: {
+ screenType: ScreenType;
+ momentCategory: string;
+ };
};
export const MainStack = createStackNavigator<MainStackParams>();
diff --git a/src/routes/main/MainStackScreen.tsx b/src/routes/main/MainStackScreen.tsx
index 4ad5bf40..6f7bd413 100644
--- a/src/routes/main/MainStackScreen.tsx
+++ b/src/routes/main/MainStackScreen.tsx
@@ -10,6 +10,7 @@ import {
CategorySelection,
FriendsListScreen,
NotificationsScreen,
+ MomentUploadPromptScreen,
CreateCustomCategory,
} from '../../screens';
import {MainStack, MainStackParams} from './MainStackNavigator';
@@ -17,7 +18,6 @@ import {RouteProp} from '@react-navigation/native';
import {ScreenType} from '../../types';
import {AvatarHeaderHeight} from '../../utils';
import {StackNavigationOptions} from '@react-navigation/stack';
-import {Screen} from 'react-native-screens';
/**
* Trying to explain the purpose of each route on the stack (ACTUALLY A STACK)
@@ -169,6 +169,14 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => {
initialParams={{screenType}}
/>
<MainStack.Screen
+ name="MomentUploadPrompt"
+ component={MomentUploadPromptScreen}
+ options={{
+ ...modalStyle,
+ }}
+ initialParams={{screenType}}
+ />
+ <MainStack.Screen
name="FriendsListScreen"
component={FriendsListScreen}
options={{
diff --git a/src/routes/tabs/NavigationBar.tsx b/src/routes/tabs/NavigationBar.tsx
index 9d7d4b12..3757c56b 100644
--- a/src/routes/tabs/NavigationBar.tsx
+++ b/src/routes/tabs/NavigationBar.tsx
@@ -1,12 +1,16 @@
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import React, {Fragment} from 'react';
+import {useSelector} from 'react-redux';
import {NavigationIcon} from '../../components';
+import {RootState} from '../../store/rootReducer';
import {ScreenType} from '../../types';
import MainStackScreen from '../main/MainStackScreen';
const Tabs = createBottomTabNavigator();
const NavigationBar: React.FC = () => {
+ const {isOnboardedUser} = useSelector((state: RootState) => state.user);
+
return (
<Tabs.Navigator
screenOptions={({route}) => ({
@@ -27,7 +31,7 @@ const NavigationBar: React.FC = () => {
}
},
})}
- initialRouteName="Search"
+ initialRouteName={isOnboardedUser ? 'Profile' : 'Search'}
tabBarOptions={{
showLabel: false,
style: {