Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Image preview before uploading new server image #19

Open
growupanand opened this issue May 11, 2024 · 8 comments
Open

Show Image preview before uploading new server image #19

growupanand opened this issue May 11, 2024 · 8 comments
Assignees
Labels
enhancement New feature or request gssoc level1

Comments

@growupanand
Copy link

Is your feature request related to a problem? Please describe.
A modal window appears asking the user to upload their server image and provide a name when they sign up or start a new server. After the user selects the file there is no preview of the image showing before uploading or even after uploading.

Describe the solution you'd like
A preview image should shown before the user uploads the file when they select an image file.

Describe alternatives you've considered
We can upload the image immediately when the user clicks the "create" button, providing a better user experience than uploading the image first and then creating the server by clicking on the "create" button.

Additional context

Before upload
image

After upload
image

@growupanand
Copy link
Author

@Yeasir0032 Assign the issue so that I can start working on it.

@growupanand
Copy link
Author

@Yeasir0032 do you agree with below solution?

We can upload the image immediately when the user clicks the "create" button, providing a better user experience than uploading the image first and then creating the server by clicking on the "create" button.

@Yeasir0032
Copy link
Owner

Actually this is handled with uploadthing
Do check it if you really can do it

@growupanand
Copy link
Author

@Yeasir0032 There are two points below that I want to discuss with you:

  • Showing preview before upload
    You are using <UploadDropzone from "@uploadthing/react" for handling the whole file selection and upload flow. As per my knowledge after reading its documentation, there is no way to get the currently selected file before uploading it.
    Solution - Instead of relying on <UploadDropzone for image upload flow, we can use useUploadThing like here. This way we have full control of the upload flow.
    Reference -

  • Showing preview after upload
    While we implement a custom image upload flow which can take some time, I can fix showing the uploaded image preview.
    Reference -

    if (value && fileType === "image") {

@Yeasir0032
Copy link
Owner

Check issue 10. It is working on to replace upload thing

@growupanand
Copy link
Author

growupanand commented May 13, 2024

Until new upload service #10 is implemented,
Should I fix Showing preview after upload for the current upload flow?
Or just wait for the new upload service?

@Yeasir0032
Copy link
Owner

You can wait

@growupanand
Copy link
Author

growupanand commented May 16, 2024

<UploadDropzone component now supports onDrop prop.

FYI - pingdotgg/uploadthing#809

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc level1
Projects
None yet
Development

No branches or pull requests

2 participants