-
Notifications
You must be signed in to change notification settings - Fork 1
/
googleapi.form.android.js
55 lines (47 loc) · 1.07 KB
/
googleapi.form.android.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
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
Modal,
TouchableHighlight,
WebView,
ListView,
} = React;
var urlparser = require('./urlparser');
var Subscribable = require('Subscribable');
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
var LoginModule = require('LoginModule');
var LoginView = React.createClass({
mixins: [Subscribable.Mixin],
propTypes: {
client_id: React.PropTypes.string.isRequired,
onCode: React.PropTypes.func.isRequired,
},
componentWillMount: function() {
var that = this;
this.addListenerOn(RCTDeviceEventEmitter,
'login',
function(e) {
that.props.onCode(e.code);
});
},
componentDidMount: function() {
LoginModule.login(
this.props.client_id);
},
render() {
return (
<View/>
);
}
});
var styles = StyleSheet.create({
webView: {
backgroundColor: 'rgba(255,255,255,0.8)',
height: 350,
},
});
module.exports = LoginView;