feat: sync latest stack

This commit is contained in:
Satyajit Sahoo
2020-05-11 18:31:42 +02:00
parent 1f30227049
commit bb82d5000f
9 changed files with 124 additions and 87 deletions

View File

@@ -13,7 +13,6 @@ exports[`Nested navigators renders succesfully as direct child 1`] = `
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
>
@@ -57,8 +56,8 @@ exports[`Nested navigators renders succesfully as direct child 1`] = `
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"restDisplacementThreshold": 10,
"restSpeedThreshold": 10,
"stiffness": 1000,
},
},
@@ -68,8 +67,8 @@ exports[`Nested navigators renders succesfully as direct child 1`] = `
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"restDisplacementThreshold": 10,
"restSpeedThreshold": 10,
"stiffness": 1000,
},
},
@@ -174,7 +173,6 @@ exports[`Nested navigators renders succesfully as direct child 1`] = `
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
>
@@ -218,8 +216,8 @@ exports[`Nested navigators renders succesfully as direct child 1`] = `
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"restDisplacementThreshold": 10,
"restSpeedThreshold": 10,
"stiffness": 1000,
},
},
@@ -229,8 +227,8 @@ exports[`Nested navigators renders succesfully as direct child 1`] = `
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"restDisplacementThreshold": 10,
"restSpeedThreshold": 10,
"stiffness": 1000,
},
},
@@ -414,7 +412,7 @@ exports[`Nested navigators renders succesfully as direct child 1`] = `
pointerEvents="box-none"
style={
Object {
"marginHorizontal": 18,
"marginHorizontal": 16,
"opacity": 1,
}
}
@@ -531,7 +529,7 @@ exports[`Nested navigators renders succesfully as direct child 1`] = `
pointerEvents="box-none"
style={
Object {
"marginHorizontal": 18,
"marginHorizontal": 16,
"opacity": 1,
}
}

View File

@@ -13,7 +13,6 @@ exports[`StackNavigator applies correct values when headerRight is present 1`] =
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
>
@@ -57,8 +56,8 @@ exports[`StackNavigator applies correct values when headerRight is present 1`] =
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"restDisplacementThreshold": 10,
"restSpeedThreshold": 10,
"stiffness": 1000,
},
},
@@ -68,8 +67,8 @@ exports[`StackNavigator applies correct values when headerRight is present 1`] =
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"restDisplacementThreshold": 10,
"restSpeedThreshold": 10,
"stiffness": 1000,
},
},
@@ -254,7 +253,7 @@ exports[`StackNavigator applies correct values when headerRight is present 1`] =
pointerEvents="box-none"
style={
Object {
"marginHorizontal": 18,
"marginHorizontal": 16,
"opacity": 1,
}
}
@@ -310,7 +309,6 @@ exports[`StackNavigator renders successfully 1`] = `
style={
Object {
"flex": 1,
"overflow": "hidden",
}
}
>
@@ -354,8 +352,8 @@ exports[`StackNavigator renders successfully 1`] = `
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"restDisplacementThreshold": 10,
"restSpeedThreshold": 10,
"stiffness": 1000,
},
},
@@ -365,8 +363,8 @@ exports[`StackNavigator renders successfully 1`] = `
"damping": 500,
"mass": 3,
"overshootClamping": true,
"restDisplacementThreshold": 0.01,
"restSpeedThreshold": 0.01,
"restDisplacementThreshold": 10,
"restSpeedThreshold": 10,
"stiffness": 1000,
},
},
@@ -551,7 +549,7 @@ exports[`StackNavigator renders successfully 1`] = `
pointerEvents="box-none"
style={
Object {
"marginHorizontal": 18,
"marginHorizontal": 16,
"opacity": 1,
}
}

View File

@@ -11,8 +11,8 @@ export const TransitionIOSSpec: TransitionSpec = {
damping: 500,
mass: 3,
overshootClamping: true,
restDisplacementThreshold: 0.01,
restSpeedThreshold: 0.01,
restDisplacementThreshold: 10,
restSpeedThreshold: 10,
},
};

View File

@@ -307,6 +307,8 @@ export default class HeaderSegment extends React.Component<Props, State> {
})
: null;
const rightButton = right ? right({ tintColor: headerTintColor }) : null;
return (
<React.Fragment>
<Animated.View
@@ -345,8 +347,17 @@ export default class HeaderSegment extends React.Component<Props, State> {
pointerEvents="box-none"
style={[
headerTitleAlign === 'left'
? { position: 'absolute', left: leftButton ? 72 : 16 }
: { marginHorizontal: 18 },
? {
position: 'absolute',
left: (leftButton ? 72 : 16) + insets.left,
right: (rightButton ? 72 : 16) + insets.right,
}
: {
marginHorizontal:
(leftButton ? 32 : 16) +
(leftLabelLayout?.width || 0) +
Math.max(insets.left, insets.right),
},
titleStyle,
titleContainerStyle,
]}
@@ -359,7 +370,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
style: customTitleStyle,
})}
</Animated.View>
{right ? (
{rightButton ? (
<Animated.View
pointerEvents="box-none"
style={[
@@ -369,7 +380,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
rightContainerStyle,
]}
>
{right({ tintColor: headerTintColor })}
{rightButton}
</Animated.View>
) : null}
</View>

View File

@@ -2,7 +2,7 @@ import * as React from 'react';
import { Animated, StyleSheet, Platform } from 'react-native';
import useTheme from '../../../utils/useTheme';
type Props = React.ComponentProps<typeof Animated.Text> & {
type Props = Omit<React.ComponentProps<typeof Animated.Text>, 'key'> & {
tintColor?: string;
children?: string;
};

View File

@@ -8,8 +8,8 @@ import {
Route,
Scene,
Layout,
StackCardMode,
StackHeaderMode,
StackCardMode,
TransitionPreset,
} from '../../types';