dripr-ui icon indicating copy to clipboard operation
dripr-ui copied to clipboard

Standalone React Component - NPM package

Open hetmann opened this issue 8 years ago • 7 comments

Hi @DevAlien nice project you have :) maybe you can create a standalone React component to use the dripr.io api.

  • NPM package name: react-dripr
  • Install with npm install react-dripr

and use it like:

import React from 'react';
import ReactDOM from 'react-dom';
import Dripr from 'react-dripr';

ReactDOM.render(
    <Dripr 
        apiKey="__dripr.io-apiKey__"
        placeholder="Click or Drag files here" 
        onSuccess={callback(fileObj)} />,

    document.querySelector('.app')
);

Let me know and I can help you :)

hetmann avatar Mar 02 '16 19:03 hetmann

Good idea @hetmann before investing time on this do you have any idea where this can be useful or used?

DevAlien avatar Mar 02 '16 20:03 DevAlien

Hi @DevAlien

I did this last night, let me know what you think, the npm package is available at: https://www.npmjs.com/package/react-dripr-demo

You can use the example above and it can be customized as you like, only change the import to: import Dripr from 'react-dripr-demo';

The idea is to have a reusable component that can use your Dripr style and API, maybe a dialog style Dripr. Than can lead to a custom upload file system where you can have a pricing system.

Image

hetmann avatar Mar 03 '16 05:03 hetmann

I donwloaded it, it is cool and almost working :) it is missing the upload part but can easily get integrated there

DevAlien avatar Mar 03 '16 08:03 DevAlien

Nice to hear that, let me know when you publish the package to NPM.

Also you can add an apiKey prop, which can be generated from the personal dripr.io account at API section.

This way you can get more users to use it.

About the pricing system, that is a feature which can be integrated based on the API limitations.

Free: 25 files / days & maxSize: 2Mb Paid: 250 files / days & maxSize: 49Mb Unlimited: ∞ files / days & maxSize: ∞

hetmann avatar Mar 03 '16 10:03 hetmann

I think at the beginning I will put limitations of how many files just in the anonymous upload, the rest will be free, for the moment but no limitation on how many files you can upload

DevAlien avatar Mar 03 '16 10:03 DevAlien

Or if you like to use the Dripr.io react component you need an account from where you can get a API key (free of use and no limitations)

hetmann avatar Mar 03 '16 10:03 hetmann

yes, that would need just a singup on dripr.io and then in the user settings I will show an api key

DevAlien avatar Mar 03 '16 10:03 DevAlien