From af2d66b8eac5b3d7b69d87dec86f66896bde9c5d Mon Sep 17 00:00:00 2001 From: Cristiano Tofani Date: Fri, 29 Mar 2024 13:04:16 +0100 Subject: [PATCH] fix: avatar image resize mode on wrong style element (#231) ## Short description This PR moves the resizeMode style attribute from the `View` component to the `Image` component. ## List of changes proposed in this pull request - Avatar style attributes ## How to test Check Avatar rendering. --------- Co-authored-by: Damiano Plebani --- src/components/avatar/Avatar.tsx | 2 +- .../avatar/__test__/__snapshots__/avatar.test.tsx.snap | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/avatar/Avatar.tsx b/src/components/avatar/Avatar.tsx index 16d0150d..a26a642e 100644 --- a/src/components/avatar/Avatar.tsx +++ b/src/components/avatar/Avatar.tsx @@ -55,11 +55,11 @@ const styles = StyleSheet.create({ }, avatarInnerWrapper: { overflow: "hidden", - resizeMode: "contain", backgroundColor: IOColors.white, borderCurve: "continuous" }, avatarImage: { + resizeMode: "contain", height: "100%", width: "100%" } diff --git a/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap b/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap index 5dff8940..b04e508e 100644 --- a/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +++ b/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap @@ -28,7 +28,6 @@ exports[`Test Avatar Components - Experimental Enabled Avatar Snapshot 1`] = ` "backgroundColor": "#FFFFFF", "borderCurve": "continuous", "overflow": "hidden", - "resizeMode": "contain", }, { "borderRadius": 2, @@ -47,6 +46,7 @@ exports[`Test Avatar Components - Experimental Enabled Avatar Snapshot 1`] = ` style={ { "height": "100%", + "resizeMode": "contain", "width": "100%", } } @@ -83,7 +83,6 @@ exports[`Test Avatar Components Avatar Snapshot 1`] = ` "backgroundColor": "#FFFFFF", "borderCurve": "continuous", "overflow": "hidden", - "resizeMode": "contain", }, { "borderRadius": 2, @@ -102,6 +101,7 @@ exports[`Test Avatar Components Avatar Snapshot 1`] = ` style={ { "height": "100%", + "resizeMode": "contain", "width": "100%", } }