Skip to content

Instantly share code, notes, and snippets.

@yoavniran
Created March 21, 2021 12:15
Show Gist options
  • Save yoavniran/550a930728b299bdf08483f260c1fb77 to your computer and use it in GitHub Desktop.
Save yoavniran/550a930728b299bdf08483f260c1fb77 to your computer and use it in GitHub Desktop.
react-uploady paste to upload example
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