-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLogSummoner.js
103 lines (94 loc) · 2.08 KB
/
LogSummoner.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
var React = require('react-native'),
Region = require('./StaticData/Region.js'),
RegionView = require('./RegionView.js');
var {
TextInput,
StyleSheet,
View,
Text,
Image,
TouchableHighlight,
ActivityIndicatorIOS
} = React;
var LogSummoner = React.createClass ({
getInitialState: function() {
return {
loaded: false,
inputValue : '',
regionValue : 'NA',
};
},
navigateToRegionView : function(callback){
var currency = Region.currency;
var self = this;
self.props.navigator.push({
title: "Region",
component: RegionView,
passProps:{currency:currency, onSelect : callback },
});
},
handleRegionButtonPressed : function(){
var self = this;
this.navigateToRegionView(function(key){
self.state.regionValue = key
});
},
onSearchTextChanged : function(event){
this.setState({inputValue: event.nativeEvent.text});
},
render: function (){
return (
<View style = {styles.container}>
<View style = {styles.inputsContainer}>
<TextInput
value={this.state.inputValue}
placeholder="Summoner Name"
autoCorrect={false}
onChange={this.onSearchTextChanged.bind(this)}
style={styles.textInput} />
<TouchableHighlight onPress={this.handleRegionButtonPressed}>
<View style={styles.buttonContainer}>
<Text style={styles.buttonText}>{this.state.regionValue}</Text>
</View>
</TouchableHighlight>
</View>
</View>
);
}
});
var styles = StyleSheet.create({
buttonContainer : {
borderRadius: 3,
borderColor :'#0ea378',
backgroundColor: 'black',
height: 40
},
buttonText: {
fontSize: 18,
fontWeight: 'bold',
color: 'white',
alignSelf: 'center',
marginTop: 8
},
container: {
flex: 1,
padding: 16,
marginTop: 50
},
inputsContainer: {
marginTop : 150
},
textInput: {
height: 40,
marginBottom: 10,
marginTop: 10,
padding: 4,
fontSize: 18,
borderWidth: 1,
borderColor: '#0ea378',
backgroundColor: 'white',
borderRadius: 3,
justifyContent: 'flex-end'
}
});
module.exports = LogSummoner;