Skip to content

Commit 9fc096a

Browse files
authored
Image\Overlay - support borderRadius (#2995)
1 parent a38a3d5 commit 9fc096a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/components/image/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ class Image extends PureComponent<Props, State> {
259259
intensity={overlayIntensity}
260260
color={overlayColor}
261261
customContent={customOverlayContent}
262+
borderRadius={others?.borderRadius}
262263
/>
263264
)}
264265
</ImageView>

src/components/overlay/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {isUndefined} from 'lodash';
22
import React, {PureComponent} from 'react';
3-
import {StyleSheet, Image, ImageSourcePropType} from 'react-native';
3+
import {StyleSheet, Image, ImageProps, ImageSourcePropType} from 'react-native';
44
import {Colors} from '../../style';
55
import View from '../view';
66

@@ -23,7 +23,7 @@ export enum OverlayIntensityType {
2323

2424
export type OverlayTypeType = typeof OVERLY_TYPES[keyof typeof OVERLY_TYPES];
2525

26-
export type OverlayTypes = {
26+
export type OverlayTypes = Pick<ImageProps, 'borderRadius'> & {
2727
/**
2828
* The type of overlay to set on top of the image
2929
*/
@@ -88,7 +88,8 @@ class Overlay extends PureComponent<OverlayTypes> {
8888
};
8989

9090
renderImage = (style: any, source: ImageSourcePropType) => {
91-
return <Image style={[styles.container, style]} resizeMode={'stretch'} source={source}/>;
91+
const {borderRadius} = this.props;
92+
return <Image style={[styles.container, style]} resizeMode={'stretch'} source={source} borderRadius={borderRadius}/>;
9293
};
9394

9495
getImageSource = (type?: OverlayTypeType, intensity?: OverlayTypes['intensity']) => {

0 commit comments

Comments
 (0)