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
36 lines (26 loc) · 842 Bytes
/
Content.js
File metadata and controls
36 lines (26 loc) · 842 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
35
/* @flow */
'use strict';
import React, {Text, View, ScrollView } from 'react-native';
import NativeBaseComponent from '../Base/NativeBaseComponent';
import _ from 'lodash';
import computeProps from '../../Utils/computeProps';
export default class Content extends NativeBaseComponent {
prepareRootProps() {
var type = {
backgroundColor: 'transparent',
flex: 1,
flexDirection: 'row',
padding: (this.props.padder) ? this.getTheme().contentPadding : 0
}
var defaultProps = {
contentContainerStyle: type
}
// console.log("content style", computeProps(this.props, defaultProps));
return computeProps(this.props, defaultProps);
}
render() {
return(
<ScrollView {...this.prepareRootProps()}>{this.props.children}</ScrollView>
);
}
}