2017-08-09 13:12:00 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2017-09-21 17:08:00 +00:00
|
|
|
import { KeyboardAvoidingView } from 'react-native';
|
2017-08-09 13:12:00 +00:00
|
|
|
|
|
|
|
export default class KeyboardView extends React.PureComponent {
|
|
|
|
static propTypes = {
|
|
|
|
style: KeyboardAvoidingView.propTypes.style,
|
|
|
|
keyboardVerticalOffset: PropTypes.number,
|
2017-08-09 16:19:17 +00:00
|
|
|
children: PropTypes.oneOfType([
|
|
|
|
PropTypes.arrayOf(PropTypes.node),
|
|
|
|
PropTypes.node
|
|
|
|
])
|
2017-08-09 13:12:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2017-09-21 17:08:00 +00:00
|
|
|
<KeyboardAvoidingView style={this.props.style} behavior='padding' keyboardVerticalOffset={this.props.keyboardVerticalOffset}>
|
2017-08-09 13:12:00 +00:00
|
|
|
{this.props.children}
|
|
|
|
</KeyboardAvoidingView>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|