Skip to content

Commit c225124

Browse files
committed
changed the source type to ImageSourceType (#2985)
* changed the source type to ImageSourceType * fixed the type for Avatar and Icon also
1 parent b1d8f1a commit c225124

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/components/avatar/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import _ from 'lodash';
22
import React, {PropsWithChildren, useMemo, forwardRef} from 'react';
33
import {
44
StyleSheet,
5-
ImageSourcePropType,
65
StyleProp,
76
ViewStyle,
87
TouchableOpacity,
@@ -72,7 +71,7 @@ export type AvatarProps = Pick<AccessibilityProps, 'accessibilityLabel'> &
7271
/**
7372
* The image source (external or assets)
7473
*/
75-
source?: ImageSourcePropType;
74+
source?: ImageProps['source'];
7675
/**
7776
* Image props object
7877
*/

src/components/icon/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import isUndefined from 'lodash/isUndefined';
22
import React, {useMemo, forwardRef} from 'react';
3-
import {Image, ImageProps, StyleSheet, StyleProp, ViewStyle} from 'react-native';
3+
import {Image, ImageProps as RNImageProps, StyleSheet, StyleProp, ViewStyle} from 'react-native';
44
import {asBaseComponent, BaseComponentInjectedProps, MarginModifiers, Constants} from '../../commons/new';
55
import {ComponentStatics} from '../../typings/common';
66
import {getAsset, isSvg, isBase64ImageContent} from '../../utils/imageUtils';
77
import {RecorderProps} from '../../typings/recorderTypes';
88
import Badge, {BadgeProps} from '../badge';
99
import SvgImage from '../svgImage';
10-
import type {ImageSourceType} from '../image';
10+
import type {ImageProps} from '../image';
1111

12-
export type IconProps = Omit<ImageProps, 'source'> &
12+
export type IconProps = Omit<RNImageProps, 'source'> &
1313
MarginModifiers &
1414
RecorderProps & {
1515
/**
@@ -36,7 +36,7 @@ export type IconProps = Omit<ImageProps, 'source'> &
3636
* whether the icon should flip horizontally on RTL
3737
*/
3838
supportRTL?: boolean;
39-
source?: ImageSourceType
39+
source?: ImageProps['source'];
4040
};
4141

4242
/**

0 commit comments

Comments
 (0)