mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-14 09:59:26 +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
@@ -8,14 +8,16 @@ import {
|
||||
Paragraph,
|
||||
Subheading,
|
||||
Title,
|
||||
withTheme,
|
||||
} from 'react-native-paper';
|
||||
|
||||
export default class TextExample extends Component {
|
||||
class TextExample extends Component {
|
||||
static title = 'Typography';
|
||||
|
||||
render() {
|
||||
const { theme: { colors: { background } } } = this.props;
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<View style={[styles.container, { backgroundColor: background }]}>
|
||||
<Caption style={styles.text}>Caption</Caption>
|
||||
<Paragraph style={styles.text}>Paragraph</Paragraph>
|
||||
<Subheading style={styles.text}>Subheading</Subheading>
|
||||
@@ -28,8 +30,11 @@ export default class TextExample extends Component {
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
padding: 16,
|
||||
flex: 1,
|
||||
},
|
||||
text: {
|
||||
marginVertical: 4,
|
||||
},
|
||||
});
|
||||
|
||||
export default withTheme(TextExample);
|
||||
|
||||
Reference in New Issue
Block a user