@hoddy-ui/core 1.0.100 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +773 -190
- package/next/components/AdaptiveStatusBarNext.tsx +12 -18
- package/next/dist/index.d.mts +90 -8
- package/next/dist/index.d.ts +90 -8
- package/next/dist/index.js +347 -316
- package/next/dist/index.js.map +1 -1
- package/next/dist/index.mjs +366 -337
- package/next/dist/index.mjs.map +1 -1
- package/next/index.ts +1 -0
- package/next/package.json +1 -1
- package/package.json +1 -1
- package/src/Components/AdaptiveStatusBar.tsx +13 -19
- package/src/Components/Locator.tsx +50 -22
- package/src/Components/Popup.tsx +16 -13
- package/src/Components/TextField.tsx +230 -220
- package/src/Components/Typography.tsx +1 -3
- package/src/config/KeyManager.ts +2 -0
- package/src/config/index.ts +2 -0
- package/src/theme/index.tsx +3 -1
- package/src/types.ts +2 -1
package/next/dist/index.mjs
CHANGED
|
@@ -4,61 +4,65 @@ var setExtraColors = (c) => extraColors = c;
|
|
|
4
4
|
function colors(theme) {
|
|
5
5
|
const lightColors = {
|
|
6
6
|
white: {
|
|
7
|
-
1: "#
|
|
7
|
+
1: "#ffffff",
|
|
8
8
|
2: "#f7f7f7",
|
|
9
|
-
3: "#
|
|
10
|
-
4: "#
|
|
11
|
-
5: "#
|
|
9
|
+
3: "#eeeeee",
|
|
10
|
+
4: "#dddddd",
|
|
11
|
+
5: "#bbbbbb",
|
|
12
|
+
...extraColors?.light?.white
|
|
12
13
|
},
|
|
13
14
|
black: {
|
|
14
|
-
1: "#
|
|
15
|
-
2: "#
|
|
16
|
-
3: "#
|
|
17
|
-
4: "#
|
|
18
|
-
5: "#
|
|
15
|
+
1: "#888888",
|
|
16
|
+
2: "#777777",
|
|
17
|
+
3: "#555555",
|
|
18
|
+
4: "#333333",
|
|
19
|
+
5: "#000000",
|
|
20
|
+
...extraColors?.light?.black
|
|
19
21
|
}
|
|
20
22
|
};
|
|
21
23
|
const darkColors = {
|
|
22
24
|
black: {
|
|
23
|
-
1: "#
|
|
25
|
+
1: "#ffffff",
|
|
24
26
|
2: "#f7f7f7",
|
|
25
|
-
3: "#
|
|
26
|
-
4: "#
|
|
27
|
-
5: "#
|
|
27
|
+
3: "#eeeeee",
|
|
28
|
+
4: "#dddddd",
|
|
29
|
+
5: "#aaaaaa",
|
|
30
|
+
...extraColors?.dark?.black
|
|
28
31
|
},
|
|
29
32
|
white: {
|
|
30
|
-
1: "#
|
|
31
|
-
2: "#
|
|
32
|
-
3: "#
|
|
33
|
-
4: "#
|
|
34
|
-
5: "#
|
|
33
|
+
1: "#060606",
|
|
34
|
+
2: "#222222",
|
|
35
|
+
3: "#333333",
|
|
36
|
+
4: "#444444",
|
|
37
|
+
5: "#555555",
|
|
38
|
+
...extraColors?.dark?.white
|
|
35
39
|
},
|
|
36
40
|
dark: {
|
|
37
41
|
main: "#f2f3f4",
|
|
38
|
-
light: "#
|
|
39
|
-
dark: "#
|
|
40
|
-
text: "#
|
|
42
|
+
light: "#ffffff",
|
|
43
|
+
dark: "#dddddd",
|
|
44
|
+
text: "#000000",
|
|
41
45
|
...extraColors?.dark?.dark
|
|
42
46
|
},
|
|
43
47
|
light: {
|
|
44
|
-
main: "#
|
|
45
|
-
light: "#
|
|
46
|
-
dark: "#
|
|
47
|
-
text: "#
|
|
48
|
+
main: "#111111",
|
|
49
|
+
light: "#555555",
|
|
50
|
+
dark: "#333333",
|
|
51
|
+
text: "#ffffff",
|
|
48
52
|
...extraColors?.dark?.light
|
|
49
53
|
},
|
|
50
54
|
textSecondary: {
|
|
51
|
-
main: "#
|
|
52
|
-
light: "#
|
|
53
|
-
dark: "#
|
|
54
|
-
text: "#
|
|
55
|
+
main: "#666666",
|
|
56
|
+
light: "#777777",
|
|
57
|
+
dark: "#444444",
|
|
58
|
+
text: "#ffffff",
|
|
55
59
|
...extraColors?.dark?.textSecondary
|
|
56
60
|
},
|
|
57
61
|
primary: {
|
|
58
|
-
main: "#
|
|
59
|
-
light: "#
|
|
60
|
-
dark: "#
|
|
61
|
-
text: "#
|
|
62
|
+
main: "#ff8800",
|
|
63
|
+
light: "#feffd3",
|
|
64
|
+
dark: "#ffaa00",
|
|
65
|
+
text: "#ffffff",
|
|
62
66
|
...extraColors?.light?.primary,
|
|
63
67
|
...extraColors?.dark?.primary
|
|
64
68
|
}
|
|
@@ -67,73 +71,73 @@ function colors(theme) {
|
|
|
67
71
|
return {
|
|
68
72
|
...extraColors[theme],
|
|
69
73
|
primary: {
|
|
70
|
-
main: "#
|
|
71
|
-
light: "#
|
|
72
|
-
dark: "#
|
|
73
|
-
text: "#
|
|
74
|
+
main: "#ff8800",
|
|
75
|
+
light: "#feffd3",
|
|
76
|
+
dark: "#ffaa00",
|
|
77
|
+
text: "#ffffff",
|
|
74
78
|
...extraColors?.light?.primary
|
|
75
79
|
},
|
|
76
80
|
secondary: {
|
|
77
|
-
main: "#
|
|
78
|
-
light: "#
|
|
79
|
-
dark: "#
|
|
80
|
-
text: "#
|
|
81
|
+
main: "#ff1111",
|
|
82
|
+
light: "#ff4433",
|
|
83
|
+
dark: "#dd0000",
|
|
84
|
+
text: "#ffffff",
|
|
81
85
|
...extraColors?.light?.secondary
|
|
82
86
|
},
|
|
83
87
|
light: {
|
|
84
|
-
main: "#
|
|
85
|
-
light: "#
|
|
86
|
-
dark: "#
|
|
87
|
-
text: "#
|
|
88
|
+
main: "#ffffff",
|
|
89
|
+
light: "#ffffff",
|
|
90
|
+
dark: "#dddddd",
|
|
91
|
+
text: "#000000",
|
|
88
92
|
...extraColors?.light?.light
|
|
89
93
|
},
|
|
90
94
|
dark: {
|
|
91
|
-
main: "#
|
|
92
|
-
light: "#
|
|
93
|
-
dark: "#
|
|
94
|
-
text: "#
|
|
95
|
+
main: "#000000",
|
|
96
|
+
light: "#777777",
|
|
97
|
+
dark: "#111111",
|
|
98
|
+
text: "#ffffff",
|
|
95
99
|
...extraColors?.light?.dark
|
|
96
100
|
},
|
|
97
101
|
textSecondary: {
|
|
98
|
-
main: "#
|
|
99
|
-
light: "#
|
|
100
|
-
dark: "#
|
|
101
|
-
text: "#
|
|
102
|
+
main: "#aaaaaa",
|
|
103
|
+
light: "#bbbbbb",
|
|
104
|
+
dark: "#777777",
|
|
105
|
+
text: "#112233",
|
|
102
106
|
...extraColors?.light?.textSecondary
|
|
103
107
|
},
|
|
104
108
|
blue: {
|
|
105
|
-
main: "#
|
|
106
|
-
light: "#
|
|
107
|
-
dark: "#
|
|
108
|
-
text: "#
|
|
109
|
+
main: "#0099ff",
|
|
110
|
+
light: "#3399ff",
|
|
111
|
+
dark: "#002288",
|
|
112
|
+
text: "#ffffff",
|
|
109
113
|
...extraColors?.light?.blue
|
|
110
114
|
},
|
|
111
115
|
info: {
|
|
112
|
-
main: "#
|
|
113
|
-
light: "#
|
|
114
|
-
dark: "#
|
|
115
|
-
text: "#
|
|
116
|
+
main: "#0099ff",
|
|
117
|
+
light: "#33aaff",
|
|
118
|
+
dark: "#0088aa",
|
|
119
|
+
text: "#ffffff",
|
|
116
120
|
...extraColors?.light?.info
|
|
117
121
|
},
|
|
118
122
|
success: {
|
|
119
|
-
main: "#
|
|
120
|
-
text: "#
|
|
121
|
-
light: "#
|
|
122
|
-
dark: "#
|
|
123
|
+
main: "#00aa44",
|
|
124
|
+
text: "#ffffff",
|
|
125
|
+
light: "#55cc33",
|
|
126
|
+
dark: "#006622",
|
|
123
127
|
...extraColors?.light?.success
|
|
124
128
|
},
|
|
125
129
|
warning: {
|
|
126
|
-
main: "#
|
|
127
|
-
light: "#
|
|
128
|
-
dark: "#
|
|
129
|
-
text: "#
|
|
130
|
+
main: "#ffaa22",
|
|
131
|
+
light: "#ffcc77",
|
|
132
|
+
dark: "#ff9900",
|
|
133
|
+
text: "#ffffff",
|
|
130
134
|
...extraColors?.light?.warning
|
|
131
135
|
},
|
|
132
136
|
error: {
|
|
133
|
-
main: "#
|
|
134
|
-
text: "#
|
|
135
|
-
light: "#
|
|
136
|
-
dark: "#
|
|
137
|
+
main: "#dd2222",
|
|
138
|
+
text: "#ffffff",
|
|
139
|
+
light: "#ff4433",
|
|
140
|
+
dark: "#aa2200",
|
|
137
141
|
...extraColors?.light?.error
|
|
138
142
|
},
|
|
139
143
|
...dynamicColors
|
|
@@ -142,7 +146,8 @@ function colors(theme) {
|
|
|
142
146
|
|
|
143
147
|
// ../src/config/KeyManager.ts
|
|
144
148
|
var config = {
|
|
145
|
-
GOOGLE_MAP_API_KEY: ""
|
|
149
|
+
GOOGLE_MAP_API_KEY: "",
|
|
150
|
+
EDGE_TO_EDGE: false
|
|
146
151
|
};
|
|
147
152
|
function setConfig(key) {
|
|
148
153
|
config = key;
|
|
@@ -156,7 +161,8 @@ function initialize(config2) {
|
|
|
156
161
|
try {
|
|
157
162
|
setConfig({
|
|
158
163
|
GOOGLE_MAP_API_KEY: config2.googleMapApiKey,
|
|
159
|
-
DEFAULT_FONT_FAMILY: config2.fontFamily
|
|
164
|
+
DEFAULT_FONT_FAMILY: config2.fontFamily,
|
|
165
|
+
EDGE_TO_EDGE: config2.edgeToEdge ?? false
|
|
160
166
|
});
|
|
161
167
|
if (config2.colors)
|
|
162
168
|
setExtraColors(config2.colors);
|
|
@@ -167,7 +173,7 @@ function initialize(config2) {
|
|
|
167
173
|
|
|
168
174
|
// components/AdaptiveStatusBarNext.tsx
|
|
169
175
|
import { useFocusEffect } from "expo-router";
|
|
170
|
-
import React5, { useState as
|
|
176
|
+
import React5, { useState as useState2 } from "react";
|
|
171
177
|
import { Platform as Platform3, StatusBar } from "react-native";
|
|
172
178
|
|
|
173
179
|
// ../src/hooks.ts
|
|
@@ -179,8 +185,9 @@ import { vs } from "react-native-size-matters";
|
|
|
179
185
|
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
180
186
|
import * as NavigationBar from "expo-navigation-bar";
|
|
181
187
|
import * as SystemUI from "expo-system-ui";
|
|
182
|
-
import React4, { createContext, useReducer } from "react";
|
|
188
|
+
import React4, { createContext, useEffect as useEffect2, useReducer } from "react";
|
|
183
189
|
import { Platform, useColorScheme } from "react-native";
|
|
190
|
+
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
184
191
|
|
|
185
192
|
// ../src/Components/FlashMessage.tsx
|
|
186
193
|
import React3, { useEffect, useState } from "react";
|
|
@@ -205,7 +212,6 @@ var Typography = forwardRef(
|
|
|
205
212
|
variant = "body1",
|
|
206
213
|
align = "left",
|
|
207
214
|
gutterBottom = 0,
|
|
208
|
-
numberOfLines,
|
|
209
215
|
adjustsFontSizeToFit,
|
|
210
216
|
fontWeight = 400,
|
|
211
217
|
fontFamily,
|
|
@@ -232,8 +238,8 @@ var Typography = forwardRef(
|
|
|
232
238
|
textTransform: textCase,
|
|
233
239
|
alignItems: "center",
|
|
234
240
|
textAlign: align,
|
|
235
|
-
fontWeight
|
|
236
|
-
fontFamily: fontFamily || getConfig().DEFAULT_FONT_FAMILY ||
|
|
241
|
+
fontWeight,
|
|
242
|
+
fontFamily: fontFamily || getConfig().DEFAULT_FONT_FAMILY || void 0
|
|
237
243
|
// Use custom font if provided, else default
|
|
238
244
|
}
|
|
239
245
|
});
|
|
@@ -241,7 +247,6 @@ var Typography = forwardRef(
|
|
|
241
247
|
Text,
|
|
242
248
|
{
|
|
243
249
|
ref,
|
|
244
|
-
numberOfLines,
|
|
245
250
|
adjustsFontSizeToFit,
|
|
246
251
|
style: [styles2.text, style],
|
|
247
252
|
...props
|
|
@@ -314,24 +319,10 @@ var FlashMessage = () => {
|
|
|
314
319
|
var FlashMessage_default = FlashMessage;
|
|
315
320
|
|
|
316
321
|
// ../src/theme/index.tsx
|
|
317
|
-
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
318
322
|
var UIThemeContext = createContext({
|
|
319
323
|
themeState: { mode: "default", value: "light" }
|
|
320
324
|
});
|
|
321
325
|
function themeReducer(state, { type, payload }) {
|
|
322
|
-
if (payload === "dark" || type === "dark") {
|
|
323
|
-
SystemUI.setBackgroundColorAsync("#000000");
|
|
324
|
-
if (Platform.OS === "android") {
|
|
325
|
-
NavigationBar.setButtonStyleAsync("light");
|
|
326
|
-
NavigationBar.setBackgroundColorAsync("#000000");
|
|
327
|
-
}
|
|
328
|
-
} else {
|
|
329
|
-
SystemUI.setBackgroundColorAsync("#ffffff");
|
|
330
|
-
if (Platform.OS === "android") {
|
|
331
|
-
NavigationBar.setButtonStyleAsync("dark");
|
|
332
|
-
NavigationBar.setBackgroundColorAsync("#fff");
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
326
|
switch (type) {
|
|
336
327
|
case "dark":
|
|
337
328
|
return { mode: "dark", value: "dark" };
|
|
@@ -343,6 +334,25 @@ function themeReducer(state, { type, payload }) {
|
|
|
343
334
|
return state;
|
|
344
335
|
}
|
|
345
336
|
}
|
|
337
|
+
var ConfigureSystemUI = () => {
|
|
338
|
+
const theme = useTheme();
|
|
339
|
+
const colors2 = useColors();
|
|
340
|
+
useEffect2(() => {
|
|
341
|
+
const config2 = getConfig();
|
|
342
|
+
if (colors2) {
|
|
343
|
+
SystemUI.setBackgroundColorAsync(colors2.white[1]);
|
|
344
|
+
if (Platform.OS === "android" && !config2.EDGE_TO_EDGE) {
|
|
345
|
+
NavigationBar.setBackgroundColorAsync(colors2.white[1]);
|
|
346
|
+
if (theme === "dark") {
|
|
347
|
+
NavigationBar.setButtonStyleAsync("light");
|
|
348
|
+
} else {
|
|
349
|
+
NavigationBar.setButtonStyleAsync("dark");
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}, [colors2, theme]);
|
|
354
|
+
return /* @__PURE__ */ React4.createElement(React4.Fragment, null);
|
|
355
|
+
};
|
|
346
356
|
var UIThemeProvider = ({ children }) => {
|
|
347
357
|
const [themeState, themeDispatch] = useReducer(themeReducer, {
|
|
348
358
|
mode: "default",
|
|
@@ -378,7 +388,8 @@ var UIThemeProvider = ({ children }) => {
|
|
|
378
388
|
}
|
|
379
389
|
},
|
|
380
390
|
children,
|
|
381
|
-
/* @__PURE__ */ React4.createElement(FlashMessage_default, null)
|
|
391
|
+
/* @__PURE__ */ React4.createElement(FlashMessage_default, null),
|
|
392
|
+
/* @__PURE__ */ React4.createElement(ConfigureSystemUI, null)
|
|
382
393
|
));
|
|
383
394
|
};
|
|
384
395
|
|
|
@@ -393,6 +404,7 @@ var useTheme = () => {
|
|
|
393
404
|
};
|
|
394
405
|
var useNavScreenOptions = (type) => {
|
|
395
406
|
const colors2 = useColors();
|
|
407
|
+
const theme = useTheme();
|
|
396
408
|
const options = {
|
|
397
409
|
stack: {
|
|
398
410
|
headerShown: false,
|
|
@@ -412,7 +424,7 @@ var useNavScreenOptions = (type) => {
|
|
|
412
424
|
headerShown: false,
|
|
413
425
|
headerTintColor: colors2.dark.main,
|
|
414
426
|
tabBarStyle: {
|
|
415
|
-
borderTopColor: colors2.white[
|
|
427
|
+
borderTopColor: theme === "dark" ? colors2.light.main : colors2.white[2],
|
|
416
428
|
borderTopWidth: 1,
|
|
417
429
|
// shadowColor: "#000",
|
|
418
430
|
// shadowOffset: { height: -3, width: 0 },
|
|
@@ -453,28 +465,25 @@ var useNavScreenOptions = (type) => {
|
|
|
453
465
|
|
|
454
466
|
// components/AdaptiveStatusBarNext.tsx
|
|
455
467
|
var AdaptiveStatusBar = ({ translucent = false }) => {
|
|
456
|
-
const [focused, setFocused] =
|
|
468
|
+
const [focused, setFocused] = useState2(false);
|
|
457
469
|
const colors2 = useColors();
|
|
458
470
|
const theme = useTheme();
|
|
471
|
+
const statusbarHandler = () => {
|
|
472
|
+
StatusBar.setBarStyle(theme === "dark" ? "light-content" : "dark-content");
|
|
473
|
+
if (Platform3.OS === "android") {
|
|
474
|
+
StatusBar.setBackgroundColor(
|
|
475
|
+
translucent ? "transparent" : colors2.white[1]
|
|
476
|
+
);
|
|
477
|
+
StatusBar.setTranslucent(true);
|
|
478
|
+
}
|
|
479
|
+
};
|
|
459
480
|
useFocusEffect(
|
|
460
481
|
React5.useCallback(() => {
|
|
461
|
-
|
|
462
|
-
theme === "dark" ? "light-content" : "dark-content"
|
|
463
|
-
);
|
|
464
|
-
if (Platform3.OS === "android") {
|
|
465
|
-
StatusBar.setBackgroundColor(
|
|
466
|
-
colors2.white[1] + (translucent ? "0" : "")
|
|
467
|
-
);
|
|
468
|
-
StatusBar.setTranslucent(true);
|
|
469
|
-
}
|
|
482
|
+
statusbarHandler();
|
|
470
483
|
}, [theme])
|
|
471
484
|
);
|
|
472
485
|
React5.useEffect(() => {
|
|
473
|
-
|
|
474
|
-
if (Platform3.OS === "android") {
|
|
475
|
-
StatusBar.setBackgroundColor(colors2.white[1] + (translucent ? "0" : ""));
|
|
476
|
-
StatusBar.setTranslucent(true);
|
|
477
|
-
}
|
|
486
|
+
statusbarHandler();
|
|
478
487
|
}, [theme]);
|
|
479
488
|
return /* @__PURE__ */ React5.createElement(React5.Fragment, null);
|
|
480
489
|
};
|
|
@@ -665,7 +674,7 @@ var Button = forwardRef2(
|
|
|
665
674
|
alignItems: "center",
|
|
666
675
|
alignSelf: "flex-start",
|
|
667
676
|
justifyContent: "center",
|
|
668
|
-
backgroundColor: variant === "text" || variant === "outlined" ? null : translucent ? translucent === "dark" ? colors2.white[3] + "
|
|
677
|
+
backgroundColor: variant === "text" || variant === "outlined" ? null : translucent ? translucent === "dark" ? colors2.white[3] + "22" : colors2.black[3] + "22" : loading ? colors2[color].light : disabled ? colors2.white[4] : colors2[color].main,
|
|
669
678
|
borderRadius: rounded ? 30 : 10,
|
|
670
679
|
elevation: variant === "text" ? 0 : elevation,
|
|
671
680
|
paddingVertical: size === "small" ? 8 : size === "large" ? "15@ms" : "13@ms",
|
|
@@ -806,7 +815,7 @@ var FormWrapper = ({
|
|
|
806
815
|
// ../src/Components/StarRating.tsx
|
|
807
816
|
import { Ionicons as Ionicons2 } from "@expo/vector-icons";
|
|
808
817
|
import * as Haptics from "expo-haptics";
|
|
809
|
-
import { useEffect as
|
|
818
|
+
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
810
819
|
import {
|
|
811
820
|
ActivityIndicator as ActivityIndicator2,
|
|
812
821
|
TextInput,
|
|
@@ -826,7 +835,7 @@ import {
|
|
|
826
835
|
TouchableWithoutFeedback as TouchableWithoutFeedback2,
|
|
827
836
|
View as View5
|
|
828
837
|
} from "react-native";
|
|
829
|
-
import React11, { useState as
|
|
838
|
+
import React11, { useState as useState3 } from "react";
|
|
830
839
|
import { ScaledSheet as ScaledSheet7 } from "react-native-size-matters";
|
|
831
840
|
var Popup = ({
|
|
832
841
|
title,
|
|
@@ -836,11 +845,13 @@ var Popup = ({
|
|
|
836
845
|
children,
|
|
837
846
|
open,
|
|
838
847
|
onClose = () => {
|
|
839
|
-
}
|
|
848
|
+
},
|
|
849
|
+
style
|
|
840
850
|
}) => {
|
|
851
|
+
const theme = useTheme();
|
|
841
852
|
const colors2 = useColors();
|
|
842
|
-
const [show, setShow] =
|
|
843
|
-
const [showSecondary, setShowSecondary] =
|
|
853
|
+
const [show, setShow] = useState3(open);
|
|
854
|
+
const [showSecondary, setShowSecondary] = useState3(false);
|
|
844
855
|
const styles2 = ScaledSheet7.create({
|
|
845
856
|
root: {
|
|
846
857
|
height: "100%",
|
|
@@ -857,23 +868,27 @@ var Popup = ({
|
|
|
857
868
|
},
|
|
858
869
|
container: {
|
|
859
870
|
paddingBottom: sheet ? "30@ms" : 0,
|
|
860
|
-
backgroundColor: colors2.white[2],
|
|
871
|
+
backgroundColor: theme === "dark" ? "#111" : colors2.white[2],
|
|
861
872
|
borderTopLeftRadius: 20,
|
|
862
873
|
borderTopRightRadius: 20,
|
|
863
874
|
borderBottomRightRadius: sheet ? 0 : 20,
|
|
864
875
|
borderBottomLeftRadius: sheet ? 0 : 20,
|
|
865
|
-
width: "100%"
|
|
876
|
+
width: "100%",
|
|
877
|
+
...style
|
|
866
878
|
},
|
|
867
879
|
content: {
|
|
868
|
-
paddingHorizontal: bare ? void 0 : "
|
|
880
|
+
paddingHorizontal: bare ? void 0 : "15@ms"
|
|
869
881
|
// flex: 1,
|
|
870
882
|
},
|
|
871
883
|
title: {
|
|
872
884
|
flexDirection: "row",
|
|
873
885
|
alignItems: "center",
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
886
|
+
justifyContent: "center",
|
|
887
|
+
height: "50@ms"
|
|
888
|
+
},
|
|
889
|
+
titleIcon: {
|
|
890
|
+
position: "absolute",
|
|
891
|
+
left: "15@ms"
|
|
877
892
|
},
|
|
878
893
|
backdrop: {
|
|
879
894
|
position: "absolute",
|
|
@@ -932,14 +947,14 @@ var Popup = ({
|
|
|
932
947
|
keyboardVerticalOffset,
|
|
933
948
|
behavior: Platform5.OS === "ios" ? "position" : "padding"
|
|
934
949
|
},
|
|
935
|
-
/* @__PURE__ */ React11.createElement(View5, { style: styles2.container }, !bare && /* @__PURE__ */ React11.createElement(View5, { style: styles2.title }, /* @__PURE__ */ React11.createElement(
|
|
950
|
+
/* @__PURE__ */ React11.createElement(View5, { style: styles2.container }, !bare && /* @__PURE__ */ React11.createElement(View5, { style: styles2.title }, /* @__PURE__ */ React11.createElement(View5, { style: styles2.titleIcon }, /* @__PURE__ */ React11.createElement(
|
|
936
951
|
IconButton,
|
|
937
952
|
{
|
|
938
953
|
size: 20,
|
|
939
954
|
icon: "close",
|
|
940
955
|
onPress: closeAction
|
|
941
956
|
}
|
|
942
|
-
), /* @__PURE__ */ React11.createElement(
|
|
957
|
+
)), /* @__PURE__ */ React11.createElement(Typography_default, { align: "center", fontWeight: 500 }, title)), /* @__PURE__ */ React11.createElement(View5, { style: styles2.content }, children))
|
|
943
958
|
)))
|
|
944
959
|
))
|
|
945
960
|
));
|
|
@@ -972,11 +987,11 @@ var RatingInput = ({
|
|
|
972
987
|
rating = 0,
|
|
973
988
|
size = 16
|
|
974
989
|
}) => {
|
|
975
|
-
const [showReviewsModal, setShowReviewsModal] =
|
|
976
|
-
const [rate, setRate] =
|
|
990
|
+
const [showReviewsModal, setShowReviewsModal] = useState4(false);
|
|
991
|
+
const [rate, setRate] = useState4(0);
|
|
977
992
|
const colors2 = useColors();
|
|
978
|
-
const [loading, setLoading] =
|
|
979
|
-
const [review, setReview] =
|
|
993
|
+
const [loading, setLoading] = useState4(false);
|
|
994
|
+
const [review, setReview] = useState4("");
|
|
980
995
|
const styles2 = ScaledSheet8.create({
|
|
981
996
|
root: {
|
|
982
997
|
flexDirection: "row",
|
|
@@ -994,7 +1009,7 @@ var RatingInput = ({
|
|
|
994
1009
|
height: "100@vs"
|
|
995
1010
|
}
|
|
996
1011
|
});
|
|
997
|
-
|
|
1012
|
+
useEffect3(() => {
|
|
998
1013
|
setRate(rating);
|
|
999
1014
|
}, [rating]);
|
|
1000
1015
|
const onRate = (index) => {
|
|
@@ -1119,7 +1134,7 @@ var Grid = ({
|
|
|
1119
1134
|
|
|
1120
1135
|
// ../src/Components/Locator.tsx
|
|
1121
1136
|
import { Ionicons as Ionicons4 } from "@expo/vector-icons";
|
|
1122
|
-
import React16, { useEffect as
|
|
1137
|
+
import React16, { useEffect as useEffect4, useState as useState7 } from "react";
|
|
1123
1138
|
import { Alert, TouchableOpacity as TouchableOpacity8, View as View11 } from "react-native";
|
|
1124
1139
|
|
|
1125
1140
|
// ../src/Components/List.tsx
|
|
@@ -1141,7 +1156,7 @@ var ListItem = ({
|
|
|
1141
1156
|
flexDirection: "row",
|
|
1142
1157
|
alignItems: "center",
|
|
1143
1158
|
paddingHorizontal: "10@s",
|
|
1144
|
-
borderBottomColor: colors2.white[
|
|
1159
|
+
borderBottomColor: colors2.white[2],
|
|
1145
1160
|
borderBottomWidth: divider ? 1 : 0,
|
|
1146
1161
|
paddingVertical: "10@vs"
|
|
1147
1162
|
}
|
|
@@ -1163,7 +1178,7 @@ var ListItem = ({
|
|
|
1163
1178
|
|
|
1164
1179
|
// ../src/Components/TextField.tsx
|
|
1165
1180
|
import { Ionicons as Ionicons3, MaterialIcons as MaterialIcons5 } from "@expo/vector-icons";
|
|
1166
|
-
import React15, { useRef, useState as
|
|
1181
|
+
import React15, { useRef, useState as useState6 } from "react";
|
|
1167
1182
|
import { Animated, TextInput as TextInput2, TouchableOpacity as TouchableOpacity7, View as View10 } from "react-native";
|
|
1168
1183
|
import {
|
|
1169
1184
|
ScaledSheet as ScaledSheet12,
|
|
@@ -1174,7 +1189,7 @@ import {
|
|
|
1174
1189
|
|
|
1175
1190
|
// ../src/Components/SelectMenu.tsx
|
|
1176
1191
|
import { MaterialIcons as MaterialIcons4 } from "@expo/vector-icons";
|
|
1177
|
-
import React14, { useCallback, useState as
|
|
1192
|
+
import React14, { useCallback, useState as useState5 } from "react";
|
|
1178
1193
|
import { FlatList, Modal as Modal2, TouchableOpacity as TouchableOpacity6, View as View9 } from "react-native";
|
|
1179
1194
|
import { useSafeAreaInsets as useSafeAreaInsets2 } from "react-native-safe-area-context";
|
|
1180
1195
|
import { ScaledSheet as ScaledSheet11 } from "react-native-size-matters";
|
|
@@ -1191,7 +1206,7 @@ var SelectMenu = ({
|
|
|
1191
1206
|
}) => {
|
|
1192
1207
|
const colors2 = useColors();
|
|
1193
1208
|
const { bottom } = useSafeAreaInsets2();
|
|
1194
|
-
const [search, setSearch] =
|
|
1209
|
+
const [search, setSearch] = useState5("");
|
|
1195
1210
|
const styles2 = ScaledSheet11.create({
|
|
1196
1211
|
root: {
|
|
1197
1212
|
backgroundColor: colors2.white[1],
|
|
@@ -1225,7 +1240,7 @@ var SelectMenu = ({
|
|
|
1225
1240
|
{
|
|
1226
1241
|
style: {
|
|
1227
1242
|
...styles2.option,
|
|
1228
|
-
backgroundColor: item.value === value ? colors2.blue.light + "
|
|
1243
|
+
backgroundColor: item.value === value ? colors2.blue.light + "22" : colors2.white[2]
|
|
1229
1244
|
},
|
|
1230
1245
|
onPress: () => {
|
|
1231
1246
|
onChange(item.value);
|
|
@@ -1327,7 +1342,7 @@ var TextField = ({
|
|
|
1327
1342
|
...props
|
|
1328
1343
|
}) => {
|
|
1329
1344
|
const colors2 = useColors();
|
|
1330
|
-
const [focused, setFocused] =
|
|
1345
|
+
const [focused, setFocused] = useState6(false);
|
|
1331
1346
|
const height = moderateScale3(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1);
|
|
1332
1347
|
const labelAnim = useRef(
|
|
1333
1348
|
new Animated.Value(height / moderateScale3(variant === "text" ? 2.5 : 3.2))
|
|
@@ -1524,201 +1539,203 @@ var TextField = ({
|
|
|
1524
1539
|
}
|
|
1525
1540
|
));
|
|
1526
1541
|
};
|
|
1527
|
-
var TextField2 = (
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
onFocus = () => {
|
|
1538
|
-
},
|
|
1539
|
-
onBlur = () => {
|
|
1540
|
-
},
|
|
1541
|
-
error,
|
|
1542
|
-
start,
|
|
1543
|
-
rounded,
|
|
1544
|
-
disabled = false,
|
|
1545
|
-
style = {},
|
|
1546
|
-
inputStyles = {},
|
|
1547
|
-
gutterBottom = 8,
|
|
1548
|
-
placeholder,
|
|
1549
|
-
end,
|
|
1550
|
-
options,
|
|
1551
|
-
...props
|
|
1552
|
-
}) => {
|
|
1553
|
-
const colors2 = useColors();
|
|
1554
|
-
const [focused, _setFocused] = useState7(false);
|
|
1555
|
-
const [showPassword, setShowPassword] = useState7(false);
|
|
1556
|
-
const height = moderateScale3(
|
|
1557
|
-
props.multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1558
|
-
);
|
|
1559
|
-
const setFocused = (value2) => {
|
|
1560
|
-
_setFocused(value2);
|
|
1561
|
-
};
|
|
1562
|
-
const styles2 = ScaledSheet12.create({
|
|
1563
|
-
root: {
|
|
1564
|
-
marginBottom: gutterBottom + "@vs",
|
|
1565
|
-
...style
|
|
1566
|
-
},
|
|
1567
|
-
container: {
|
|
1568
|
-
height,
|
|
1569
|
-
overflow: "hidden",
|
|
1570
|
-
flexDirection: "row",
|
|
1571
|
-
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[5],
|
|
1572
|
-
borderWidth: error ? 1 : focused ? 2 : 1,
|
|
1573
|
-
width: "100%",
|
|
1574
|
-
borderRadius: rounded ? 30 : 10,
|
|
1575
|
-
alignItems: "center",
|
|
1576
|
-
...inputStyles
|
|
1577
|
-
},
|
|
1578
|
-
input: {
|
|
1579
|
-
fontSize: "14@s",
|
|
1580
|
-
flex: 1,
|
|
1581
|
-
alignSelf: "stretch",
|
|
1582
|
-
paddingLeft: moderateScale3(10),
|
|
1583
|
-
paddingRight: moderateScale3(10),
|
|
1584
|
-
color: colors2.dark.main,
|
|
1585
|
-
zIndex: 10
|
|
1586
|
-
// backgroundColor: "#284",
|
|
1587
|
-
},
|
|
1588
|
-
inputText: {
|
|
1589
|
-
fontSize: "14@ms",
|
|
1590
|
-
color: colors2.dark.main,
|
|
1591
|
-
paddingLeft: moderateScale3(10)
|
|
1592
|
-
},
|
|
1593
|
-
placeholder: {
|
|
1594
|
-
fontSize: "14@ms",
|
|
1595
|
-
color: colors2.textSecondary.main,
|
|
1596
|
-
paddingLeft: moderateScale3(10)
|
|
1597
|
-
},
|
|
1598
|
-
label: {},
|
|
1599
|
-
helperText: {
|
|
1600
|
-
paddingHorizontal: "15@s",
|
|
1601
|
-
color: focused ? colors2[color].dark : "#fffa",
|
|
1602
|
-
paddingTop: "4@ms"
|
|
1542
|
+
var TextField2 = React15.forwardRef(
|
|
1543
|
+
({
|
|
1544
|
+
label,
|
|
1545
|
+
keyboardType,
|
|
1546
|
+
color = "primary",
|
|
1547
|
+
value,
|
|
1548
|
+
type,
|
|
1549
|
+
helperText,
|
|
1550
|
+
onChangeText,
|
|
1551
|
+
onSubmitEditing = () => {
|
|
1603
1552
|
},
|
|
1604
|
-
|
|
1605
|
-
paddingLeft: 10,
|
|
1606
|
-
paddingRight: 10,
|
|
1607
|
-
paddingTop: 5,
|
|
1608
|
-
flexDirection: "row",
|
|
1609
|
-
alignItems: "center"
|
|
1553
|
+
onFocus = () => {
|
|
1610
1554
|
},
|
|
1611
|
-
|
|
1612
|
-
fontSize: 12,
|
|
1613
|
-
marginLeft: 10
|
|
1614
|
-
}
|
|
1615
|
-
});
|
|
1616
|
-
const formProps = type === "email" ? {
|
|
1617
|
-
textContentType: "emailAddress",
|
|
1618
|
-
keyboardType: "email-address",
|
|
1619
|
-
autoCapitalize: "none",
|
|
1620
|
-
autoCompleteType: "email"
|
|
1621
|
-
} : type === "number" ? {
|
|
1622
|
-
keyboardType: "numeric"
|
|
1623
|
-
} : type === "tel" ? {
|
|
1624
|
-
textContentType: "telephoneNumber",
|
|
1625
|
-
keyboardType: "phone-pad"
|
|
1626
|
-
} : type === "search" ? {
|
|
1627
|
-
keyboardType: "web-search",
|
|
1628
|
-
returnKeyType: "search",
|
|
1629
|
-
autoCapitalize: "none"
|
|
1630
|
-
} : type === "password" ? {
|
|
1631
|
-
secureTextEntry: !showPassword,
|
|
1632
|
-
autoCompleteType: "password",
|
|
1633
|
-
autoCapitalize: "none",
|
|
1634
|
-
textContentType: "password"
|
|
1635
|
-
} : {};
|
|
1636
|
-
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style: styles2.root }, label && /* @__PURE__ */ React15.createElement(Typography_default, { variant: "body1", color: "textSecondary", gutterBottom: 7 }, label), /* @__PURE__ */ React15.createElement(
|
|
1637
|
-
TouchableOpacity7,
|
|
1638
|
-
{
|
|
1639
|
-
onPress: () => setFocused(true),
|
|
1640
|
-
style: styles2.container
|
|
1555
|
+
onBlur = () => {
|
|
1641
1556
|
},
|
|
1557
|
+
error,
|
|
1642
1558
|
start,
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1559
|
+
rounded,
|
|
1560
|
+
disabled = false,
|
|
1561
|
+
style = {},
|
|
1562
|
+
inputStyles = {},
|
|
1563
|
+
gutterBottom = 8,
|
|
1564
|
+
placeholder,
|
|
1565
|
+
end,
|
|
1566
|
+
options,
|
|
1567
|
+
multiline,
|
|
1568
|
+
...props
|
|
1569
|
+
}, ref) => {
|
|
1570
|
+
const colors2 = useColors();
|
|
1571
|
+
const [focused, _setFocused] = useState6(false);
|
|
1572
|
+
const [showPassword, setShowPassword] = useState6(false);
|
|
1573
|
+
const height = moderateScale3(
|
|
1574
|
+
multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1575
|
+
);
|
|
1576
|
+
const setFocused = (value2) => {
|
|
1577
|
+
_setFocused(value2);
|
|
1578
|
+
};
|
|
1579
|
+
const styles2 = ScaledSheet12.create({
|
|
1580
|
+
root: {
|
|
1581
|
+
marginBottom: gutterBottom + "@vs",
|
|
1582
|
+
...style
|
|
1583
|
+
},
|
|
1584
|
+
container: {
|
|
1585
|
+
height,
|
|
1586
|
+
overflow: "hidden",
|
|
1587
|
+
flexDirection: "row",
|
|
1588
|
+
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[4],
|
|
1589
|
+
borderWidth: error ? 1 : focused ? 2 : 1,
|
|
1590
|
+
width: "100%",
|
|
1591
|
+
borderRadius: rounded ? 30 : 10,
|
|
1592
|
+
alignItems: multiline ? "flex-start" : "center",
|
|
1593
|
+
paddingVertical: multiline ? 10 : 0,
|
|
1594
|
+
...inputStyles
|
|
1595
|
+
},
|
|
1596
|
+
input: {
|
|
1597
|
+
fontSize: "14@s",
|
|
1598
|
+
flex: 1,
|
|
1599
|
+
alignSelf: "stretch",
|
|
1600
|
+
paddingLeft: moderateScale3(10),
|
|
1601
|
+
paddingRight: moderateScale3(10),
|
|
1602
|
+
color: colors2.dark.main,
|
|
1603
|
+
zIndex: 10
|
|
1604
|
+
// backgroundColor: "#284",
|
|
1605
|
+
},
|
|
1606
|
+
inputText: {
|
|
1607
|
+
fontSize: "14@ms",
|
|
1608
|
+
color: colors2.dark.main,
|
|
1609
|
+
paddingLeft: moderateScale3(10)
|
|
1610
|
+
},
|
|
1611
|
+
placeholder: {
|
|
1612
|
+
fontSize: "14@ms",
|
|
1613
|
+
color: colors2.textSecondary.light,
|
|
1614
|
+
paddingLeft: moderateScale3(10)
|
|
1615
|
+
},
|
|
1616
|
+
label: {},
|
|
1617
|
+
helperText: {
|
|
1618
|
+
paddingHorizontal: "15@s",
|
|
1619
|
+
color: focused ? colors2[color].dark : "#fffa",
|
|
1620
|
+
paddingTop: "4@ms"
|
|
1621
|
+
},
|
|
1622
|
+
error: {
|
|
1623
|
+
paddingLeft: 10,
|
|
1624
|
+
paddingRight: 10,
|
|
1625
|
+
paddingTop: 5,
|
|
1626
|
+
flexDirection: "row",
|
|
1627
|
+
alignItems: "center"
|
|
1628
|
+
},
|
|
1629
|
+
errorText: {
|
|
1630
|
+
fontSize: 12,
|
|
1631
|
+
marginLeft: 10
|
|
1674
1632
|
}
|
|
1675
|
-
)
|
|
1676
|
-
|
|
1633
|
+
});
|
|
1634
|
+
const formProps = type === "email" ? {
|
|
1635
|
+
textContentType: "emailAddress",
|
|
1636
|
+
keyboardType: "email-address",
|
|
1637
|
+
autoCapitalize: "none",
|
|
1638
|
+
autoCompleteType: "email"
|
|
1639
|
+
} : type === "number" ? {
|
|
1640
|
+
keyboardType: "numeric"
|
|
1641
|
+
} : type === "tel" ? {
|
|
1642
|
+
textContentType: "telephoneNumber",
|
|
1643
|
+
keyboardType: "phone-pad"
|
|
1644
|
+
} : type === "search" ? {
|
|
1645
|
+
keyboardType: "web-search",
|
|
1646
|
+
returnKeyType: "search",
|
|
1647
|
+
autoCapitalize: "none"
|
|
1648
|
+
} : type === "password" ? {
|
|
1649
|
+
secureTextEntry: !showPassword,
|
|
1650
|
+
autoCompleteType: "password",
|
|
1651
|
+
autoCapitalize: "none",
|
|
1652
|
+
textContentType: "password"
|
|
1653
|
+
} : {};
|
|
1654
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style: styles2.root }, label && /* @__PURE__ */ React15.createElement(Typography_default, { variant: "body1", color: "textSecondary", gutterBottom: 7 }, label), /* @__PURE__ */ React15.createElement(
|
|
1677
1655
|
TouchableOpacity7,
|
|
1678
1656
|
{
|
|
1679
|
-
|
|
1680
|
-
|
|
1657
|
+
onPress: () => setFocused(true),
|
|
1658
|
+
style: styles2.container
|
|
1681
1659
|
},
|
|
1682
|
-
/* @__PURE__ */ React15.createElement(
|
|
1660
|
+
/* @__PURE__ */ React15.createElement(View10, { style: { marginTop: multiline ? 5 : 0 } }, start),
|
|
1661
|
+
options ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, value ? /* @__PURE__ */ React15.createElement(Typography_default, { style: styles2.inputText }, options.find((cur) => cur.value === value)?.label) : /* @__PURE__ */ React15.createElement(Typography_default, { style: styles2.placeholder }, placeholder), /* @__PURE__ */ React15.createElement(
|
|
1683
1662
|
Ionicons3,
|
|
1684
1663
|
{
|
|
1685
|
-
name:
|
|
1664
|
+
name: "chevron-down",
|
|
1686
1665
|
size: 24,
|
|
1687
|
-
|
|
1666
|
+
style: { marginLeft: "auto", marginRight: 15 },
|
|
1667
|
+
color: colors2.dark.light
|
|
1668
|
+
}
|
|
1669
|
+
)) : /* @__PURE__ */ React15.createElement(
|
|
1670
|
+
TextInput2,
|
|
1671
|
+
{
|
|
1672
|
+
ref,
|
|
1673
|
+
onFocus: () => {
|
|
1674
|
+
onFocus();
|
|
1675
|
+
setFocused(true);
|
|
1676
|
+
},
|
|
1677
|
+
onBlur: () => {
|
|
1678
|
+
onBlur();
|
|
1679
|
+
setFocused(false);
|
|
1680
|
+
},
|
|
1681
|
+
value,
|
|
1682
|
+
onChangeText,
|
|
1683
|
+
key: showPassword ? "show" : "hide",
|
|
1684
|
+
keyboardType,
|
|
1685
|
+
placeholderTextColor: colors2.textSecondary.light,
|
|
1686
|
+
editable: !disabled,
|
|
1687
|
+
placeholder,
|
|
1688
|
+
selectTextOnFocus: !disabled,
|
|
1689
|
+
onSubmitEditing,
|
|
1690
|
+
multiline,
|
|
1691
|
+
textAlignVertical: multiline ? "top" : "center",
|
|
1692
|
+
...formProps,
|
|
1693
|
+
...props,
|
|
1694
|
+
style: styles2.input
|
|
1688
1695
|
}
|
|
1696
|
+
),
|
|
1697
|
+
end ? /* @__PURE__ */ React15.createElement(View10, { style: { marginRight: 20 } }, end) : type === "password" && /* @__PURE__ */ React15.createElement(
|
|
1698
|
+
TouchableOpacity7,
|
|
1699
|
+
{
|
|
1700
|
+
style: { marginRight: 20 },
|
|
1701
|
+
onPress: () => setShowPassword(!showPassword)
|
|
1702
|
+
},
|
|
1703
|
+
/* @__PURE__ */ React15.createElement(
|
|
1704
|
+
Ionicons3,
|
|
1705
|
+
{
|
|
1706
|
+
name: showPassword ? "eye-outline" : "eye-off-outline",
|
|
1707
|
+
size: 24,
|
|
1708
|
+
color: colors2.textSecondary.main
|
|
1709
|
+
}
|
|
1710
|
+
)
|
|
1689
1711
|
)
|
|
1690
|
-
)
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
+
), helperText && /* @__PURE__ */ React15.createElement(
|
|
1713
|
+
Typography_default,
|
|
1714
|
+
{
|
|
1715
|
+
color: "textSecondary",
|
|
1716
|
+
style: styles2.helperText,
|
|
1717
|
+
variant: "caption"
|
|
1718
|
+
},
|
|
1719
|
+
helperText
|
|
1720
|
+
), error && /* @__PURE__ */ React15.createElement(View10, { style: styles2.error }, /* @__PURE__ */ React15.createElement(MaterialIcons5, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ React15.createElement(Typography_default, { style: styles2.errorText, color: "error" }, error))), options && /* @__PURE__ */ React15.createElement(
|
|
1721
|
+
SelectMenu_default,
|
|
1722
|
+
{
|
|
1723
|
+
options,
|
|
1724
|
+
value,
|
|
1725
|
+
open: focused,
|
|
1726
|
+
onClose: () => setFocused(false),
|
|
1727
|
+
label,
|
|
1728
|
+
helperText,
|
|
1729
|
+
onChange: onChangeText
|
|
1730
|
+
}
|
|
1731
|
+
));
|
|
1732
|
+
}
|
|
1733
|
+
);
|
|
1712
1734
|
var TextField_default = TextField;
|
|
1713
1735
|
|
|
1714
1736
|
// ../src/Components/Locator.tsx
|
|
1715
1737
|
import * as Location from "expo-location";
|
|
1716
1738
|
import { ScaledSheet as ScaledSheet13 } from "react-native-size-matters";
|
|
1717
|
-
setTimeout(() => {
|
|
1718
|
-
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1719
|
-
if (GOOGLE_MAP_API_KEY)
|
|
1720
|
-
Location.setGoogleApiKey(GOOGLE_MAP_API_KEY);
|
|
1721
|
-
}, 500);
|
|
1722
1739
|
var getPredictionsFromCoords = async (coords) => {
|
|
1723
1740
|
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1724
1741
|
if (!GOOGLE_MAP_API_KEY)
|
|
@@ -1741,6 +1758,27 @@ var getPredictionsFromCoords = async (coords) => {
|
|
|
1741
1758
|
}
|
|
1742
1759
|
return p;
|
|
1743
1760
|
};
|
|
1761
|
+
var getPredictionsFromQuery = async (query, country) => {
|
|
1762
|
+
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1763
|
+
const endpoint = `https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${query}&components=country:${country}&radius=20000&key=${GOOGLE_MAP_API_KEY}`;
|
|
1764
|
+
const res = await (await fetch(endpoint)).json();
|
|
1765
|
+
const p = [];
|
|
1766
|
+
for (let key in res.predictions) {
|
|
1767
|
+
const { description, place_id } = res.predictions[key];
|
|
1768
|
+
p.push({
|
|
1769
|
+
description,
|
|
1770
|
+
id: place_id
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1773
|
+
return p;
|
|
1774
|
+
};
|
|
1775
|
+
var getLocationFromPlaceId = async (place_id) => {
|
|
1776
|
+
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1777
|
+
const res = await (await fetch(
|
|
1778
|
+
`https://maps.googleapis.com/maps/api/place/details/json?place_id=${place_id}&fields=formatted_address%2Cgeometry&key=${GOOGLE_MAP_API_KEY}`
|
|
1779
|
+
)).json();
|
|
1780
|
+
return res.result;
|
|
1781
|
+
};
|
|
1744
1782
|
var Locator = ({
|
|
1745
1783
|
variant = "contained",
|
|
1746
1784
|
onLocationSelected,
|
|
@@ -1756,9 +1794,9 @@ var Locator = ({
|
|
|
1756
1794
|
country = "ng"
|
|
1757
1795
|
}) => {
|
|
1758
1796
|
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1759
|
-
const [changed, setChanged] =
|
|
1760
|
-
const [value, setValue] =
|
|
1761
|
-
const [prediction, setPrediction] =
|
|
1797
|
+
const [changed, setChanged] = useState7(false);
|
|
1798
|
+
const [value, setValue] = useState7("");
|
|
1799
|
+
const [prediction, setPrediction] = useState7([]);
|
|
1762
1800
|
const colors2 = useColors();
|
|
1763
1801
|
const styles2 = ScaledSheet13.create({
|
|
1764
1802
|
list: {
|
|
@@ -1780,17 +1818,8 @@ var Locator = ({
|
|
|
1780
1818
|
}
|
|
1781
1819
|
});
|
|
1782
1820
|
const search = async (query) => {
|
|
1783
|
-
const
|
|
1784
|
-
|
|
1785
|
-
const p = [];
|
|
1786
|
-
for (let key in res.predictions) {
|
|
1787
|
-
const { description, place_id } = res.predictions[key];
|
|
1788
|
-
p.push({
|
|
1789
|
-
description,
|
|
1790
|
-
id: place_id
|
|
1791
|
-
});
|
|
1792
|
-
}
|
|
1793
|
-
setPrediction(p);
|
|
1821
|
+
const predictions = await getPredictionsFromQuery(query, country);
|
|
1822
|
+
setPrediction(predictions);
|
|
1794
1823
|
};
|
|
1795
1824
|
const locateMe = () => {
|
|
1796
1825
|
const getLoc = async () => {
|
|
@@ -1824,21 +1853,19 @@ var Locator = ({
|
|
|
1824
1853
|
};
|
|
1825
1854
|
const locationPressed = async (loc) => {
|
|
1826
1855
|
setValue(loc.description);
|
|
1827
|
-
const res = await (
|
|
1828
|
-
`https://maps.googleapis.com/maps/api/place/details/json?place_id=${loc.id}&fields=formatted_address%2Cgeometry&key=${GOOGLE_MAP_API_KEY}`
|
|
1829
|
-
)).json();
|
|
1856
|
+
const res = await getLocationFromPlaceId(loc.id);
|
|
1830
1857
|
onLocationSelected(
|
|
1831
1858
|
{
|
|
1832
|
-
latitude: res.
|
|
1833
|
-
longitude: res.
|
|
1859
|
+
latitude: res.geometry.location.lat,
|
|
1860
|
+
longitude: res.geometry.location.lng,
|
|
1834
1861
|
description: loc.description
|
|
1835
1862
|
},
|
|
1836
|
-
res
|
|
1863
|
+
res?.formatted_address
|
|
1837
1864
|
);
|
|
1838
1865
|
setChanged(false);
|
|
1839
1866
|
setPrediction([]);
|
|
1840
1867
|
};
|
|
1841
|
-
|
|
1868
|
+
useEffect4(() => {
|
|
1842
1869
|
if (!GOOGLE_MAP_API_KEY)
|
|
1843
1870
|
console.error(
|
|
1844
1871
|
"Google map api key needs to be set to use this component \nMake sure to run initialize() with a valid google map api key"
|
|
@@ -1968,7 +1995,7 @@ var Spinner = ({
|
|
|
1968
1995
|
alignItems: "center",
|
|
1969
1996
|
justifyContent: "center",
|
|
1970
1997
|
position: fullscreen ? "absolute" : "relative",
|
|
1971
|
-
backgroundColor: fullscreen ? colors2.white[1] + "
|
|
1998
|
+
backgroundColor: fullscreen ? colors2.white[1] + "dd" : void 0,
|
|
1972
1999
|
...style
|
|
1973
2000
|
},
|
|
1974
2001
|
content: {
|
|
@@ -2101,7 +2128,9 @@ export {
|
|
|
2101
2128
|
UIThemeContext,
|
|
2102
2129
|
UIThemeProvider,
|
|
2103
2130
|
next_default as default,
|
|
2131
|
+
getLocationFromPlaceId,
|
|
2104
2132
|
getPredictionsFromCoords,
|
|
2133
|
+
getPredictionsFromQuery,
|
|
2105
2134
|
showFlashMessage,
|
|
2106
2135
|
useColors,
|
|
2107
2136
|
useNavScreenOptions,
|