Skip to content

Commit

Permalink
Fix zoom images in AttachmentCarouselPage
Browse files Browse the repository at this point in the history
  • Loading branch information
WojtekBoman committed Nov 17, 2023
1 parent b34572e commit c661aa9
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ const defaultProps = {

const DEFAULT_IMAGE_SIZE = 200;

const defaultImageStyle = {
width: DEFAULT_IMAGE_SIZE,
height: DEFAULT_IMAGE_SIZE,
};

function AttachmentCarouselPage({source, isAuthTokenRequired, isActive: initialIsActive}) {
const {canvasWidth, canvasHeight} = useContext(AttachmentCarouselPagerContext);

Expand Down Expand Up @@ -87,7 +82,7 @@ function AttachmentCarouselPage({source, isAuthTokenRequired, isActive: initialI
>
<Image
source={{uri: source}}
style={dimensions == null ? defaultImageStyle : {width: dimensions.imageWidth, height: dimensions.imageHeight}}
style={{width: dimensions?.imageWidth || DEFAULT_IMAGE_SIZE, height: dimensions?.imageHeight || DEFAULT_IMAGE_SIZE}}
isAuthTokenRequired={isAuthTokenRequired}
onLoadStart={() => {
setIsImageLoading(true);
Expand Down Expand Up @@ -173,7 +168,7 @@ function AttachmentCarouselPage({source, isAuthTokenRequired, isActive: initialI
scaledImageHeight,
});
}}
style={dimensions == null ? defaultImageStyle : {width: dimensions.scaledImageWidth, height: dimensions.scaledImageHeight}}
style={{width: dimensions?.scaledImageWidth || DEFAULT_IMAGE_SIZE, height: dimensions?.scaledImageHeight || DEFAULT_IMAGE_SIZE}}
/>
</ImageWrapper>
)}
Expand Down

0 comments on commit c661aa9

Please sign in to comment.