Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import { connect } from 'react-redux';
import Home from './global/landing/Home';
import Login from './resources/user/views/Login';
import ProductRoot from './resources/product/views/ProductRoot';
import AuthLoadingScreen from './AuthLoadingScreen';
import TabNavigator from './TabNavigator';
import DrawerNavigator from './DrawerNavigator';
const AppStack = createStackNavigator({ Home: Home, Product: ProductRoot });
const AuthStack = createStackNavigator({ SignIn: Login });
const AppContainer = createAppContainer(
createSwitchNavigator(
{
AuthLoading: AuthLoadingScreen,
App: TabNavigator, // could also use regular stack or DrawerNavigator
Auth: AuthStack,
},
{
initialRouteName: 'AuthLoading',
}
)
);
const mapStoreToProps = (store) => {
return {
isLoggedIn: store.user.loggedIn.apiToken
}
}
import {createAppContainer, createSwitchNavigator} from 'react-navigation';
import Main from '~/pages/Main';
import Statement from '~/pages/Statement';
import Account from '~/pages/Account';
const Routes = createAppContainer(
createSwitchNavigator({
Main,
Statement,
Account,
}),
);
export default Routes;
if (action) {
if (action.type === 'Navigation/MARK_DRAWER_SETTLING' && action.willShow) {
DrawerStatusTracker.setStatus('open');
} else if (action.type === 'Navigation/MARK_DRAWER_SETTLING' && !action.willShow) {
DrawerStatusTracker.setStatus('closed');
}
}
return defaultGetStateForAction(action, state);
};
/**
* Top level switch navigator which decides
* which top level view to show
*/
const App = createSwitchNavigator(
{
Entry,
HomeNav,
OnboardingRootNav,
Login,
OnboardingCarousel,
LockScreen
},
{
initialRouteName: 'Entry'
}
);
export default createAppContainer(App);
headerStyle: {
backgroundColor: COLOR.PRIMARY,
},
headerTintColor: COLOR.WHITE,
headerTitleStyle: {
fontWeight: 'bold',
},
},
},
},
{
headerLayoutPreset: 'center',
}
);
const RootStack = createSwitchNavigator(
{
Login: LoginScreen,
App: AppStack,
Call: CallScreen,
IncomingCall: IncomingCallScreen,
},
{
initialRouteName: 'Login',
}
);
export default createAppContainer(RootStack);
import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import Main from '~/pages/Main';
const Routes = createAppContainer(createSwitchNavigator({ Main }));
export default Routes;
} from 'react-navigation'
import { AuthLoadingScreen, SignInScreen } from '../screens'
import BaseStack from './BaseStack'
const AuthStack = createStackNavigator(
{
SignIn: SignInScreen,
},
{
headerMode: 'none',
}
)
export default createAppContainer(
createSwitchNavigator(
{
AuthLoading: AuthLoadingScreen,
App: BaseStack,
Auth: AuthStack,
},
{
initialRouteName: 'AuthLoading',
}
)
)
import {
createAppContainer,
createSwitchNavigator
} from 'react-navigation'
import Initializing from '../Containers/Initializing'
import Scanner from '../Containers/Scanner'
import Home from '../Containers/Home'
const nav = createSwitchNavigator(
{
Initializing,
Home,
Scanner
},
{
initialRouteName: 'Home'
}
)
const app = createAppContainer(nav)
export default app
createStackNavigator
} from 'react-navigation'
import { Constants } from 'expo'
import { Icon } from '@components'
import {
Auth,
Home,
Login,
Calendar,
Settings,
Subject,
Timeline
} from '@screens'
import { wind, colorMain, colorTitle } from '@styles'
const HomeSwitch = createSwitchNavigator({
Auth,
Home
})
const NavBottomTab = createBottomTabNavigator(
{
Timeline: {
navigationOptions: {
tabBarIcon: ({ tintColor }) => (
),
tabBarLabel: '时间胶囊'
},
screen: Timeline
},
Home: {
import { createSwitchNavigator, createAppContainer } from 'react-navigation';
import AuthStackNavigator from './AuthStackNavigator';
import MainStackNavigator from './MainStackNavigator';
import Loading from '../screen/Loading';
import LifeCycle from '../screen/LifeCycle';
export const SwitchNavigator = createSwitchNavigator(
{
Loading,
LifeCycle,
AuthStackNavigator,
MainStackNavigator,
},
{
initialRouteName: 'Loading',
}
);
export const AppContainer = createAppContainer(SwitchNavigator);
-----------------------------------------------------------------------------------------------
----------- 时间 | 修改人 | 修改的方法 | 修改描述 ---------------
-----------------------------------------------------------------------------------------------
************************************************************************************************/
import React, {Component} from 'react';
import {createSwitchNavigator, createAppContainer} from "react-navigation";
import {AppLoginNav} from "./navigation/Regist/RegisterLogin";
import {AppRegist} from "./navigation/Regist/RegisterApp";
import index from './store'
import {Provider} from "mobx-react/index";
import {NavigationService, NavTheme} from "./navigation";
import {inject, observer} from "mobx-react/index";
const AppTopNav = createAppContainer(
createSwitchNavigator({
AppLogin: AppLoginNav,
AppRegister: AppRegist,
}, {
initialRouteName: "AppLogin",
}
)
)
@observer
export class App extends Component {
constructor(props){
super(props)
}
render() {
return (