2020-06-15 14:00:46 +00:00
|
|
|
import React from 'react';
|
2021-12-03 19:27:57 +00:00
|
|
|
import { createStackNavigator, StackNavigationOptions } from '@react-navigation/stack';
|
2020-06-15 14:00:46 +00:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
|
|
import { ThemeContext } from '../theme';
|
2022-06-06 14:17:51 +00:00
|
|
|
import { ModalAnimation, StackAnimation, defaultHeader, themedHeader } from '../lib/methods/helpers/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';
|
2021-12-03 19:27:57 +00:00
|
|
|
import { OutsideModalParamList, OutsideParamList } from './types';
|
2020-06-15 14:00:46 +00:00
|
|
|
|
|
|
|
// Outside
|
2021-12-03 19:27:57 +00:00
|
|
|
const Outside = createStackNavigator<OutsideParamList>();
|
2021-09-23 14:17:53 +00:00
|
|
|
const _OutsideStack = () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
const { theme } = React.useContext(ThemeContext);
|
|
|
|
|
|
|
|
return (
|
2021-12-03 19:27:57 +00:00
|
|
|
<Outside.Navigator screenOptions={{ ...defaultHeader, ...themedHeader(theme), ...StackAnimation } as StackNavigationOptions}>
|
2023-05-18 21:09:33 +00:00
|
|
|
{/* @ts-ignore */}
|
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} />
|
2023-05-18 21:09:33 +00:00
|
|
|
{/* @ts-ignore */}
|
2021-09-13 20:41:05 +00:00
|
|
|
<Outside.Screen name='LoginView' component={LoginView} options={LoginView.navigationOptions} />
|
2022-09-06 17:44:31 +00:00
|
|
|
<Outside.Screen name='ForgotPasswordView' component={ForgotPasswordView} />
|
2023-05-18 21:09:33 +00:00
|
|
|
{/* @ts-ignore */}
|
2021-12-03 19:27:57 +00:00
|
|
|
<Outside.Screen name='SendEmailConfirmationView' component={SendEmailConfirmationView} />
|
2023-05-18 21:09:33 +00:00
|
|
|
{/* @ts-ignore */}
|
2021-09-13 20:41:05 +00:00
|
|
|
<Outside.Screen name='RegisterView' component={RegisterView} options={RegisterView.navigationOptions} />
|
2023-05-18 21:09:33 +00:00
|
|
|
{/* @ts-ignore */}
|
2022-05-10 21:19:57 +00:00
|
|
|
<Outside.Screen name='LegalView' component={LegalView} />
|
2020-06-15 14:00:46 +00:00
|
|
|
</Outside.Navigator>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2021-12-03 19:27:57 +00:00
|
|
|
const mapStateToProps = (state: any) => ({
|
2020-06-15 14:00:46 +00:00
|
|
|
root: state.app.root
|
|
|
|
});
|
|
|
|
|
|
|
|
const OutsideStack = connect(mapStateToProps)(_OutsideStack);
|
|
|
|
|
|
|
|
// OutsideStackModal
|
2021-12-03 19:27:57 +00:00
|
|
|
const OutsideModal = createStackNavigator<OutsideModalParamList>();
|
2020-06-15 14:00:46 +00:00
|
|
|
const OutsideStackModal = () => {
|
|
|
|
const { theme } = React.useContext(ThemeContext);
|
|
|
|
|
|
|
|
return (
|
2022-06-01 19:46:37 +00:00
|
|
|
<OutsideModal.Navigator
|
2022-08-08 21:02:08 +00:00
|
|
|
screenOptions={{ ...defaultHeader, ...themedHeader(theme), ...ModalAnimation, presentation: 'transparentModal' }}
|
|
|
|
>
|
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;
|