mirror of
https://github.com/zhigang1992/react-native-paper.git
synced 2026-06-15 18:38:08 +08:00
style: Adapt dialog to the dark theme (#196)
* style: Adapt dialog to the dark theme * chore: Remove unused default prop & set correct elevation style & rename import * style: Fix textinput background color * chore: Add missing proptypes * chore: Update with latest master
This commit is contained in:
committed by
Ferran Negre
parent
bf0d65a17f
commit
c552aa0951
@@ -1,19 +1,24 @@
|
||||
/* @flow */
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { ScrollView, StyleSheet } from 'react-native';
|
||||
import { Colors, TextInput } from 'react-native-paper';
|
||||
import { TextInput, withTheme } from 'react-native-paper';
|
||||
|
||||
export default class TextInputExample extends Component {
|
||||
class TextInputExample extends Component {
|
||||
static title = 'TextInput';
|
||||
static propTypes = {
|
||||
theme: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
state = {
|
||||
text: '',
|
||||
};
|
||||
|
||||
render() {
|
||||
const { theme: { colors: { background } } } = this.props;
|
||||
return (
|
||||
<ScrollView style={styles.container}>
|
||||
<ScrollView style={[styles.container, { backgroundColor: background }]}>
|
||||
<TextInput
|
||||
style={styles.inputContainerStyle}
|
||||
label="Normal input"
|
||||
@@ -34,10 +39,11 @@ export default class TextInputExample extends Component {
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: Colors.white,
|
||||
padding: 8,
|
||||
},
|
||||
inputContainerStyle: {
|
||||
margin: 8,
|
||||
},
|
||||
});
|
||||
|
||||
export default withTheme(TextInputExample);
|
||||
|
||||
Reference in New Issue
Block a user