Enable setting custom styles on scenes stack

Summary: There's scenarios where you might want to retain transparency behind the header, but have a solid background for the scene stack and its transitions.

Reviewed By: ericvicenti, dwwoelfel

Differential Revision: D4471681

fbshipit-source-id: 529e999b96b02a00e8d625169989dda49fb3ddaa
This commit is contained in:
Sean Kinsey 2017-01-26 20:38:46 -08:00 committed by Facebook Github Bot
parent 7e869b9d0a
commit 2cfb3f1f8f

View File

@ -68,6 +68,7 @@ type Props = {
gestureResponseDistance?: ?number,
enableGestures: ?boolean,
cardStyleInterpolator?: ?NavigationStyleInterpolator,
scenesStyle?: any,
};
type DefaultProps = {
@ -202,6 +203,11 @@ class NavigationCardStack extends React.Component<DefaultProps, Props, void> {
* Custom style applied to the cards stack.
*/
style: View.propTypes.style,
/**
* Custom style applied to the scenes stack.
*/
scenesStyle: View.propTypes.style,
};
static defaultProps: DefaultProps = {
@ -264,7 +270,7 @@ class NavigationCardStack extends React.Component<DefaultProps, Props, void> {
return (
<View style={styles.container}>
<View
style={styles.scenes}>
style={[styles.scenes, this.props.scenesStyle]}>
{scenes}
</View>
{header}