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

Online fetched source is not a supported image #48

Closed
usmansbk opened this issue May 1, 2020 · 1 comment
Closed

Online fetched source is not a supported image #48

usmansbk opened this issue May 1, 2020 · 1 comment

Comments

@usmansbk
Copy link

usmansbk commented May 1, 2020

{
    "react-native": "^0.62.2",
    "react-native-user-avatar": "^1.0.7"
}
const src = "https://dffqb1y6phusm.cloudfront.net//eyJidWNrZXQiOiJzY2hkbHJhc3NldHMtcHJvZCIsImtleSI6InB1YmxpYy9iYW5uZXIvSU1HLTIwMjAwNDMwLTMyVjVjckNiRiIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MTAwLCJoZWlnaHQiOjEwMCwiZml0IjoiY292ZXIifX19";
<UserAvatar
  name={name}
  size={size}
  src={src}
/>

I get the warning below in console
Online fetched source is not a supported image;

Note: It loads google account avatars normally. Maybe a problem with RN, I'm not sure.

Extra

I noticed this component is not as circular as I percieved it in earlier version. I can see a little bit of the background color along the border.

My current solution

<UserAvatar
  name={name}
  // dont add 'src' prop to prevent borderWidth of 1
  style={{ // Add this to give a more circular shape
     width: size,
     height: size,
  }}
  size={size} // You still need this to keep the container circular
  component={
     src ? (
     <Image source={{uri: src}} style={{
         width: size + 1, // Adding 1 to prevent background border from leaking
         height: size + 1,
         borderRadius: size / 2
     }}/> ) : undefined
  }
/>
@usmansbk usmansbk closed this as completed May 3, 2020
@leoz
Copy link

leoz commented May 8, 2020

@usmansbk : I forked this package to retain old behavior.

You could try it like this:

yarn add react-native-user-avatar-component

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

2 participants