Last active
July 8, 2020 15:54
-
-
Save yoavniran/c8ebe0f0ee796d73062180b0a92f56dd to your computer and use it in GitHub Desktop.
UploadWithCrop.jsx - react-uploady demo
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 Uploady from "@rpldy/uploady"; | |
import UploadButton from "@rpldy/upload-button"; | |
import UploadPreview from "@rpldy/upload-preview"; | |
export default function UploadWithCrop() { | |
const previewMethodsRef = useRef(); | |
return ( | |
<Uploady | |
destination={{ url: "[upload-url]" }} | |
> | |
<div> | |
<UploadButton>Upload Files</UploadButton> | |
<br /> | |
<UploadPreview | |
PreviewComponent={ItemPreviewWithCrop} | |
previewComponentProps={{ previewMethods: previewMethodsRef }} | |
previewMethodsRef={previewMethodsRef} | |
fallbackUrl="https://icon-library.net/images/image-placeholder-icon/image-placeholder-icon-6.jpg" | |
/> | |
</div> | |
</Uploady> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment