Created
March 21, 2021 12:15
-
-
Save yoavniran/550a930728b299bdf08483f260c1fb77 to your computer and use it in GitHub Desktop.
react-uploady paste to upload example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import styled from "styled-components"; | |
import Uploady from "@rpldy/uploady"; | |
import UploadDropZone from "@rpldy/upload-drop-zone"; | |
import withPasteUpload from "@rpldy/upload-paste"; | |
const StyledDropZone = styled(UploadDropZone)` | |
width: 400px; | |
height: 400px; | |
border: 1px solid #000; | |
`; | |
const PasteUploadDropZone = withPasteUpload(StyledDropZone); | |
export const MyApp = (): Node => { | |
return <Uploady multiple | |
destination={{ url: "my-server.com/upload" }}> | |
<PasteUploadDropZone autoUpload={false} params={{ test: "paste" }}> | |
You can drop a file here | |
<br/> | |
OR | |
<br/> | |
click and paste a file to upload | |
</PasteUploadDropZone> | |
</Uploady> | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment