From d495bff07b50c47e842dc2c139922d56c87f5c9b Mon Sep 17 00:00:00 2001 From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> Date: Tue, 12 Jan 2021 15:38:21 -0800 Subject: [TMA 491 Frontend] Revamp onboarding (#173) * First commit, arrow excluded * Done from my side * Some small nitpicks * exclude tsconfig * Show profile screen after onboarding * Update string * Small fix * small cosmetic --- src/routes/main/MainStackNavigator.tsx | 20 +++++++++++++++++--- src/routes/main/MainStackScreen.tsx | 10 +++++++++- src/routes/tabs/NavigationBar.tsx | 6 +++++- 3 files changed, 31 insertions(+), 5 deletions(-) (limited to 'src/routes') 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(); 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) @@ -168,6 +168,14 @@ const MainStackScreen: React.FC = ({route}) => { }} initialParams={{screenType}} /> + { + const {isOnboardedUser} = useSelector((state: RootState) => state.user); + return ( ({ @@ -27,7 +31,7 @@ const NavigationBar: React.FC = () => { } }, })} - initialRouteName="Search" + initialRouteName={isOnboardedUser ? 'Profile' : 'Search'} tabBarOptions={{ showLabel: false, style: { -- cgit v1.2.3-70-g09d2