From aa0efd2e64f0e7e01c85f38dadee912ae0547078 Mon Sep 17 00:00:00 2001 From: JasperStam Date: Fri, 1 Jul 2016 04:30:59 -0700 Subject: [PATCH] Add cardStyle prop to NavigationCardStack. Summary: This allows the `NavigationCard` style to be extended, the default `backgroundColor` style of the `NavigationCard` is not applicable to all apps. Fixes issue #8116. PR #8115 was already made for this but didn't pass CI checks. **Test plan** When rendering a NavigationCardStack, add ``` const { CardStack } = NavigationExperimental; ... ``` to see that the `NavigationCard` background has changed to purple. Closes https://github.com/facebook/react-native/pull/8471 Differential Revision: D3508849 Pulled By: javache fbshipit-source-id: 65703cccf3d01def9f2060256f0ff564bbdc47d3 --- .../NavigationExperimental/NavigationCardStack.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js b/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js index ed09cdafd13..8373b4ddafc 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js @@ -64,6 +64,7 @@ type Props = { onNavigateBack?: Function, renderOverlay: ?NavigationSceneRenderer, renderScene: NavigationSceneRenderer, + cardStyle?: any, style: any, }; @@ -96,6 +97,7 @@ class NavigationCardStack extends React.Component { onNavigateBack: PropTypes.func, renderOverlay: PropTypes.func, renderScene: PropTypes.func.isRequired, + cardStyle: View.propTypes.style, }; static defaultProps: DefaultProps = { @@ -192,7 +194,7 @@ class NavigationCardStack extends React.Component { key={'card_' + props.scene.key} panHandlers={panHandlers} renderScene={this.props.renderScene} - style={style} + style={[style, this.props.cardStyle]} /> ); }