Compare commits

..

3 Commits
2.6.0 ... 2.6.1

Author SHA1 Message Date
Brent Vatne
a69b67d6d2 Release 2.6.1 2018-07-05 15:03:14 -07:00
Brent Vatne
dc436e4d01 Warn for more invalid header styles 2018-07-05 15:02:48 -07:00
Brent Vatne
fe95bdeee6 Fix regression for shadow in header on Android 2018-07-05 14:53:41 -07:00
3 changed files with 40 additions and 3 deletions

View File

@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
## [2.6.1] - [2018-07-05)()
### Added
- Warn for more invalid headerStyle properties (padding, top/right/bottom/left, position).
### Fixed
- Fixed missing header shadow on Android.
## [2.6.0] - [2018-07-04](https://github.com/react-navigation/react-navigation/releases/tag/2.6.0)
### Added
- [NavigationEvents](https://github.com/react-navigation/react-navigation/pull/4188) component as a declarative interface for subscribing to navigation focus events.

View File

@@ -1,6 +1,6 @@
{
"name": "react-navigation",
"version": "2.6.0",
"version": "2.6.1",
"description": "Routing and navigation for your React Native apps",
"main": "src/react-navigation.js",
"repository": {

View File

@@ -473,6 +473,18 @@ class Header extends React.PureComponent {
flexShrink,
flexBasis,
flexWrap,
position,
padding,
paddingHorizontal,
paddingVertical,
paddingTop,
paddingRight,
paddingBottom,
paddingLeft,
top,
right,
bottom,
left,
...safeHeaderStyle
} = headerStyleObj;
@@ -485,6 +497,18 @@ class Header extends React.PureComponent {
warnIfHeaderStyleDefined(flexShrink, 'flexShrink');
warnIfHeaderStyleDefined(flexBasis, 'flexBasis');
warnIfHeaderStyleDefined(flexWrap, 'flexWrap');
warnIfHeaderStyleDefined(padding, 'padding');
warnIfHeaderStyleDefined(position, 'position');
warnIfHeaderStyleDefined(paddingVertical, 'paddingVertical');
warnIfHeaderStyleDefined(paddingHorizontal, 'paddingHorizontal');
warnIfHeaderStyleDefined(paddingTop, 'paddingTop');
warnIfHeaderStyleDefined(paddingRight, 'paddingRight');
warnIfHeaderStyleDefined(paddingBottom, 'paddingBottom');
warnIfHeaderStyleDefined(paddingLeft, 'paddingLeft');
warnIfHeaderStyleDefined(top, 'top');
warnIfHeaderStyleDefined(right, 'right');
warnIfHeaderStyleDefined(bottom, 'bottom');
warnIfHeaderStyleDefined(left, 'left');
}
// TODO: warn if any unsafe styles are provided
@@ -503,7 +527,9 @@ class Header extends React.PureComponent {
<Animated.View
style={[
this.props.layoutInterpolator(this.props),
{ backgroundColor: DEFAULT_BACKGROUND_COLOR },
Platform.OS === 'ios'
? { backgroundColor: DEFAULT_BACKGROUND_COLOR }
: null,
]}
>
<SafeAreaView forceInset={forceInset} style={containerStyles}>
@@ -518,7 +544,11 @@ class Header extends React.PureComponent {
}
function warnIfHeaderStyleDefined(value, styleProp) {
if (value !== undefined) {
if (styleProp === 'position' && value === 'absolute') {
console.warn(
"position: 'absolute' is not supported on headerStyle. If you would like to render content under the header, use the headerTransparent navigationOption."
);
} else if (value !== undefined) {
console.warn(
`${styleProp} was given a value of ${value}, this has no effect on headerStyle.`
);