From 13500d3aeccae7879c1aac65ab162cee412d245e Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Fri, 5 Apr 2019 15:37:49 +0100 Subject: [PATCH 1/4] Add headerWrapperStyle --- src/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 79ac5a0..e0b9208 100644 --- a/src/index.js +++ b/src/index.js @@ -46,6 +46,11 @@ export default class ParallaxScroll extends Component { fadeOutParallaxForeground: PropTypes.bool, fadeOutParallaxBackground: PropTypes.bool, headerFixedBackgroundColor: PropTypes.string, + headerWrapperStyle: PropTypes.oneOfType([ + PropTypes.array, + PropTypes.number, + PropTypes.object + ]), renderBackgroundPlaceholder: PropTypes.func, parallaxBackgroundScrollSpeed: PropTypes.number, parallaxForegroundScrollSpeed: PropTypes.number @@ -83,6 +88,7 @@ export default class ParallaxScroll extends Component { fadeOutParallaxForeground: false, fadeOutParallaxBackground: false, headerFixedBackgroundColor: 'rgba(0, 0, 0, 1)', + headerWrapperStyle: {}, renderBackgroundPlaceholder: null, parallaxBackgroundScrollSpeed: 5, parallaxForegroundScrollSpeed: 5 @@ -329,6 +335,7 @@ export default class ParallaxScroll extends Component { headerFixedTransformY, headerBackgroundColor, headerFixedBackgroundColor + headerWrapperStyles, } = this.props; const wrapperStyle = { @@ -381,7 +388,7 @@ export default class ParallaxScroll extends Component { } return ( - + {renderHeader({ width, height, animatedValue: this.scrollY })} From ac99bfa71b86bd7cd4ffeb838185669ec629e80e Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Fri, 5 Apr 2019 15:40:27 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 92f72d3..f684337 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ The `ParallaxScroll` component adds a few additional properties, as described be | `scrollStyle` | `object` | `{}` | These styles will be applied to the scroll view. | | `headerHeight` | `number` | `45` | This is the height of sticky(fixed) header. | | `renderHeader` | `({ width, height, animatedValue }) => {}` | `null` | This renders an optional sticky(fixed) header that will be visible to the top of the view. | +| `headerWrapperStyle` | `object` | `{}` | These styles will be applied to the header wrapper view. | | `onHeaderFixed` | `func` | `null` | A callback function that is invoked when the header will attach to the top. | | `isHeaderFixed` | `bool` | `false` | Is header fixed to top(not sticky)? | | `parallaxHeight` | `number` | `Dimensions.get('window').width * 9 / 16` | This is the height of parallax. | From 1cbbd20324700b1456052fe71133f7649b2309d8 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Fri, 5 Apr 2019 15:46:09 +0100 Subject: [PATCH 3/4] Correct comma --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index e0b9208..10c547b 100644 --- a/src/index.js +++ b/src/index.js @@ -334,8 +334,8 @@ export default class ParallaxScroll extends Component { useNativeDriver, headerFixedTransformY, headerBackgroundColor, - headerFixedBackgroundColor - headerWrapperStyles, + headerFixedBackgroundColor, + headerWrapperStyles } = this.props; const wrapperStyle = { From 73a61c04503d70bc03f378ff1f4d8b6eb3f78ff2 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Fri, 5 Apr 2019 15:50:54 +0100 Subject: [PATCH 4/4] Correct variable name --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 10c547b..67dbc5b 100644 --- a/src/index.js +++ b/src/index.js @@ -335,7 +335,7 @@ export default class ParallaxScroll extends Component { headerFixedTransformY, headerBackgroundColor, headerFixedBackgroundColor, - headerWrapperStyles + headerWrapperStyle } = this.props; const wrapperStyle = {