feat: Dark Theme (#131)

* refactor: Add DarkTheme, new colors in theme & update components to use it

* chore: Remove 'console.log' statements

* chore: Change dark theme property from string to boolean

* feat: Add ability to toggle the theme from the drawer

* fix: Wrap typography example screen with 'withTheme'

* style: Update components to use correct dark theme colors

* style: Update dark theme primary color and rn-navigation toolbar now gets the color from the theme

* style: Add color prop to DrawerItem and update the example

* style: Change the unchecked color in both Checkbox and RadioButton

* chore: Add `yarn-error.log` to `.gitignore`

* chore: Use lodash instead of lodash.merge

* chore: Address PR comments
This commit is contained in:
Ahmed Elhanafy
2017-10-13 15:29:28 +02:00
committed by Satyajit Sahoo
parent bd1d481f58
commit 8adfa6751e
32 changed files with 416 additions and 339 deletions

View File

@@ -1,23 +1,27 @@
/* @flow */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { ScrollView, StyleSheet } from 'react-native';
import {
Title,
Caption,
Paragraph,
Colors,
Card,
Button,
withTheme,
} from 'react-native-paper';
export default class CardExample extends Component {
class CardExample extends Component {
static title = 'Card';
static propTypes = {
theme: PropTypes.object.isRequired,
};
render() {
const { theme: { colors: { background } } } = this.props;
return (
<ScrollView
style={styles.container}
style={[styles.container, { backgroundColor: background }]}
contentContainerStyle={styles.content}
>
<Card>
@@ -65,7 +69,8 @@ const styles = StyleSheet.create({
flex: 1,
},
content: {
backgroundColor: Colors.grey200,
padding: 4,
},
});
export default withTheme(CardExample);