Home.js
1.69 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
58
59
60
61
62
'use strict';
import React from 'react-native';
import PlainTextSection from './PlainTextSection';
import TrendTextSection from './TrendTextSection';
import Placeholder from './Placeholder';
import Category from './Category';
let {
Component,
View,
Text,
ScrollView,
Platform
} = React;
export default class Home extends Component {
static propTypes = {
section1: React.PropTypes.arrayOf(
React.PropTypes.shape({
top: React.PropTypes.string,
bottom: React.PropTypes.string,
small: React.PropTypes.string,
style: View.propTypes.style,
})
),
section2: React.PropTypes.arrayOf(
React.PropTypes.shape({
top: React.PropTypes.string,
bottom: React.PropTypes.string,
small: React.PropTypes.string,
style: View.propTypes.style,
arrowUp: React.PropTypes.bool,
})
),
section3: React.PropTypes.arrayOf(
React.PropTypes.shape({
type: React.PropTypes.string,
thumb: React.PropTypes.number,
title: React.PropTypes.string,
})
),
onPressCategory: React.PropTypes.func,
};
render() {
return (
<ScrollView>
<TrendTextSection content={this.props.section1} />
<Placeholder />
<PlainTextSection content={this.props.section2} />
<Placeholder />
<Category content={this.props.section3} onPress={this.props.onPressCategory} />
</ScrollView>
);
}
}