Easily Avatar on Firebase Storage
npm install --save react-avatar-firebase
Use react-avatar-firebase for upload avatar on Firebase Storage.
Props | Definition |
---|---|
pathToStorage | Name of folder/path where you will save your avatar on storage |
imageSrc | Pass a image url to render |
handleGetImage | Callback that gives you a return of upload of image on storage |
animationTime | defines hover avatar wrapper animation time |
size | defines avatar wrapper px size |
borderColor | defines border color |
borderOpacity | defines border opacity |
readOnly | True for disable image selection |
storage | Object ref of firebase storage reference |
import React from 'react'
import RAF from 'react-avatar-firebase'
const App = () => {
return (
<div>
<RAF
pathToStorage="avatars"
imageSrc={imageSrc}
handleGetImage={handleGetImage}
animationTime='0.3s'
size={128}
borderColor='#e2e2e2'
borderOpacity={0.9}
storage={'<your firebase storage instance here>'}
/>
</div>
)
}
export default App
Run yarn start
at root folder and at example folder
MIT © MarcelloVSilva