diff --git a/web/src/components/icon-submission-form.tsx b/web/src/components/icon-submission-form.tsx index 184c7e3f..be5ef2d0 100644 --- a/web/src/components/icon-submission-form.tsx +++ b/web/src/components/icon-submission-form.tsx @@ -6,6 +6,7 @@ import Link from "next/link" import { useState } from "react" import { Button } from "@/components/ui/button" import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog" +import { Dropzone, DropzoneContent, DropzoneEmptyState } from "@/components/ui/shadcn-io/dropzone" import { REPO_PATH } from "@/constants" export const ISSUE_TEMPLATES = [ @@ -41,8 +42,62 @@ export const ISSUE_TEMPLATES = [ }, ] export function IconSubmissionContent({ onClose }: { onClose?: () => void }) { + const [files, setFiles] = useState() + const [filePreview, setFilePreview] = useState() + + const handleDrop = (files: File[]) => { + console.log(files) + setFiles(files) + if (files.length > 0) { + const reader = new FileReader() + reader.onload = (e) => { + if (typeof e.target?.result === 'string') { + setFilePreview(e.target?.result) + } + } + reader.readAsDataURL(files[0]) + } + } + return (
+ {/* Dropzone Section */} +
+

Upload Icon Files

+ + + + {filePreview && ( +
+ Preview +
+ )} +
+
+ {files && files.length > 0 && ( +
+ {files.length} file(s) selected +
+ )} +
+ + {/* Divider */} +
+

Or submit via GitHub issue:

+
+ + {/* Issue Templates */}
{ISSUE_TEMPLATES.map((template) => (