Outside animations

This commit is contained in:
Diego Mello 2020-05-27 11:09:15 -03:00
parent 5ca94ee907
commit 06684cbaf6
1 changed files with 10 additions and 3 deletions

View File

@ -1,9 +1,12 @@
import React from 'react'; import React from 'react';
import { createStackNavigator } from '@react-navigation/stack'; import { createStackNavigator } from '@react-navigation/stack';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { ThemeContext } from '../theme'; import { ThemeContext } from '../theme';
import { defaultHeader, themedHeader } from '../utils/navigation'; import {
defaultHeader, themedHeader, stackAnimation, modalAnimation
} from '../utils/navigation';
// Outside Stack // Outside Stack
import OnboardingView from '../views/OnboardingView'; import OnboardingView from '../views/OnboardingView';
@ -22,7 +25,7 @@ const _OutsideStack = ({ root }) => {
const { theme } = React.useContext(ThemeContext); const { theme } = React.useContext(ThemeContext);
return ( return (
<Outside.Navigator screenOptions={{ ...defaultHeader, ...themedHeader(theme) }}> <Outside.Navigator screenOptions={{ ...defaultHeader, ...themedHeader(theme), ...stackAnimation }}>
{root === ROOT_OUTSIDE ? ( {root === ROOT_OUTSIDE ? (
<Outside.Screen <Outside.Screen
name='OnboardingView' name='OnboardingView'
@ -68,6 +71,10 @@ const mapStateToProps = state => ({
root: state.app.root root: state.app.root
}); });
_OutsideStack.propTypes = {
root: PropTypes.string
};
const OutsideStack = connect(mapStateToProps)(_OutsideStack); const OutsideStack = connect(mapStateToProps)(_OutsideStack);
// OutsideStackModal // OutsideStackModal
@ -76,7 +83,7 @@ const OutsideStackModal = () => {
const { theme } = React.useContext(ThemeContext); const { theme } = React.useContext(ThemeContext);
return ( return (
<OutsideModal.Navigator mode='modal' screenOptions={{ ...defaultHeader, ...themedHeader(theme) }}> <OutsideModal.Navigator mode='modal' screenOptions={{ ...defaultHeader, ...themedHeader(theme), ...modalAnimation }}>
<OutsideModal.Screen <OutsideModal.Screen
name='OutsideStack' name='OutsideStack'
component={OutsideStack} component={OutsideStack}