@hoddy-ui/core 2.5.32 → 2.5.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoddy-ui/next",
3
- "version": "2.0.59",
3
+ "version": "2.0.61",
4
4
  "description": "Core rich react native components written in typescript, with support for expo-router",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoddy-ui/core",
3
- "version": "2.5.32",
3
+ "version": "2.5.33",
4
4
  "description": "Core rich react native components written in typescript",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -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 resizeMode="cover" style={styles.image} source={source} />
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]}
@@ -57,10 +57,11 @@ export const getPredictionsFromQuery = async (
57
57
 
58
58
  const p = [];
59
59
  for (let key in res.predictions) {
60
- const { description, place_id } = res.predictions[key];
60
+ const { description, place_id, types } = res.predictions[key];
61
61
  p.push({
62
62
  description,
63
63
  id: place_id,
64
+ types,
64
65
  });
65
66
  }
66
67
  return p;