mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-14 01:54:59 +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,17 +1,22 @@
|
||||
/* @flow */
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { View, StyleSheet } from 'react-native';
|
||||
import { Colors, FAB } from 'react-native-paper';
|
||||
import { Colors, FAB, withTheme } from 'react-native-paper';
|
||||
|
||||
export default class ButtonExample extends Component {
|
||||
class ButtonExample extends Component {
|
||||
static title = 'Floating Action Button';
|
||||
static propTypes = {
|
||||
theme: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
_handlePress = () => {};
|
||||
|
||||
render() {
|
||||
const { theme: { colors: { background } } } = this.props;
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<View style={[styles.container, { backgroundColor: background }]}>
|
||||
<View style={styles.row}>
|
||||
<FAB
|
||||
small
|
||||
@@ -43,3 +48,5 @@ const styles = StyleSheet.create({
|
||||
margin: 8,
|
||||
},
|
||||
});
|
||||
|
||||
export default withTheme(ButtonExample);
|
||||
|
||||
Reference in New Issue
Block a user