added property inside drawerConfig to backgroundColor (drawerBackgroundColor) (#2698)

This commit is contained in:
Lucas Padilha
2017-10-08 06:40:08 -03:00
parent 05b71be0fd
commit 301ea45365
3 changed files with 5 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ const DefaultDrawerConfig = {
Dimensions.get('window').width - (Platform.OS === 'android' ? 56 : 64),
contentComponent: DrawerItems,
drawerPosition: 'left',
drawerBackgroundColor: 'white',
useNativeAnimations: true,
};
@@ -48,6 +49,7 @@ const DrawerNavigator = (
contentOptions,
drawerPosition,
useNativeAnimations,
drawerBackgroundColor,
...tabsConfig
} = mergedConfig;
@@ -83,6 +85,7 @@ const DrawerNavigator = (
)((props: *) => (
<DrawerView
{...props}
drawerBackgroundColor={drawerBackgroundColor}
drawerLockMode={drawerLockMode}
useNativeAnimations={useNativeAnimations}
drawerWidth={drawerWidth}

View File

@@ -125,6 +125,5 @@ export default withCachedChildNavigation(DrawerSidebar);
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
});

View File

@@ -36,6 +36,7 @@ export type DrawerViewConfig = {
contentOptions?: {},
style?: ViewStyleProp,
useNativeAnimations?: boolean,
drawerBackgroundColor?: String,
};
type Props = DrawerViewConfig & {
@@ -160,6 +161,7 @@ export default class DrawerView<T: *> extends PureComponent<void, Props, void> {
(this.props.screenProps && this.props.screenProps.drawerLockMode) ||
(config && config.drawerLockMode)
}
drawerBackgroundColor={this.props.drawerBackgroundColor}
drawerWidth={this.props.drawerWidth}
onDrawerOpen={this._handleDrawerOpen}
onDrawerClose={this._handleDrawerClose}