forked from d-a-n/react-native-webbrowser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
StatusBar.js
53 lines (42 loc) · 1.05 KB
/
StatusBar.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
'use strict';
import React from 'react';
import {
TextInput,
View,
} from 'react-native';
import BaseComponent from './BaseComponent'
import styles from './styles'
class StatusBar extends BaseComponent {
constructor(props) {
super(props);
this.inputText = '';
this.state = {
status: this.props.status
};
}
componentWillReceiveProps(nextProps) {
this.setState({
status: nextProps.status
});
}
render() {
return (
<View style={styles.statusBar}>
<TextInput
value={this.state.status}
style={[styles.statusBarText, this.props.foregroundColor && {color:this.props.foregroundColor}]}
editable={false}
numberOfLines={1}
/>
</View>
);
}
}
StatusBar.propTypes = {
status: React.PropTypes.string,
foregroundColor: React.PropTypes.string
};
StatusBar.defaultProps = {
status: '',
};
module.exports = StatusBar;