-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelpScreen.js
143 lines (136 loc) · 3.81 KB
/
HelpScreen.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
import React, { useEffect, useState } from 'react';
import { SectionList, SafeAreaView, Linking, StyleSheet, Text, View, Modal, Pressable, Alert } from 'react-native';
import * as Analytics from './Analytics';
import { Ionicons } from '@expo/vector-icons';
const appleId = 1585748773;
export default function HelpScreen() {
const [modalOpen, setModalOpen] = useState(false);
useEffect(() => {
async function logEvent() {
await Analytics.logEvent('HelpScreen');
}
logEvent().then(_ => _);
}, []);
const DATA = [
{
title: "Info",
data: [
{
title: 'About',
action: () => setModalOpen(!modalOpen),
},
],
},
{
title: "Support",
data: [
{
title: 'Rate us',
action: () => Linking.openURL(
`https://apps.apple.com/us/app/save-geolocation-app/id${appleId}?action=write-review`
),
},
{
title: 'Send us an email',
action: () => Linking.openURL('mailto:limanoit@gmail.com'),
},
{
title: 'Version',
action: () => Alert.alert('Version 1.0.3'),
}
]
},
]
const Item = ({ title, action }) => (
<Pressable
style={({ pressed }) => [{ backgroundColor: pressed ? '#e3e3e3' : 'white' }, styles.item]}
onPress={action}
>
<Text style={styles.title}>{title}</Text>
<Ionicons name="chevron-forward" size={18} color="gray" />
</Pressable>
);
return (
<SafeAreaView style={styles.container}>
<SectionList
sections={DATA}
keyExtractor={(item, index) => item + index}
renderItem={({ item }) => <Item title={item.title} action={item.action} />}
renderSectionHeader={({ section: { title } }) => (
<Text style={styles.header}>{title}</Text>
)}
stickySectionHeadersEnabled={false}
/>
<Modal
animationType="slide"
visible={modalOpen}
presentationStyle="formSheet"
>
<View style={styles.modal}>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center'
}}
>
<Text style={{ fontSize: 32, fontWeight: 'bold' }}>About</Text>
<Pressable
style={{
backgroundColor: 'black',
borderRadius: 50,
width: 32, height: 32,
justifyContent: 'center',
alignItems: 'center'
}}
onPress={() => setModalOpen(!modalOpen)}
>
<Ionicons name="close-outline" size={24} color="white" style={{ marginLeft: 1, marginTop: 1 }} />
</Pressable>
</View>
<Text
style={{
marginTop: 24,
fontSize: 24,
lineHeight: 32,
fontWeight: '300'
}}
>
Thank you for your interest in the Save Geolocation App! We are a small group of developers that love to create simple and easy-to-use applications.
{"\n"}{"\n"}
Please rate and leave a review to support us! We welcome any constructive feedback to make this app better for everyone.
</Text>
</View>
</Modal>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 16,
backgroundColor: '#f6f6f6'
},
item: {
padding: 16,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
borderBottomWidth: 1,
borderBottomColor: "#e3e3e3"
},
header: {
fontSize: 14,
textTransform: 'uppercase',
marginLeft: 16,
marginTop: 24,
marginBottom: 12,
color: 'gray',
},
title: {
fontSize: 18
},
modal: {
padding: 24,
}
});