react-profile-image-box
v1.0.5
Published
Profile image box for user to view profile image and upload image to server
Downloads
7
Readme
react-profile-image-box
Profile image box for user to view profile image and upload image to server
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