This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
95 lines (86 loc) · 2.41 KB
/
App.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import React, { useEffect, useState } from "react";
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View, TouchableOpacity, TouchableHighlight } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
// import MapView, {Marker} from 'react-native-maps';
import { WebView } from 'react-native-webview';
const Stack = createNativeStackNavigator();
const HomeScreen = ( {navigation} ) => {
const [ cnt, setCnt ] = useState( 0 );
const onPress = () => {
setCnt( lastCnt => lastCnt + 1 );
console.log( `Cnt is ${ cnt + 1 }; Was ${ cnt }` );
};
return (
<View style={styles.container}>
<Text style={styles.title}>Hello, World! Cnt is { cnt }.</Text>
<TouchableOpacity style={styles.button} onPress={ onPress }>
<Text style={styles.text}>Hello, World! Pressed { cnt < 100 ? (cnt + "time" + (cnt === 1 ? '' : s) + "so far.") : `Damn bruh r u from ohio? ${cnt} times` }</Text>
</TouchableOpacity>
</View>
);
}
const MapScreen = ( {navigation, props} ) => {
return(
<View style={ styles.container }>
<WebView source={{ uri: 'https://maps.google.com' }}/>
</View>
)
}
const App = () => {
console.log( "Hello, World!" );
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={ HomeScreen }
options={{ title: "Hello, World!", headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
/*
<View style={styles.container}>
<Text style={styles.text}>Open up App.js to start working on your app!</Text>
<Text style={styles.text}>Hello, World!</Text>
<Button
onPress={() => console.log( "Hello Button!" ) }
style={styles.button}
title="Hello Button"/>
</View>
*/
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#20272F',
color: '#ddd',
alignItems: 'center',
justifyContent: 'center',
lineHeight: 100,
},
text: {
color: '#ddd',
fontSize: 20,
},
title: {
fontSize: 27,
color: "#dff"
},
button: {
color: "#fff",
backgroundColor: "#111a2F",
borderColor: "#FFFFFF",
borderStyle: "solid",
borderWidth: 1,
borderRadius: 12,
padding: 5,
margin: 50,
width: '40%',
alignContent: 'center',
alignItems: 'center',
},
});
export default App;