-
Notifications
You must be signed in to change notification settings - Fork 82
/
Notification.js
64 lines (56 loc) · 1.23 KB
/
Notification.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
'use strict';
var React = require('react');
var ReactNative = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity,
Dimensions
} = ReactNative;
var Controllers = require('react-native-controllers');
var {
Notification,
} = Controllers;
var NotificationExample = React.createClass({
_onButtonClick: function() {
Notification.dismiss();
},
render: function() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
{this.props.greeting}
</Text>
<TouchableOpacity onPress={ this._onButtonClick }>
<Text style={styles.button}>Dismiss</Text>
</TouchableOpacity>
</View>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
width: Dimensions.get('window').width,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#d6e7ad'
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
paddingTop: 20
},
button: {
textAlign: 'center',
fontSize: 18,
marginBottom: 10,
marginTop:10,
color: '#4692ad'
}
});
AppRegistry.registerComponent('NotificationExample', () => NotificationExample);
module.exports = NotificationExample;