npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-grid-uploader

v1.0.2

Published

The grid uploader for Amazon S3 in ReactJS.

Downloads

35

Readme

react-grid-uploader

The grid uploader for Amazon S3 in ReactJS. Please see features in below:

  1. Upload multiple files at same times by drag-n-drop (using react-dropzone)
  2. Upload directly to S3 with signed url (using react-s3-uploader
  3. Rotate/Delete.
  4. View gallery in lightbox with react-image-lightbox

Sample

Installation

npm i --save react-grid-uploader
or
yarn add react-grid-uploader

Please file an issue if you have any trouble!

Usage

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import GridUploader from 'react-grid-uploader';

class App extends Component {

  onGetData = () => {
    console.log(this.gridContainer.getData());
    alert('check console to see the data structure');
  }

  render() {
    return (
      <div className="App">
        <div className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <h2>Welcome to Grid Uploader</h2>
          <button onClick={this.onGetData}>Get Data</button>
        </div>
        <div>
          <GridUploader ref={(ref) => { this.gridContainer = ref; }}
            signingUrl="http://localhost:8000/s3/sign" />
        </div>
      </div>
    );
  }
}

export default App;

Props

Name | Type |Info ------ | ----- | ---- signingUrl | String | Your backend service that uses to generate signed url from AWS_ACCESS_KEY_ID & AWS_SECRET_ACCESS_KEY. See at for example service https://github.com/odysseyscience/react-s3-uploader onUploadFinish | Function | the callback function when upload completely. onUploadError | Function | the callback function when upload failed. onUploadProgress | Function | the callback function when upload in progress. onItemSelect | Function | the callback function when select an image item. onItemDelete | Function | the callback function when delete an image item. customStyle | Function | the custom style for grid uploader.

customStyle Object

Property Name | Type | Info ------ | ----- | ---- containerStyle | Object | style for grid container. Default is width: '100%', backgroundColor: '#333333', minHeight: '600px' nameStyle | Object | style of image name. descriptionStyle | Object | style of image description. imageBorderColor | String | border color of image in normal state. imageBorderActiveColor | String | border color of image in active state. iconContainerStyle | Object | style of icon container iconStyle | Object | style of icon progressColor | String | color of cirle progress. Default is #fbba00

Response data structure

To get grid data, we call getData() and receive array of image data. Each item has the structure as below:

Property Name | Type | Info ------ | ----- | ---- s3Data | Object | The uploaded response from AWS S3. description | String | Description of image. rotate | Integer | Rotage degree of image. Others | | Properties from react-dropzone.

License

MIT