forked from GeekyAnts/NativeBase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContent.js
More file actions
34 lines (30 loc) · 1014 Bytes
/
Content.js
File metadata and controls
34 lines (30 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React, { Component } from "react";
import PropTypes from "prop-types";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import { connectStyle } from "native-base-shoutem-theme";
import mapPropsToStyleNames from "../Utils/mapPropsToStyleNames";
class Content extends Component {
render() {
return (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
}
}
Content.propTypes = {
style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
padder: PropTypes.bool,
disableKBDismissScroll: PropTypes.bool,
enableResetScrollToCoords: PropTypes.bool,
};
const StyledContent = connectStyle("NativeBase.Content", {}, mapPropsToStyleNames)(Content);
export { StyledContent as Content };