-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubscriptions.js
120 lines (113 loc) · 3.68 KB
/
subscriptions.js
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import React, { Component } from 'react';
import {
View,
Text,
StyleSheet,
ScrollView,
Dimensions,
ListView,
TouchableHighlight,
Image,
TextInput } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialIcons'
import { samples } from '../components/businessInfo'
const { width, height } = Dimensions.get('window');
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2})
export default class Memberships extends Component {
constructor(props){
super(props)
this.state = {
dataSource: ds.cloneWithRows(samples),
text: ''
}
}
renderRow(rowData){
const img = rowData.image
return (
<TouchableHighlight style={styles.containerCell}>
<View>
<Image
style={{width: width, height: 180}}
source={{uri: img}}/>
<View style={styles.footerContainer}>
<View style={styles.footerTextContainer}>
<Text style={styles.text}>Number of points</Text>
</View>
</View>
</View>
</TouchableHighlight>
);
}
filterSearch(text){
const newData = samples.filter(function(item){
const businessData = item.image.toUpperCase()
const textData = text.toUpperCase()
return businessData.indexOf(textData) > -1
})
this.setState({
dataSource: this.state.dataSource.cloneWithRows(newData),
text: text
})
}
render() {
return (
<View style={styles.container}>
<ScrollView
style={{flex: 1}}
//scrollEventThrottle={200}
directionalLockEnabled={true}>
<View style={{padding: 40, alignItems: 'center', justifyContent: 'center', flexDirection: 'row'}}>
<Text style={{color: '#800080', fontSize: 50}}>10000</Text>
<Icon
name='monetization-on'
size={50}
color='#800080'
/>
</View>
<View style={{padding: 10}}>
<Text>Exchange Points</Text>
</View>
<View>
<Text style={{paddingBottom: 5, color: '#800080', fontSize: 20, textAlign: 'center'}}>Memberships</Text>
</View>
<TextInput
style={styles.textInput}
underlineColorAndroid='rgba(0,0,0,0)'
selectionColor='#800080'
clearButtonMode='while-editing'
clearTextOnFocus={true}
placeholder='Search'
onChangeText={(text) => this.filterSearch(text)}
value={this.state.text}
/>
<ListView
enableEmptySections={true}
style={{marginHorizontal: 10}}
renderRow={this.renderRow.bind(this)}
dataSource={this.state.dataSource}
/>
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
//backgroundColor: '#800080'
},
textContainer: {
//color: 'white'
},
textInput: {
height: 35,
borderWidth: 1,
textAlignVertical: 'center',
borderRadius: 20,
borderColor: '#800080',
marginBottom: 10,
marginHorizontal: 10,
fontSize: 14,
justifyContent: 'center'
},
})