-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathO2Screen.js
More file actions
258 lines (246 loc) · 6.59 KB
/
Copy pathO2Screen.js
File metadata and controls
258 lines (246 loc) · 6.59 KB
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
import { StyleSheet, Text, View, TouchableOpacity } from "react-native";
import { Button } from "react-native-elements";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { SafeAreaView } from "react-native-safe-area-context";
import { Dimensions } from "react-native";
import { Link } from "@react-navigation/native";
import { scale, verticalScale, moderateScale } from "react-native-size-matters";
import HomeIconSvg from "./assets/home_icon.svg";
import PersonIcon from "./assets/personicon.svg";
import { NavigationContainer, useNavigation } from "@react-navigation/native";
import TelephoneIcon from "./assets/telephoneIcon.svg";
import AsyncStorage from "@react-native-async-storage/async-storage";
const heightD = Dimensions.get("window").height;
const widthD = Dimensions.get("window").width;
import { Linking } from "react-native";
import { Alert } from "react-native";
import { ScrollView } from "react-native-virtualized-view";
import { PixelRatio } from "react-native";
const screenWidth = Dimensions.get("window").width;
const fontScale = PixelRatio.getFontScale();
const getFontSize = size => size / fontScale;
function ratioedSize(size1, size2) {
if (screenWidth > 400) {
return size1;
}
else {
return size2;
}
}
const createContactOption = () =>
Alert.alert("Open With ", "Choose an Option", [
{
text: "cancel",
status: "cancel",
},
{
text: "WhatsApp",
onPress: () => Linking.openURL(`https://wa.me/+918871306576`),
},
{ text: "Phone Call", onPress: () => Linking.openURL(`tel:$8871306576`) },
]);
export function O2Screen() {
const Tab = createBottomTabNavigator();
const Navigation = useNavigation();
return (
<SafeAreaView style={styles.container}>
<View
style={[
styles.servicesContainer,
{
marginTop: heightD * 0.1,
},
]}
>
<TouchableOpacity
onPress={() => {
const paymentObject = [{'id': 1, 'name': "O2 CYLINDER BOOKING", 'price' : 10000}];
try {
AsyncStorage.setItem("current_service", JSON.stringify(paymentObject))
.then(() => {
console.log("Data saved");
})
const f = AsyncStorage.getItem("current_service");
console.log(paymentObject);
Navigation.navigate("PaymentScreenHomeCare");
} catch(error) {
console.log(error);
}
}}
style={[styles.services_box1, styles.shadow]}>
<Text
style={[
styles.servicesText,
{
marginTop: scale(10),
},
]}
>
{" "}
Cylinder Price:
</Text>
<Text style={styles.servicesText}> Rs.500/day</Text>
</TouchableOpacity>
<View
style={{
marginTop: heightD * 0.01,
}}
></View>
<TouchableOpacity
style={[styles.services_box1, styles.shadow]}
onPress={() => {
createContactOption();
}}
>
<TelephoneIcon
height={scale(50)}
width={scale(25)}
style={{
color: "white",
marginLeft: scale(10),
marginTop: scale(8),
}}
/>
<Text
style={[
styles.servicesText,
{
marginTop: scale(-42),
textAlign: "left",
},
]}
>
{"\t "}Contact Us:{" "}
</Text>
<Text style={styles.servicesText}> +91-8871306576</Text>
</TouchableOpacity>
<View
style={{
marginTop: heightD * 0.01,
}}
></View>
</View>
<View
style={{
width: "80%",
marginTop: scale(100),
borderWidth: scale(1.5),
borderRadius: scale(11),
}}
>
<Text
style={{
paddingTop: scale(10),
paddingLeft: scale(10),
paddingRight: scale(10),
fontSize: getFontSize(22),
fontWeight: "bold",
width: "70%",
}}
>
**NOTE**
</Text>
<Text
style={{
fontSize: getFontSize(18),
//textAlign: "center",
paddingBottom: scale(10),
paddingLeft: scale(10),
paddingRight: scale(10),
width: "95%",
fontWeight:"600",
}}
>
{
"Rs.𝟭𝟬,𝟬𝟬𝟬 /- needs to be deposited, the rest will be refunded based on number of days rented"
}
</Text>
</View>
<View
style={[
styles.downNavigator,
styles.shadows,
{
marginTop: scale(100),
},
]}
>
<HomeIconSvg
style={{
marginLeft: "17.5%",
marginTop: scale(13),
}}
onPress={() => {
Navigation.navigate("HomeScreen");
}}
/>
<View
style={{
justifyContent: "center",
paddingVertical: scale(10),
}}
>
<PersonIcon
width={scale(30)}
style={{
marginLeft: "72.5%",
marginTop: scale(-75),
}}
onPress={() => {
Navigation.navigate("Settings");
}}
/>
</View>
</View>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
backgroundColor: "#fff",
},
servicesContainer: {
alignItems: "center",
justifyContent: "center",
},
services_box1: {
width: widthD * 0.8,
height: 100,
backgroundColor: "#2AA8A0",
borderRadius: 18,
marginBottom: 30,
},
servicesText: {
//textAlign: "center",
//marginTop: 40,
fontSize: getFontSize(26),
fontWeight: "bold",
color: "#FFFFFF",
},
shadow: {
shadowOffset: { width: 4, height: 4 },
shadowColor: "#2AA8AC",
shadowOpacity: 50,
shadowRadius: 2,
elevation: 11,
},
downNavigator: {
position: "relative",
marginTop: scale(100),
width: scale(295),
height: verticalScale(45),
alignSelf: "center",
backgroundColor: "#FFFFFF",
borderRadius: moderateScale(30),
},
shadows: {
shadowOffset: { width: scale(4), height: verticalScale(4) },
shadowColor: "#2AA8AC",
shadowOpacity: 50,
shadowRadius: scale(2),
elevation: scale(11),
},
});