项目作者: unclechu

项目描述 :
PureScript FFI bindings for "react-dropzone" package
高级语言: PureScript
项目地址: git://github.com/unclechu/purescript-react-dropzone.git
创建时间: 2018-03-13T16:24:32Z
项目社区:https://github.com/unclechu/purescript-react-dropzone

开源协议:MIT License

下载


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.

  1. dropzone ^^ dropzoneDefaultProps
  2. { multiple = false
  3. , accept = toNullable $ Just "image/jpeg, image/png"
  4. , onDropAccepted = toNullable $ Just $ handle2 $
  5. \files _ -> case head files of
  6. Nothing -> pure unit
  7. Just x -> onFileDropped x
  8. , onDropRejected = toNullable $ Just $ handle2 $
  9. \files _ -> onFilesRejected files
  10. }
  11. $ do
  12. p $ text "Try dropping some files here, or click to select files to upload."
  13. p $ text "Only *.jpeg and *.png images will be accepted."

Author

Viacheslav Lotsmanov

License

MIT