native-pytech 1.0.125 → 1.0.126

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.
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type Props from './types';
3
- declare const _default: React.MemoExoticComponent<({ text, color, type, sizeDiameter, systemName, iconSize, }: Props) => React.JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ text, color, type, sizeDiameter, icon, iconSize, }: Props) => React.JSX.Element>;
4
4
  export default _default;
@@ -2,8 +2,7 @@ import React, { memo, useMemo } from 'react';
2
2
  import { StyleSheet, Text } from 'react-native';
3
3
  import { LinearGradient } from 'expo-linear-gradient';
4
4
  import colors, { sizes } from '../../constants';
5
- import Icon from '../Icon';
6
- export default memo(({ text, color = 'default', type = 'small', sizeDiameter, systemName, iconSize, }) => {
5
+ export default memo(({ text, color = 'default', type = 'small', sizeDiameter, icon, iconSize, }) => {
7
6
  const typeSizes = useMemo(() => sizes[type], [type]);
8
7
  const textComponent = useMemo(() => {
9
8
  const cantLetras = text?.length;
@@ -16,7 +15,7 @@ export default memo(({ text, color = 'default', type = 'small', sizeDiameter, sy
16
15
  </Text>);
17
16
  }, [text, typeSizes]);
18
17
  return (<LinearGradient style={[styles.gradient, { height: typeSizes.diameter, borderRadius: typeSizes.diameter }]} colors={[colors[color].light, colors[color].dark]} start={{ x: 0, y: 0 }} end={{ x: 0, y: 1 }}>
19
- {textComponent ?? (systemName && (<Icon systemName={systemName} size={iconSize ?? typeSizes.diameter / 2}/>))}
18
+ {textComponent ?? icon}
20
19
  </LinearGradient>);
21
20
  });
22
21
  const styles = StyleSheet.create({
@@ -1,5 +1,5 @@
1
1
  import { sizesType, ColorsType } from '../../constants';
2
- import IconProps from '../Icon/types';
2
+ import IconProps from '../Icon';
3
3
  export type Props = Omit<IconProps, 'size'> & {
4
4
  /**
5
5
  The text to display in the gradient.
@@ -6,6 +6,11 @@ type Props = {
6
6
  @ios
7
7
  */
8
8
  systemName?: SFSymbol;
9
+ /**
10
+ The icon to display.
11
+ @web
12
+ */
13
+ icon?: React.ReactNode;
9
14
  /**
10
15
  The size of the icon.
11
16
  @ios
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.125",
3
+ "version": "1.0.126",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,3 +0,0 @@
1
- import type Props from './types';
2
- declare const _default: ({ systemName, size }: Props) => null;
3
- export default _default;
@@ -1 +0,0 @@
1
- export default ({ systemName, size = 100 }) => null;