Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image doesn't render correctly on Android with React Native #448

Open
mariofay opened this issue Feb 15, 2023 · 0 comments
Open

Image doesn't render correctly on Android with React Native #448

mariofay opened this issue Feb 15, 2023 · 0 comments

Comments

@mariofay
Copy link

mariofay commented Feb 15, 2023

Expected Behavior

I took an example on iOS to illustrate the desired behavior but the problem is on Android

Capture d’écran 2023-02-15 à 17 31 27

Actual Behavior

Capture d’écran 2023-02-15 à 17 32 23

Context

I'm currently developing a kind of blog to create articles on Contentful and retrieve them on my application. On iOS everything works fine, however on Android the image does not display correctly and re-covers the text of my article as if it was taken out of the feed

My code

1 ------

    renderNode: {
      [INLINES.HYPERLINK]: node => {
        return (
          <View>
            <StyledImage screenWidth={screenWidth} source={{ uri: node.data.uri }} />
          </View>
        );
      },

2 ------

const StyledImage = styled(Image)<{ screenWidth: number }>(({ screenWidth }) => {
  const cardWidth = ARTICLE_IMAGE_WIDTH_SCALE * screenWidth;
  const cardHeight = cardWidth * ARTICLE_IMAGE_HEIGHT_ASPECT_RATIO;
  return {
    width: cardWidth,
    height: cardHeight,
    borderRadius: theme.spacing[24],
  };
});

Environment

  • Language Version: v16.17.0
  • Package Manager Version: 8.15.0
  • Package Version: "@contentful/rich-text-types": ^16.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant