-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathApp.tsx
More file actions
49 lines (45 loc) · 1.14 KB
/
Copy pathApp.tsx
File metadata and controls
49 lines (45 loc) · 1.14 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 from 'react';
import {Alert, Button, StyleSheet} from 'react-native';
import NitroInAppBrowser from 'react-native-nitro-in-app-browser';
import {SafeAreaProvider, SafeAreaView} from 'react-native-safe-area-context';
const AppWrapper = () => {
return (
<SafeAreaView style={styles.container}>
<Button
title="Open Nowie Tech"
onPress={async () => {
try {
await NitroInAppBrowser.open('https://nowietech.com', {
barColor: 'purple',
controlColor: '#000000',
dismissButtonLabel: 'close',
presentationStyle: 'fullScreen',
});
} catch (error) {
Alert.alert('Error', (error as Error).message, [
{
text: 'OK',
onPress: () => {},
},
]);
}
}}
/>
</SafeAreaView>
);
};
const App = () => {
return (
<SafeAreaProvider>
<AppWrapper />
</SafeAreaProvider>
);
};
export default App;
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});