Right now, after uploading image, it shows up only the name of the file, the size and the remove button. I wanted to display the image itself on the circle.
Pls check codesandbox here CLICK HERE
<UploadWrapper>
<Widget
localeTranslations={translation}
publicKey="demopublickey"
imagesOnly
previewStep
clearable
onfi
onFileSelect={(file) => {
if (!file) {
console.log("File removed from widget");
return;
}
file.done((fileInfo) => {
console.log("File uploaded: ", fileInfo.cdnUrl);
});
}}
/>
</UploadWrapper>
From what I can tell it looks like the
Widget
component is only for uploading a file and not for rendering one.Here's a solution I came up with: Use some "state" to store the uploaded file URL and conditionally hide the
Widget
to upload a file or the rendered div/image. Use an attached ref to theWidget
in a click handler on the image to trigger re-opening of the upload dialog.Style:
Component: