-
Notifications
You must be signed in to change notification settings - Fork 0
/
InputBar.js
46 lines (43 loc) · 1.22 KB
/
InputBar.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
import React, { Component, PropTypes } from 'react';
import { View, Text, TouchableHighlight,Navigator, Image, TouchableOpacity } from 'react-native';
import MyInput from './MyInput';
var styles = require('./styles');
var nav;
export default class InputBar extends Component {
constructor(props){
super(props);
this.clearInput = ()=>{
this.refs["myInput"].clearAndBlur();
}
}
_onPressButton() {
console.log("You tapped the button!");
nav.push({
page: <HomePage/> ,
index:0
});
this.state={name:"Guest_69"};
}
render() {
var barContent;
if(this.props.hideInput){
barContent =
<View style={styles.centerInputBar}>
<Text style={styles.inputBarText}>
{"Waiting on "+this.props.guest}
</Text>
</View>;
}else{
barContent = <MyInput type="gameInput" text="Type A Word!" ref="myInput" fin={this.props.onSubmit} focusFunc={()=>{}} blurFunc={()=>{}}/>;
}
return(
<View>
<View style={styles.inputView}>
{barContent}
</View>
<View style={styles.inputBoxShadow}>
</View>
</View>
)
}
}