-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathApp.js
More file actions
49 lines (42 loc) · 1.31 KB
/
App.js
File metadata and controls
49 lines (42 loc) · 1.31 KB
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
import React, { Component } from 'react';
import { StyleSheet, ViewPagerAndroidProps } from 'react-native';
import CustomAlertComponent from './CustomAlertComponent';
export default class App extends Component {
constructor(props) {
super(props);
this.onPressAlertPositiveButton = this.onPressAlertPositiveButton.bind(this);
this.onPressAlertNegativeButton = this.onPressAlertNegativeButton.bind(this);
}
onPressAlertPositiveButton = () => {
alert('Positive Button Clicked');
};
onPressAlertNegativeButton = () => {
alert('Negative Button Clicked');
};
render() {
return (
<View style={styles.container}>
<CustomAlertComponent
displayAlert={true}
displayAlertIcon={true}
alertTitleText={'Alert Title from Props'}
alertMessageText={'Alert message from props'}
displayPositiveButton={true}
positiveButtonText={'OK'}
displayNegativeButton={true}
negativeButtonText={'CANCEL'}
onPressPositiveButton={this.onPressAlertPositiveButton}
onPressNegativeButton={this.onPressAlertNegativeButton}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
}
});