1.0.1 • Published 3 years ago

dugoly-uploader v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

dugoly-uploader

Component for uploading images, linked to a server

for more information go to dugoly, Developers tools

Install

npm install --save dugoly-uploader

Usage

import React from 'react'
import Login from 'dugoly-login'
import Uploader  from 'dugoly-uploader'


const App = () => {
  const callback=(path)=>{alert(path)}
  const onError=(err)=>{alert("the error is:  "+err)}
  return(<div>
    <Login />
    <br />
     <Uploader callback={callback} onError={onError}/>
  </div>)
  
}

export default App

props

  • callback - will contain the callback function to perform after a successful upload, the parameter given to the function is the path to the image on the network

  • onError - will contain the function to execute in case of failure to upload, the function accepts the error Note - in case the user is not logged in, no upload will be made but also this function will not be activated, instead, a message will appear that he must log in

General instructions for using the component

The component displays an image upload button Selecting an image will upload the image to the server Instead of the button, the image will appear Refreshing the page will cause the button to reappear

Note - the visual presentation of the component will also be displayed without logging in by dugoly but it will not be possible to upload the image Therefore the user should be allowed to login each time the uploader is used

Additional libraries

To view dugoly's list of libraries click here

License

MIT © omershiran motto - Application and website development