mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-15 10:28:13 +08:00
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:
committed by
Satyajit Sahoo
parent
bd1d481f58
commit
8adfa6751e
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user