@hoddy-ui/core 2.5.45 → 2.5.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoddy-ui/core",
3
- "version": "2.5.45",
3
+ "version": "2.5.46",
4
4
  "description": "Core rich react native components written in typescript",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -1,4 +1,4 @@
1
- import { AntDesign } from "@expo/vector-icons";
1
+ import { AntDesign, Ionicons } from "@expo/vector-icons";
2
2
  import React, { useState } from "react";
3
3
  import { Image, View } from "react-native";
4
4
  import { ms, ScaledSheet } from "react-native-size-matters";
@@ -13,6 +13,7 @@ const Avatar: React.FC<AvatarProps> = ({
13
13
  source,
14
14
  size = 48,
15
15
  style = {},
16
+ icon,
16
17
  }) => {
17
18
  const colors = useColors();
18
19
  const [imageError, setImageError] = useState(false);
@@ -53,8 +54,10 @@ const Avatar: React.FC<AvatarProps> = ({
53
54
  <Typography style={{ color: colors[color].text }}>
54
55
  {label[0]}
55
56
  </Typography>
57
+ ) : icon ? (
58
+ icon
56
59
  ) : (
57
- <AntDesign name="user" color="#fff" size={Math.round(size / 1.5)} />
60
+ <Ionicons name="person" color="#fff" size={Math.round(size / 1.5)} />
58
61
  )}
59
62
  </View>
60
63
  );
package/src/types.ts CHANGED
@@ -79,6 +79,7 @@ export interface AvatarProps {
79
79
  source?: any;
80
80
  size?: number;
81
81
  style?: ViewStyle;
82
+ icon?: ReactNode;
82
83
  }
83
84
 
84
85
  export interface ButtonProps {