2020-06-15 14:00:46 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { createStackNavigator } from '@react-navigation/stack';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
|
|
import { ThemeContext } from '../theme';
|
2021-09-13 20:41:05 +00:00
|
|
|
import { ModalAnimation, StackAnimation, defaultHeader, themedHeader } from '../utils/navigation';
|
2020-06-15 14:00:46 +00:00
|
|
|
|
|
|
|
// Outside Stack
|
|
|
|
import NewServerView from '../views/NewServerView';
|
|
|
|
import WorkspaceView from '../views/WorkspaceView';
|
|
|
|
import LoginView from '../views/LoginView';
|
|
|
|
import ForgotPasswordView from '../views/ForgotPasswordView';
|
2021-10-20 16:42:44 +00:00
|
|
|
import SendEmailConfirmationView from '../views/SendEmailConfirmationView';
|
2020-06-15 14:00:46 +00:00
|
|
|
import RegisterView from '../views/RegisterView';
|
|
|
|
import LegalView from '../views/LegalView';
|
|
|
|
import AuthenticationWebView from '../views/AuthenticationWebView';
|
|
|
|
|
|
|
|
// Outside
|
|
|
|
const Outside = createStackNavigator();
|
2021-09-23 14:17:53 +00:00
|
|
|
const _OutsideStack = () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
const { theme } = React.useContext(ThemeContext);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Outside.Navigator screenOptions={{ ...defaultHeader, ...themedHeader(theme), ...StackAnimation }}>
|
2021-09-13 20:41:05 +00:00
|
|
|
<Outside.Screen name='NewServerView' component={NewServerView} options={NewServerView.navigationOptions} />
|
|
|
|
<Outside.Screen name='WorkspaceView' component={WorkspaceView} options={WorkspaceView.navigationOptions} />
|
|
|
|
<Outside.Screen name='LoginView' component={LoginView} options={LoginView.navigationOptions} />
|
|
|
|
<Outside.Screen name='ForgotPasswordView' component={ForgotPasswordView} options={ForgotPasswordView.navigationOptions} />
|
2021-10-20 16:42:44 +00:00
|
|
|
<Outside.Screen
|
|
|
|
name='SendEmailConfirmationView'
|
|
|
|
component={SendEmailConfirmationView}
|
|
|
|
options={SendEmailConfirmationView.navigationOptions}
|
|
|
|
/>
|
2021-09-13 20:41:05 +00:00
|
|
|
<Outside.Screen name='RegisterView' component={RegisterView} options={RegisterView.navigationOptions} />
|
|
|
|
<Outside.Screen name='LegalView' component={LegalView} options={LegalView.navigationOptions} />
|
2020-06-15 14:00:46 +00:00
|
|
|
</Outside.Navigator>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
|
|
root: state.app.root
|
|
|
|
});
|
|
|
|
|
|
|
|
const OutsideStack = connect(mapStateToProps)(_OutsideStack);
|
|
|
|
|
|
|
|
// OutsideStackModal
|
|
|
|
const OutsideModal = createStackNavigator();
|
|
|
|
const OutsideStackModal = () => {
|
|
|
|
const { theme } = React.useContext(ThemeContext);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<OutsideModal.Navigator mode='modal' screenOptions={{ ...defaultHeader, ...themedHeader(theme), ...ModalAnimation }}>
|
2021-09-13 20:41:05 +00:00
|
|
|
<OutsideModal.Screen name='OutsideStack' component={OutsideStack} options={{ headerShown: false }} />
|
2020-06-15 14:00:46 +00:00
|
|
|
<OutsideModal.Screen
|
|
|
|
name='AuthenticationWebView'
|
|
|
|
component={AuthenticationWebView}
|
|
|
|
options={AuthenticationWebView.navigationOptions}
|
|
|
|
/>
|
|
|
|
</OutsideModal.Navigator>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default OutsideStackModal;
|