Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 1.95 KB

File metadata and controls

57 lines (42 loc) · 1.95 KB

purescript-react-dropzone

PureScript FFI bindings for "react-dropzone" package.

It's work in progress, not published on pursuit yet, but it's working, I have used it in production. For now you can dirty copy-paste it or use as git-submodule.

Requirements

Usage example

Keep in mind that this example requires purescript-react-spaces.

dropzone ^^ dropzoneDefaultProps
  { multiple = false
  , accept   = toNullable $ Just "image/jpeg, image/png"

  , onDropAccepted = toNullable $ Just $ handle2 $
      \files _ -> case head files of
                       Nothing -> pure unit
                       Just x  -> onFileDropped x

  , onDropRejected = toNullable $ Just $ handle2 $
      \files _ -> onFilesRejected files
  }
  $ do
    p $ text "Try dropping some files here, or click to select files to upload."
    p $ text "Only *.jpeg and *.png images will be accepted."

Author

Viacheslav Lotsmanov

License

MIT