t3dotgg / quickpic

Turn SVGs into high resolution PNGs in 2 clicks. Built because Theo was mad.
https://quickpic.t3.gg
MIT License
920 stars 184 forks source link

feat: Adds simple file validation #36

Closed AbrahamX3 closed 2 weeks ago

AbrahamX3 commented 2 weeks ago

Description

This PR adds simple file validation when handling Image and SVG file uploads using their mime type. The error is displayed via a toast using sonner (useful for handling future error messages!)

Preview

https://github.com/user-attachments/assets/8b9b632a-be4f-441a-b08b-1504cb61a8fd

Current

Production currently lets you upload any file type, so this PR fixes that.

image

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quickpic ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 10, 2024 10:15am
AbrahamX3 commented 2 weeks ago

Also added toast errors in case file is somehow missing when uploading a file.

t3dotgg commented 2 weeks ago

I added a shitty alert before I saw this 😭 down to rebase it on current state and move the alerts there?

AbrahamX3 commented 2 weeks ago

I added a shitty alert before I saw this 😭 down to rebase it on current state and move the alerts there?

Sure thing, I made validation even better and more dynamic for future tools, check out #65!