1.1.2 • Published 10 years ago

react-image-select-component v1.1.2

Weekly downloads
13
License
ISC
Repository
github
Last release
10 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

10 years ago

1.1.1

10 years ago

1.0.40

10 years ago

1.0.39

10 years ago

1.0.31

10 years ago

1.0.30

10 years ago

1.0.29

10 years ago

1.0.28

10 years ago

1.0.27

10 years ago

1.0.26

10 years ago

1.0.25

10 years ago

1.0.24

10 years ago

1.0.23

10 years ago

1.0.22

10 years ago

1.0.21

10 years ago

1.0.20

10 years ago

1.0.19

10 years ago

1.0.18

10 years ago

1.0.17

10 years ago

1.0.16

10 years ago

1.0.14

10 years ago

1.0.13

10 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago