aboutsummaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/main/MainStackNavigator.tsx18
-rw-r--r--src/routes/main/MainStackScreen.tsx44
-rw-r--r--src/routes/onboarding/OnboardingStackNavigator.tsx (renamed from src/routes/onboarding/OnboardingStack.tsx)10
-rw-r--r--src/routes/onboarding/OnboardingStackScreen.tsx (renamed from src/routes/onboarding/Onboarding.tsx)12
-rw-r--r--src/routes/onboarding/index.ts4
-rw-r--r--src/routes/tabs/NavigationBar.tsx6
6 files changed, 73 insertions, 21 deletions
diff --git a/src/routes/main/MainStackNavigator.tsx b/src/routes/main/MainStackNavigator.tsx
index 4614168b..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 {CategorySelectionScreenType, 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: {
@@ -41,12 +47,18 @@ export type MainStackParams = {
username: string;
};
CategorySelection: {
- categories: Array<string>;
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 bf643fd8..b4eaa213 100644
--- a/src/routes/main/MainStackScreen.tsx
+++ b/src/routes/main/MainStackScreen.tsx
@@ -1,25 +1,25 @@
+import {RouteProp} from '@react-navigation/native';
+import {StackNavigationOptions} from '@react-navigation/stack';
import React from 'react';
import {
- IndividualMoment,
CaptionScreen,
- SocialMediaTaggs,
- SearchScreen,
- ProfileScreen,
- MomentCommentsScreen,
- EditProfile,
CategorySelection,
+ CreateCustomCategory,
+ EditProfile,
FriendsListScreen,
+ IndividualMoment,
+ MomentCommentsScreen,
+ MomentUploadPromptScreen,
NotificationsScreen,
+ ProfileScreen,
+ SearchScreen,
+ SocialMediaTaggs,
} from '../../screens';
-import {MainStack, MainStackParams} from './MainStackNavigator';
-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';
+import {AvatarHeaderHeight, SCREEN_WIDTH} from '../../utils';
+import {MainStack, MainStackParams} from './MainStackNavigator';
/**
- * Trying to explain the purpose of each route on the stack (ACTUALLY A STACK)
* Profile : To display the logged in user's profile when the userXId passed in to it is (undefined | null | empty string) else displays profile of the user being visited.
* Search : To display the search screen. Search for a user on this screen, click on a result tile and navigate to the same.
* When you click on the search icon after looking at a user's profile, the stack gets reset and you come back to the top of the stack (First screen : Search in this case)
@@ -79,6 +79,7 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => {
<MainStack.Navigator
screenOptions={{
headerShown: false,
+ gestureResponseDistance: {horizontal: SCREEN_WIDTH * 0.6},
}}
mode="card"
initialRouteName={initialRouteName}>
@@ -141,6 +142,17 @@ const MainStackScreen: React.FC<MainStackProps> = ({route}) => {
}}
/>
<MainStack.Screen
+ name="CreateCustomCategory"
+ component={CreateCustomCategory}
+ options={{
+ headerShown: true,
+ headerTransparent: true,
+ headerBackTitleVisible: false,
+ headerTintColor: 'white',
+ headerTitle: '',
+ }}
+ />
+ <MainStack.Screen
name="IndividualMoment"
component={IndividualMoment}
options={{
@@ -157,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/onboarding/OnboardingStack.tsx b/src/routes/onboarding/OnboardingStackNavigator.tsx
index 7ff00271..9f614f7c 100644
--- a/src/routes/onboarding/OnboardingStack.tsx
+++ b/src/routes/onboarding/OnboardingStackNavigator.tsx
@@ -1,7 +1,6 @@
import {createStackNavigator} from '@react-navigation/stack';
import {
CategorySelectionScreenType,
- MomentCategoryType,
TaggPopupType,
UserType,
VerificationScreenType,
@@ -28,13 +27,20 @@ export type OnboardingStackParams = {
ProfileOnboarding: {username: string; userId: string};
SocialMedia: {username: string; userId: string};
CategorySelection: {
- categories: Record<MomentCategoryType, boolean>;
screenType: CategorySelectionScreenType;
user: UserType;
+ newCustomCategory: string | undefined;
+ };
+ CreateCustomCategory: {
+ screenType: CategorySelectionScreenType;
+ user: UserType;
+ existingCategories: string[];
};
TaggPopup: {
popupProps: TaggPopupType;
};
+ AddWaitlistUser: undefined;
+ WaitlistSuccess: undefined;
};
export const OnboardingStack = createStackNavigator<OnboardingStackParams>();
diff --git a/src/routes/onboarding/Onboarding.tsx b/src/routes/onboarding/OnboardingStackScreen.tsx
index a3d281f5..afc5be99 100644
--- a/src/routes/onboarding/Onboarding.tsx
+++ b/src/routes/onboarding/OnboardingStackScreen.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import {OnboardingStack} from './OnboardingStack';
+import {OnboardingStack} from './OnboardingStackNavigator';
import {
Login,
InvitationCodeVerification,
@@ -14,6 +14,8 @@ import {
PasswordReset,
WelcomeScreen,
CategorySelection,
+ AddWaitlistUserScreen,
+ WaitlistSuccessScreen,
} from '../../screens';
import {StackCardInterpolationProps} from '@react-navigation/stack';
import TaggPopup from '../../components/common/TaggPopup';
@@ -97,6 +99,14 @@ const Onboarding: React.FC = () => {
component={InvitationCodeVerification}
/>
<OnboardingStack.Screen
+ name="AddWaitlistUser"
+ component={AddWaitlistUserScreen}
+ />
+ <OnboardingStack.Screen
+ name="WaitlistSuccess"
+ component={WaitlistSuccessScreen}
+ />
+ <OnboardingStack.Screen
name="RegistrationOne"
component={RegistrationOne}
/>
diff --git a/src/routes/onboarding/index.ts b/src/routes/onboarding/index.ts
index 66b0f3f4..ce9ac046 100644
--- a/src/routes/onboarding/index.ts
+++ b/src/routes/onboarding/index.ts
@@ -1,2 +1,2 @@
-export * from './OnboardingStack';
-export {default} from './Onboarding';
+export * from './OnboardingStackNavigator';
+export {default} from './OnboardingStackScreen';
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: {