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
|
import React from 'react';
import { StyleSheet, View, Text, GestureResponderEvent, ActivityIndicator, Linking, TextInput, Slider } from 'react-native';
import { FontAwesome } from '@expo/vector-icons';
import { getStatusBarHeight, getBottomSpace } from '../helper';
import { LatLng } from '../Api/interfaces';
type Props = {
goToMe: (e: GestureResponderEvent) => void;
refresh: (e: GestureResponderEvent) => void;
onOpenPortal: (guid: string, coords: LatLng) => void;
loading: Number;
selectedPortal: any;
}
export default (props: Props) => (
<>
<View style={styles.overlayLeft}>
{props.selectedPortal ? (
<>
<View style={styles.buttonWrapper}>
<FontAwesome.Button
style={styles.button}
name={'info'}
onPress={() => {
props.onOpenPortal(props.selectedPortal.guid, props.selectedPortal.coords)
}}
iconStyle={styles.icon}
color={"#000"}
size={25}
backgroundColor={"#e3e3e3"}
/>
</View>
{/* <View style={styles.buttonWrapper}>
<FontAwesome.Button
style={styles.button}
name={'location-arrow'}
onPress={() => Linking.openURL(`geo:${props.selectedPortal.coords.latitude},${props.selectedPortal.coords.longitude}`)}
iconStyle={styles.icon}
color={"#000"}
size={25}
backgroundColor={"#e3e3e3"}
/>
</View> */}
</>
) : null}
{props.loading > 0 ? (
<View style={styles.loader}>
<ActivityIndicator color={"#000"} />
</View>
) : null}
</View>
<View style={styles.overlayRight}>
<View style={styles.buttonWrapper}>
<FontAwesome.Button
style={styles.button}
name={'crosshairs'}
onPress={props.goToMe}
iconStyle={styles.icon}
color={"#000"}
size={25}
backgroundColor={"#e3e3e3"}
/>
</View>
<View style={styles.buttonWrapper}>
<FontAwesome.Button
style={styles.button}
name={'refresh'}
onPress={props.refresh}
iconStyle={styles.icon}
color={"#000"}
size={25}
backgroundColor={"#e3e3e3"}
/>
</View>
</View>
{props.selectedPortal ? (
<View style={styles.panel}>
<Text>{JSON.stringify(props.selectedPortal)}</Text>
</View>
) : null}
</>
);
const styles = StyleSheet.create({
overlayLeft: {
position: 'absolute',
top: getStatusBarHeight() + 20,
left: 8,
},
overlayRight: {
position: 'absolute',
top: getStatusBarHeight() + 20,
right: 8,
},
button: {
justifyContent: 'center',
alignItems: 'center',
height: 48,
width: 48,
},
buttonWrapper: {
margin: 8,
//ios
shadowOpacity: 0.3,
shadowRadius: 3,
shadowOffset: {
height: 0,
width: 0
},
//android
elevation: 1
},
panel: {
position: 'absolute',
bottom: getBottomSpace(),
left: 8,
right: 8,
borderRadius: 8,
padding: 8,
backgroundColor: '#fff',
//ios
shadowOpacity: 0.3,
shadowRadius: 3,
shadowOffset: {
height: 0,
width: 0
},
//android
elevation: 1
},
icon: {
marginRight: 0,
},
loader: {
margin: 8,
paddingHorizontal: 8,
}
});
|