-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
182 lines (137 loc) · 3.05 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View, Button, Alert, TouchableOpacity} from 'react-native';
import React, { Component, useState, useEffect } from 'react';
import GetCarData from "./components/GetCarData";
import axios from 'axios';
var baseURL = "http://192.168.1.190:8000/?func=";
/*
class netCall {
render () {
console.log("nc")
return (
<Text>Hello World!</Text>
)
}
}
function App() {
let [battStatus, setDogImage] = useState(null)
let [lockStatus, setLockStatus] = useState(null)
const [data, setData] = useState({ hits: [] });
useEffect(() => {
var url = baseURL + "lockstatus"
const fetchData = async () => {
const result = await axios(
url,
);
console.log(result.data)
setData(result.data);
};
fetchData();
}, []);
return (
<View style={{ flex: 2, backgroundColor: "darkorange", justifyContent: 'center',}}>
<Text>
test
</Text>
</View>
)
}
*/
//export default App;
export default function App() {
return <GetCarData />;
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
},
txt: {
//flex: 1,
padding: 20,
margin: 10,
},
});
{
/*
const infoText = "..."
label: {
textAlign: "center",
marginBottom: 10,
fontSize: 24,
},
redrow: {
flex: 1,
backgroundColor: "red",
},
txt: {
color: "yellow",
margin: 10,
},
opacityButton: {
color: "green",
margin: 10,
}
});
const Flex = () => {
return (
<View style={[styles.container, {
// Try setting `flexDirection` to `"row"`.
flexDirection: "column"
}]}>
<View style={ styles.redrow }/>
<View style={{ flex: 2, backgroundColor: "darkorange" }}>
<Text style={styles.txt}>test</Text>
<Button
color="#f194ff"
title="Press me"
onPress={() => Alert.alert('Simple Button pressed')}
/>
<Button
title="Lock status"
onPress={() => {
_onPressButton();
}}
/>
<Text>{infoText}</Text>
<TouchableOpacity onPress={_onPressButton}>
<Text style = {styles.opacityButton}>
Dummy
</Text>
</TouchableOpacity >
</View>
<View style={{ flex: 3, backgroundColor: "green" }} />
</View>
);
};
const _onPressButton = () => {
return (
<View>
Alert.alert('Alrt Button pressed')
getCarData('lockstatus')
console.log("Ok")
</View>
);
}
const Alrt = () => {
return (
<View>
Alert.alert('Alrt Button pressed')
getCarData('lockstatus')
</View>
);
}
const App = () => {
return (
<View style={styles.container}>
<Flex/>
</View>
);
}
export default Flex; */
}
{/* */}
{/*
<Text>Open up App.js to start working! on your app!</Text>
<StatusBar style="auto" />
*/}