-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
123 lines (113 loc) · 2.81 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React from "react";
// import type {PropsWithChildren} from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
Button,
TouchableOpacity
} from "react-native";
import Geolocation from "@react-native-community/geolocation";
import { Colors } from "react-native/Libraries/NewAppScreen";
import Header from "./components/Header";
const getCurrentLocation = async () => {
Geolocation.getCurrentPosition((info) => console.log(info));
};
function App(): JSX.Element {
const isDarkMode = useColorScheme() === "dark";
const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter
};
const onPress = () => console.log("hello simon");
return (
<SafeAreaView style={backgroundStyle}>
<StatusBar
barStyle={isDarkMode ? "light-content" : "dark-content"}
backgroundColor={backgroundStyle.backgroundColor}
/>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}
>
<Header />
<View style={styles.container}>
<View style={styles.top}>
<TouchableOpacity
style={styles.appButtonContainer}
onPress={getCurrentLocation}
>
<Text style={styles.appButtonText}>From</Text>
</TouchableOpacity>
</View>
<View style={styles.middle}>
<View style={{ flexDirection: "row" }}>
<Text
style={[
styles.appButtonText,
{ color: "#009688", fontSize: 125, fontWeight: "500" }
]}
>
61
</Text>
<Text
style={[
styles.appButtonText,
{ color: "#009688", fontSize: 75, fontWeight: "500" }
]}
>
m
</Text>
</View>
</View>
<View style={styles.bottom}>
<TouchableOpacity style={styles.appButtonContainer}>
<Text style={styles.appButtonText}>To</Text>
</TouchableOpacity>
</View>
</View>
</ScrollView>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 20,
margin: 10
},
top: {
flex: 1
},
middle: {
flex: 2,
padding: 20
},
bottom: {
flex: 3
},
appButtonContainer: {
elevation: 8,
backgroundColor: "#009688",
borderRadius: 10,
paddingVertical: 10,
paddingHorizontal: 12
},
appButtonText: {
fontSize: 18,
color: "#fff",
fontWeight: "bold",
alignSelf: "center",
textTransform: "uppercase"
}
});
export default App;