mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-13 17:47:32 +08:00
feat: allow specifying style interpolators in navigationOptions (#155)
This commit is contained in:
committed by
satyajit.happy
parent
1cf7dc5f47
commit
282cfe538b
@@ -5,11 +5,6 @@ import Stack from './Stack';
|
||||
import HeaderContainer, {
|
||||
Props as HeaderContainerProps,
|
||||
} from '../Header/HeaderContainer';
|
||||
import {
|
||||
DefaultTransition,
|
||||
ModalSlideFromBottomIOS,
|
||||
} from '../../TransitionConfigs/TransitionPresets';
|
||||
import { forNoAnimation } from '../../TransitionConfigs/HeaderStyleInterpolators';
|
||||
import {
|
||||
NavigationProp,
|
||||
SceneDescriptor,
|
||||
@@ -283,20 +278,9 @@ class StackView extends React.Component<Props, State> {
|
||||
const headerMode =
|
||||
mode !== 'modal' && Platform.OS === 'ios' ? 'float' : 'screen';
|
||||
|
||||
let transitionPreset =
|
||||
mode === 'modal' && Platform.OS === 'ios'
|
||||
? ModalSlideFromBottomIOS
|
||||
: DefaultTransition;
|
||||
|
||||
if (headerMode === 'screen') {
|
||||
transitionPreset = {
|
||||
...transitionPreset,
|
||||
headerStyleInterpolator: forNoAnimation,
|
||||
};
|
||||
}
|
||||
|
||||
return (
|
||||
<Stack
|
||||
mode={mode}
|
||||
getPreviousRoute={this.getPreviousRoute}
|
||||
getGesturesEnabled={this.getGesturesEnabled}
|
||||
routes={routes}
|
||||
@@ -314,7 +298,6 @@ class StackView extends React.Component<Props, State> {
|
||||
headerMode={headerMode}
|
||||
navigation={navigation}
|
||||
descriptors={descriptors}
|
||||
{...transitionPreset}
|
||||
{...config}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user