-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
35 lines (31 loc) · 905 Bytes
/
App.tsx
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
import { StatusBar } from "expo-status-bar";
import { useState } from "react";
import { StyleSheet, View, Button } from "react-native";
import { WebViewMessageEvent } from "react-native-webview";
import Teller from "./components/teller";
export default function App() {
const [modal, setModal] = useState(false);
function handleEnroll(event: WebViewMessageEvent) {
const data = JSON.parse(event.nativeEvent.data);
console.log(data);
}
return (
<View style={styles.container}>
<Button title="Add Institution" onPress={() => setModal(true)} />
<StatusBar style="auto" />
<Teller
show={modal}
handleHideModal={() => setModal(false)}
onEnroll={handleEnroll}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});