JakeHartnell / react-images-upload

React input file component with images preview
https://jakehartnell.github.io/react-images-upload/
MIT License
348 stars 155 forks source link

Make thumbnails zoomable #63

Open ivarprudnikov opened 5 years ago

ivarprudnikov commented 5 years ago

Current implementation outputs thumbnails which reference original image, but in the case when uploading scans of documents it is quite difficult to understand which is which. Thumbnail zoom would solve this issue.

Would there be an interest in adding react-medium-image-zoom as a dependency for thumbnails to be zoomable? Code changes would look like:

<...>
renderPreviewPictures() {
    return this.state.pictures.map((picture, index) => {
      return (
        <div key={index} className="uploadPictureContainer">
          <div className="deleteImage" onClick={() => this.removeImage(picture)}>X</div>
          <ImageZoom
            image={{
              src: picture,
              alt: 'preview',
              className: 'uploadPicture'
            }}
            zoomImage={{
              src: picture,
              alt: 'zoomed view',
              className: 'uploadPicture'
            }}
            shouldReplaceImage={false}
          />
        </div>
      );
    });
}
<...>

Examples of zoom effect can be found on their website: https://rpearce.github.io/react-medium-image-zoom/

If there is interest I can create pull request

vitorhorta commented 5 years ago

Any updates on this? Would accept PR?