-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (37 loc) · 1.11 KB
/
index.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
import React from 'react';
import {AppRegistry, StyleSheet, Text, View, Button, NativeModules} from 'react-native';
class ReactNativeModal extends React.Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.hello}>Hello modal!</Text>
<Text style={styles.message}>
I'm a react native component. Click on the button to close me using native function.
</Text>
<Button
title={"Close me"}
onPress={() => NativeModules.ReactNativeModalBridge.closeModal()}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#BBBBBB',
},
hello: {
fontSize: 28,
fontWeight: "600",
textAlign: 'center',
},
message: {
fontSize: 20,
textAlign: 'center',
margin: 20
}
});
AppRegistry.registerComponent('ReactNativeModal', () => ReactNativeModal);