forked from GeekyAnts/NativeBase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainer.js
More file actions
58 lines (46 loc) · 1.26 KB
/
Container.js
File metadata and controls
58 lines (46 loc) · 1.26 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* @flow */
'use strict';
import React, {View } from 'react-native';
import _ from 'lodash';
import Header from './Header';
import Content from './Content';
import Footer from './Footer';
import NativeBaseComponent from '../Base/NativeBaseComponent';
export default class Container extends NativeBaseComponent {
renderHeader() {
return _.find(this.props.children, function(item) {
if(item && item.type == Header) {
return true;
}
});
}
renderContent() {
return _.find(this.props.children, function(item) {
if(item && item.type == Content) {
return true;
}
});
}
renderFooter() {
return _.find(this.props.children, function(item) {
if(item && item.type == Footer) {
return true;
}
});
}
render() {
return(
<View style={{flex:1}}>
<View>
{this.renderHeader()}
</View>
<View style={{flex:1}}>
{this.renderContent()}
</View>
<View>
{this.renderFooter()}
</View>
</View>
);
}
}