1.1.2 • Published 9 years ago

react-image-select-component v1.1.2

Weekly downloads
13
License
ISC
Repository
github
Last release
9 years ago

react-image-select-tool

A react component for selecting images. This component returns a base64 Image.

Deps

##Usage

import ImageFileSelector from "react-image-select-component";

<ImageFileSelector
    ref="imageFileSelector"
    onSelect={this.selectImage} //required
    onRemoveImage={this.onRemoveImage}
    onInvalidImage={this.onInvalidImage}  //required
    maxImageFileSize={this.maxImageFileSize}
    notImage={labels.errors.notImage}
    imageTooLarge={labels.errors.imageTooLarge}
    imageTooSmall={labels.errors.imageTooSmall}
    minSize={this.props.size}/>

###Props onSelect(function) - This receives the file selected(basically an object with the filename, date...) and it returns a base64 image and the file object it self.

For example
 async selectImage(imageBase64, imageFile) {
    //imageBase64 - base64 file
    //imageFile - Object of file selected
 }

onInvalidImage(function) - If an error occures, it recives the error message and sends it back

For example
  onInvalidImage(error) {
		//display error message
	}

notImage, imageTooLarge, && imageTooSmall (string) - These are props containing error messages error messages

 For example
	notImage: 'Please upload an image',
	imageTooLarge: 'This image is too large',
	imageTooSmall: 'This image is smaller than the required file image pixel size"
1.1.2

9 years ago

1.1.1

9 years ago

1.0.40

9 years ago

1.0.39

9 years ago

1.0.31

9 years ago

1.0.30

9 years ago

1.0.29

9 years ago

1.0.28

9 years ago

1.0.27

9 years ago

1.0.26

9 years ago

1.0.25

9 years ago

1.0.24

9 years ago

1.0.23

9 years ago

1.0.22

9 years ago

1.0.21

9 years ago

1.0.20

9 years ago

1.0.19

9 years ago

1.0.18

9 years ago

1.0.17

9 years ago

1.0.16

9 years ago

1.0.14

9 years ago

1.0.13

9 years ago

1.0.12

9 years ago

1.0.11

9 years ago

1.0.10

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago