narcello / react-avatar-firebase

:raising_hand: Easily Avatar on Firebase Storage
MIT License
5 stars 2 forks source link
avatar firebase firebase-storage npm-package reactjs

react-avatar-firebase

Easily Avatar on Firebase Storage

Install

npm install --save react-avatar-firebase

Documentation

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

Usage

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

Local test

Run yarn start at root folder and at example folder

License

MIT © MarcelloVSilva