Kyoso-Team / kyoso

A web application that takes osu! tournaments beyonds spreadsheets.
http://kyoso.sh
GNU Affero General Public License v3.0
1 stars 1 forks source link

Design reusable component for uploading and previewing files #36

Closed L-Mario564 closed 2 months ago

L-Mario564 commented 3 months ago

Why?

A single component that handles any file upload would be very convenient to have instead of re-implementing a similar UI with small differences for handling different assets.

How?

When the user desires to upload a file, a modal should appear and must have an upload button. Once the file is uploaded (locally), or if a file is already in place: if it's an image or GIF, preview the image/GIF; if it's any other file, show a file icon that just lets the user know that a file has been uploaded; in both cases, display the original file name below.

If the user has uploaded a file, they must be able to upload that file to the Bunny storage zone and update the metadata in the DB making a request to the respective API route for that asset.