moved login and sign up to root stack

This commit is contained in:
Nouman Tahir 2022-08-24 16:03:19 +05:00
parent 65cef59c08
commit 6855029c48
4 changed files with 47 additions and 36 deletions

View File

@ -828,4 +828,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 0282022703ad578ab2d9afbf3147ba3b373b4311 PODFILE CHECKSUM: 0282022703ad578ab2d9afbf3147ba3b373b4311
COCOAPODS: 1.10.2 COCOAPODS: 1.11.3

View File

@ -2,6 +2,7 @@ const DRAWER_SUFFIX = 'Drawer';
const MODAL_SUFFIX = 'Modal'; const MODAL_SUFFIX = 'Modal';
const SCREEN_SUFFIX = 'Screen'; const SCREEN_SUFFIX = 'Screen';
const TABBAR_SUFFIX = 'Tabbar'; const TABBAR_SUFFIX = 'Tabbar';
const STACK_SUFFIX = 'Stack';
export default { export default {
SCREENS: { SCREENS: {
@ -49,4 +50,7 @@ export default {
MODAL: { MODAL: {
LOGOUT: `Logout${MODAL_SUFFIX}`, LOGOUT: `Logout${MODAL_SUFFIX}`,
}, },
STACK: {
MAIN: `Main${STACK_SUFFIX}`,
},
}; };

View File

@ -34,45 +34,53 @@ import {
} from '../screens'; } from '../screens';
import { DrawerNavigator } from './drawerNavigator'; import { DrawerNavigator } from './drawerNavigator';
const Stack = createNativeStackNavigator(); const RootStack = createNativeStackNavigator();
const MainStack = createNativeStackNavigator();
const MainStackNavigator = () => {
return (
<MainStack.Navigator screenOptions={{ headerShown: false, animation: 'slide_from_right' }} >
<MainStack.Screen name={ROUTES.DRAWER.MAIN} component={DrawerNavigator} />
<MainStack.Screen name={ROUTES.SCREENS.PROFILE} component={Profile} />
<MainStack.Screen name={ROUTES.SCREENS.PROFILE_EDIT} component={ProfileEdit} />
<MainStack.Screen name={ROUTES.SCREENS.SETTINGS} component={Settings} />
<MainStack.Screen name={ROUTES.SCREENS.DRAFTS} component={Drafts} />
<MainStack.Screen name={ROUTES.SCREENS.BOOKMARKS} component={Bookmarks} />
<MainStack.Screen name={ROUTES.SCREENS.SEARCH_RESULT} component={SearchResult} />
<MainStack.Screen name={ROUTES.SCREENS.TAG_RESULT} component={TagResult} />
<MainStack.Screen name={ROUTES.SCREENS.BOOST} component={Boost} />
<MainStack.Screen name={ROUTES.SCREENS.REDEEM} component={Redeem} />
<MainStack.Screen name={ROUTES.SCREENS.SPIN_GAME} component={SpinGame} />
<MainStack.Screen name={ROUTES.SCREENS.ACCOUNT_BOOST} component={AccountBoost} />
<MainStack.Screen name={ROUTES.SCREENS.COMMUNITY} component={Community} />
<MainStack.Screen name={ROUTES.SCREENS.COMMUNITIES} component={Communities} />
<MainStack.Screen name={ROUTES.SCREENS.WEB_BROWSER} component={WebBrowser} />
<MainStack.Screen name={ROUTES.SCREENS.REFER} component={ReferScreen} />
<MainStack.Screen name={ROUTES.SCREENS.COIN_DETAILS} component={CoinDetails} />
<MainStack.Screen name={ROUTES.SCREENS.EDIT_HISTORY} component={EditHistoryScreen} />
<MainStack.Screen name={ROUTES.SCREENS.POST} component={Post} />
<MainStack.Group screenOptions={{ animation: 'slide_from_bottom' }}>
<MainStack.Screen name={ROUTES.SCREENS.REBLOGS} component={Reblogs} />
<MainStack.Screen name={ROUTES.SCREENS.VOTERS} component={Voters} />
<MainStack.Screen name={ROUTES.SCREENS.FOLLOWS} component={Follows} />
<MainStack.Screen name={ROUTES.SCREENS.TRANSFER} component={Transfer} />
<MainStack.Screen name={ROUTES.SCREENS.EDITOR} component={Editor} />
</MainStack.Group>
</MainStack.Navigator>
)
}
export const StackNavigator = () => { export const StackNavigator = () => {
return ( return (
<Stack.Navigator screenOptions={{ headerShown: false }} > <RootStack.Navigator screenOptions={{ headerShown: false, animation:'slide_from_bottom' }}>
<Stack.Group screenOptions={{ animation: 'slide_from_right' }}> <MainStack.Screen name={ROUTES.STACK.MAIN} component={MainStackNavigator} />
<Stack.Screen name={ROUTES.DRAWER.MAIN} component={DrawerNavigator} />
<Stack.Screen name={ROUTES.SCREENS.PROFILE} component={Profile} />
<Stack.Screen name={ROUTES.SCREENS.PROFILE_EDIT} component={ProfileEdit} />
<Stack.Screen name={ROUTES.SCREENS.SETTINGS} component={Settings} />
<Stack.Screen name={ROUTES.SCREENS.DRAFTS} component={Drafts} />
<Stack.Screen name={ROUTES.SCREENS.BOOKMARKS} component={Bookmarks} />
<Stack.Screen name={ROUTES.SCREENS.SEARCH_RESULT} component={SearchResult} />
<Stack.Screen name={ROUTES.SCREENS.TAG_RESULT} component={TagResult} />
<Stack.Screen name={ROUTES.SCREENS.BOOST} component={Boost} />
<Stack.Screen name={ROUTES.SCREENS.REDEEM} component={Redeem} />
<Stack.Screen name={ROUTES.SCREENS.SPIN_GAME} component={SpinGame} />
<Stack.Screen name={ROUTES.SCREENS.ACCOUNT_BOOST} component={AccountBoost} />
<Stack.Screen name={ROUTES.SCREENS.COMMUNITY} component={Community} />
<Stack.Screen name={ROUTES.SCREENS.COMMUNITIES} component={Communities} />
<Stack.Screen name={ROUTES.SCREENS.WEB_BROWSER} component={WebBrowser} />
<Stack.Screen name={ROUTES.SCREENS.REFER} component={ReferScreen} />
<Stack.Screen name={ROUTES.SCREENS.COIN_DETAILS} component={CoinDetails} />
<Stack.Screen name={ROUTES.SCREENS.EDIT_HISTORY} component={EditHistoryScreen} />
<Stack.Screen name={ROUTES.SCREENS.POST} component={Post} />
</Stack.Group>
<Stack.Group screenOptions={{ animation: 'slide_from_bottom' }}>
<Stack.Screen name={ROUTES.SCREENS.REBLOGS} component={Reblogs} />
<Stack.Screen name={ROUTES.SCREENS.VOTERS} component={Voters} />
<Stack.Screen name={ROUTES.SCREENS.FOLLOWS} component={Follows} />
<Stack.Screen name={ROUTES.SCREENS.TRANSFER} component={Transfer} />
<Stack.Screen name={ROUTES.SCREENS.EDITOR} component={Editor} />
<Stack.Screen name={ROUTES.SCREENS.REGISTER} component={Register} />
<Stack.Screen name={ROUTES.SCREENS.LOGIN} component={Login} />
</Stack.Group>
</Stack.Navigator> <MainStack.Screen name={ROUTES.SCREENS.REGISTER} component={Register} />
<MainStack.Screen name={ROUTES.SCREENS.LOGIN} component={Login} />
</RootStack.Navigator>
) )
} }

View File

@ -1,5 +1,5 @@
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { View, StatusBar, Platform, Keyboard } from 'react-native'; import { View, Platform, Keyboard } from 'react-native';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import ScrollableTabView from 'react-native-scrollable-tab-view'; import ScrollableTabView from 'react-native-scrollable-tab-view';
import { injectIntl } from 'react-intl'; import { injectIntl } from 'react-intl';
@ -83,7 +83,6 @@ class LoginScreen extends PureComponent {
console.log('keyboardIsOpen : ', keyboardIsOpen); console.log('keyboardIsOpen : ', keyboardIsOpen);
return ( return (
<View style={styles.container}> <View style={styles.container}>
<StatusBar hidden translucent />
<LoginHeader <LoginHeader
isKeyboardOpen={keyboardIsOpen} isKeyboardOpen={keyboardIsOpen}
title={intl.formatMessage({ title={intl.formatMessage({