Skip to content

Commit 8d0e5a4

Browse files
authored
fix: add borderRadius theme property for Gallery image (#2580)
1 parent a40facd commit 8d0e5a4

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

package/src/components/Attachment/Gallery.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const GalleryThumbnail = <
289289
theme: {
290290
colors: { overlay },
291291
messageSimple: {
292-
gallery: { image, imageContainer, moreImagesContainer, moreImagesText },
292+
gallery: { image, imageBorderRadius, imageContainer, moreImagesContainer, moreImagesText },
293293
},
294294
},
295295
} = useTheme();
@@ -366,7 +366,7 @@ const GalleryThumbnail = <
366366
{thumbnail.type === 'video' ? (
367367
<VideoThumbnail
368368
style={[
369-
borderRadius,
369+
imageBorderRadius ?? borderRadius,
370370
{
371371
height: thumbnail.height - 1,
372372
width: thumbnail.width - 1,
@@ -378,7 +378,7 @@ const GalleryThumbnail = <
378378
) : (
379379
<View style={styles.imageContainerStyle}>
380380
<GalleryImageThumbnail
381-
borderRadius={borderRadius}
381+
borderRadius={imageBorderRadius ?? borderRadius}
382382
ImageLoadingFailedIndicator={ImageLoadingFailedIndicator}
383383
ImageLoadingIndicator={ImageLoadingIndicator}
384384
thumbnail={thumbnail}

package/src/contexts/themeContext/utils/theme.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,12 @@ export type Theme = {
499499
moreImagesContainer: ViewStyle;
500500
moreImagesText: TextStyle;
501501
thumbnail: ViewStyle;
502+
imageBorderRadius?: {
503+
borderBottomLeftRadius: number;
504+
borderBottomRightRadius: number;
505+
borderTopLeftRadius: number;
506+
borderTopRightRadius: number;
507+
};
502508
};
503509
giphy: {
504510
buttonContainer: ViewStyle;
@@ -1079,6 +1085,7 @@ export const defaultTheme: Theme = {
10791085
gridHeight: 195,
10801086
gridWidth: 256,
10811087
image: {},
1088+
imageBorderRadius: undefined,
10821089
imageContainer: {},
10831090
maxHeight: 300,
10841091
maxWidth: 256,

0 commit comments

Comments
 (0)