Skip to content

Commit

Permalink
Set backgroundColor of drawer to white by default
Browse files Browse the repository at this point in the history
  • Loading branch information
xotahal committed Sep 15, 2016
1 parent d0b4123 commit f74240d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Drawer/Drawer.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,26 @@ const contextTypes = {
uiTheme: PropTypes.object.isRequired,
};

function getStyles(props, context) {
const { drawer } = context.uiTheme;

return {
container: [
drawer.container,
props.style.container,
],
};
}

class Drawer extends Component {
render() {
const { children } = this.props;

const styles = getStyles(this.props, this.context);

return (
<Container>
<ScrollView>
<ScrollView style={styles.container}>
{children}
</ScrollView>
</Container>
Expand Down
1 change: 1 addition & 0 deletions src/styles/getTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export default function getTheme(theme, ...more) {
drawer: StyleSheet.create(merge({
container: {
flex: 1,
backgroundColor: white,
},
}, theme.drawer)),
drawerHeader: StyleSheet.create(merge({
Expand Down

0 comments on commit f74240d

Please sign in to comment.