-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
44 lines (39 loc) · 1.19 KB
/
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
36
37
38
39
40
41
42
43
44
import { useState } from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { ProcessTransaction } from './modules/demo-datacap';
export default function App() {
const [result, setResult] = useState<string | null>(null);
return (
<View style={styles.container}>
<Text>App.tsx</Text>
<Text>Android demo launched</Text>
{result === null ? null : (
<Text style={styles.text}>
Result: {`${typeof result === 'string' ? result : typeof result}`}
</Text>
)}
<TouchableOpacity
style={styles.button}
onPress={() => ProcessTransaction('<xml>sample-data</xml>', setResult)}
>
<Text style={styles.buttonText}>Run Demo Module</Text>
</TouchableOpacity>
</View>
);
}
const styles = StyleSheet.create({
button: { backgroundColor: '#F2a000', borderRadius: 5, padding: 10, width: '50%' },
buttonText: { color: '#fff', fontSize: 20, textAlign: 'center' },
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'space-evenly',
},
text: {
fontSize: 20,
textAlign: 'center',
color: '#d3e',
fontWeight: 'bold',
},
});