diff --git a/package.json b/package.json index 8dfd447..d16a2ec 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ "next-auth": "5.0.0-beta.25", "react": "^19.0.0", "react-dom": "^19.0.0", + "react-dropzone": "^14.3.8", + "react-select": "^5.10.1", "zod": "^3.24.2" }, "devDependencies": { diff --git a/src/app/components/header.tsx b/src/app/components/header.tsx index 1e4b93c..0cb76db 100644 --- a/src/app/components/header.tsx +++ b/src/app/components/header.tsx @@ -11,7 +11,7 @@ export default async function Header() { const session = await auth(); return ( -
+
TomodachiShare diff --git a/src/app/components/submit-form.tsx b/src/app/components/submit-form.tsx new file mode 100644 index 0000000..57ff5f8 --- /dev/null +++ b/src/app/components/submit-form.tsx @@ -0,0 +1,167 @@ +"use client"; + +import { useDropzone } from "react-dropzone"; +import CreatableSelect from "react-select/creatable"; +import { Icon } from "@iconify/react"; + +const options = [ + { value: "anime", label: "anime" }, + { value: "art", label: "art" }, + { value: "cartoon", label: "cartoon" }, + { value: "celebrity", label: "celebrity" }, + { value: "games", label: "games" }, + { value: "history", label: "history" }, + { value: "meme", label: "meme" }, + { value: "movie", label: "movie" }, + { value: "oc", label: "oc" }, + { value: "tv", label: "tv" }, +]; + +export default function SubmitForm() { + const { acceptedFiles, getRootProps, getInputProps } = useDropzone({ + accept: { + "image/*": [".png", ".jpg", ".jpeg", ".bmp", ".webp"], + }, + }); + + // todo: tag validating + + return ( +
e.preventDefault()} className="grid grid-cols-2"> +
+
+
+ + +

+ Drag and drop your images here +
+ or click to open +

+
+
+ + {/* todo: show file list here */} +
+ +
+
+ + +
+ +
+ + ({ + ...provided, + border: "none", + background: "transparent", + width: "100%", + boxShadow: "none", + }), + valueContainer: (provided) => ({ + ...provided, + padding: "0", + }), + multiValue: (provided) => ({ + ...provided, + borderRadius: "16px", + padding: "2px 8px", + backgroundColor: "var(--color-orange-300)", + }), + multiValueRemove: (provided) => ({ + ...provided, + cursor: "pointer", + "&:hover": { + backgroundColor: "transparent", + color: "var(--color-black)", + }, + }), + indicatorsContainer: (provided) => ({ + ...provided, + "*": { + padding: "1px", + color: "black", + cursor: "pointer", + }, + }), + indicatorSeparator: () => ({ + display: "none", + }), + placeholder: (provided) => ({ + ...provided, + color: "rgba(0, 0, 0, 0.4)", + }), + menu: (provided) => ({ + ...provided, + backgroundColor: "var(--color-orange-200)", + border: "2px solid var(--color-orange-400)", + borderRadius: "8px", + }), + option: (provided, { isFocused }) => ({ + ...provided, + backgroundColor: isFocused ? "rgba(0, 0, 0, 0.15)" : "var(--color-orange-200)", + cursor: "pointer", + padding: "2px 8px", + }), + }} + /> +
+ +
+ QR Code + +
+
+ + +

+ Drag and drop your QR code image here +
+ or click to open +

+
+
+ + or + + +
+ + +
+
+ ); +} diff --git a/src/app/components/username-form.tsx b/src/app/components/username-form.tsx index 3631e52..4945927 100644 --- a/src/app/components/username-form.tsx +++ b/src/app/components/username-form.tsx @@ -33,7 +33,7 @@ export default function UsernameForm() { value={username} onChange={(e) => setUsername(e.target.value)} required - className="pill !bg-orange-200 outline-0 focus:ring-[3px] ring-orange-400/50 transition w-96 mt-8 mb-2" + className="pill input w-96 mt-8 mb-2" />