Open theMasix opened 4 years ago
Hi @theMasix,
I'm hesitant to include this in react-avatar
core because of the dependency on the javascript library of Cloudinary.
I see three options to move forward with Cloudinary support in react-avatar
.
The first would be you created a wrapper component yourself and you would use the javascript SDK to build the URL and pass it into react-avatar
.
We create a Cloudinary source that imports the library but is not included by default. You'd have to import it explicitly and configure react-avatar
to use it, similar to the bundle reduction code.
We create a Cloudinary source that accepts instances of the cloudinary.Cloudinary
class from the Cloudinary [javascript SDK]() and a set of transformations.
Would it be possible for you to let me know which would / wouldn't fit your use-case?
I finally came up with the first solution. I use javascript SDK and build the URL. then pass it to the react-avatar
as src
prop.
Your second solutions looks good. I love it too.
But the third one is not my favorite solution. It's kind of a putting the cart before the horse I think...
Hello. I use this package for my entire avatar serving in React. Today, I got acquainted with Cloudinary CDN. I wonder if we could have cloudinray-specific support: Give the image name and image config to the package, then the package make the correct image url and serve it. I think it would be useful. I know the Cloudinary has its own React SDK. So what we might do is only merge the SDK with this package.