Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions src/components/Card/CardCover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export type Props = React.ComponentPropsWithRef<typeof Image> & {
* @optional
*/
theme?: ThemeProp;
/**
* Optional custom image component to replace default Image
*/
imageComponent?: React.ComponentType<any>;
};

/**
Expand All @@ -47,6 +51,7 @@ const CardCover = ({
total,
style,
theme: themeOverrides,
imageComponent: ImageComponent,
...rest
}: Props) => {
const theme = useInternalTheme(themeOverrides);
Expand All @@ -66,11 +71,18 @@ const CardCover = ({

return (
<View style={[styles.container, coverStyle, style]}>
<Image
{...rest}
style={[styles.image, coverStyle]}
accessibilityIgnoresInvertColors
/>
{ImageComponent ? (
<ImageComponent
{...rest}
style={[styles.image, coverStyle]}
/>
) : (
<Image
{...rest}
style={[styles.image, coverStyle]}
accessibilityIgnoresInvertColors
/>
)}
</View>
);
};
Expand Down