1.0.5 • Published 4 years ago

react-profile-image-box v1.0.5

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

react-profile-image-box

Profile image box for user to view profile image and upload image to server

NPM JavaScript Style Guide

Image Box

Install

npm install --save react-profile-image-box

Usage

import React, { Component } from 'react'

import ProfileImageBox from 'react-profile-image-box'

export default class App extends Component {
  state = {
    src: "http://test.com/avatar_images_by_user/72"
  }

  onFileChange(e, additionalParams) {
    console.log(e.target.files);    
    console.log(additionalParams);
    
    this.setState({src: "http://test.com/avatar_images_by_user/70"});
  }

  render () {
    return (
      <div>
        <ProfileImageBox 
          alt="Alt Text" 
          allowUpload={true} 
          onFileChange={(e) => this.onFileChange(e, {type: 'user-image'})} 
          src={this.state.src}/>
      </div>
    )
  }
}

License

MIT © pritomkucse

1.0.5

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago