@hoddy-ui/core 2.5.32 → 2.5.34
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/next/dist/index.d.mts +1 -0
- package/next/dist/index.d.ts +1 -0
- package/next/dist/index.js +78 -46
- package/next/dist/index.js.map +1 -1
- package/next/dist/index.mjs +98 -66
- package/next/dist/index.mjs.map +1 -1
- package/next/package.json +1 -1
- package/package.json +1 -1
- package/src/Components/Avatar.tsx +9 -3
- package/src/Components/Locator.tsx +9 -2
package/next/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AntDesign } from "@expo/vector-icons";
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
3
|
import { Image, View } from "react-native";
|
|
4
4
|
import { ms, ScaledSheet } from "react-native-size-matters";
|
|
5
5
|
import { useColors } from "../hooks";
|
|
@@ -15,6 +15,7 @@ const Avatar: React.FC<AvatarProps> = ({
|
|
|
15
15
|
style = {},
|
|
16
16
|
}) => {
|
|
17
17
|
const colors = useColors();
|
|
18
|
+
const [imageError, setImageError] = useState(false);
|
|
18
19
|
const styles: any = ScaledSheet.create({
|
|
19
20
|
root: {
|
|
20
21
|
borderRadius: 150,
|
|
@@ -41,8 +42,13 @@ const Avatar: React.FC<AvatarProps> = ({
|
|
|
41
42
|
|
|
42
43
|
return (
|
|
43
44
|
<View style={styles.root}>
|
|
44
|
-
{source ? (
|
|
45
|
-
<Image
|
|
45
|
+
{source && !imageError ? (
|
|
46
|
+
<Image
|
|
47
|
+
resizeMode="cover"
|
|
48
|
+
style={styles.image}
|
|
49
|
+
source={source}
|
|
50
|
+
onError={() => setImageError(true)}
|
|
51
|
+
/>
|
|
46
52
|
) : label ? (
|
|
47
53
|
<Typography style={{ color: colors[color].text }}>
|
|
48
54
|
{label[0]}
|
|
@@ -15,6 +15,7 @@ import Typography from "./Typography";
|
|
|
15
15
|
export type predictionType = {
|
|
16
16
|
id: string;
|
|
17
17
|
description: string;
|
|
18
|
+
types: string[];
|
|
18
19
|
};
|
|
19
20
|
export const getPredictionsFromCoords = async (coords: {
|
|
20
21
|
latitude: number;
|
|
@@ -36,10 +37,15 @@ export const getPredictionsFromCoords = async (coords: {
|
|
|
36
37
|
const p = [];
|
|
37
38
|
|
|
38
39
|
for (let key in res.results) {
|
|
39
|
-
const {
|
|
40
|
+
const {
|
|
41
|
+
formatted_address: description,
|
|
42
|
+
place_id,
|
|
43
|
+
types,
|
|
44
|
+
} = res.results[key];
|
|
40
45
|
p.push({
|
|
41
46
|
description,
|
|
42
47
|
id: place_id,
|
|
48
|
+
types,
|
|
43
49
|
latLng: { lst: coords.latitude, lng: coords.longitude },
|
|
44
50
|
});
|
|
45
51
|
}
|
|
@@ -57,10 +63,11 @@ export const getPredictionsFromQuery = async (
|
|
|
57
63
|
|
|
58
64
|
const p = [];
|
|
59
65
|
for (let key in res.predictions) {
|
|
60
|
-
const { description, place_id } = res.predictions[key];
|
|
66
|
+
const { description, place_id, types } = res.predictions[key];
|
|
61
67
|
p.push({
|
|
62
68
|
description,
|
|
63
69
|
id: place_id,
|
|
70
|
+
types,
|
|
64
71
|
});
|
|
65
72
|
}
|
|
66
73
|
return p;
|