diff --git a/src/app/components/carousel.tsx b/src/app/components/carousel.tsx index 51d30d8..b366c30 100644 --- a/src/app/components/carousel.tsx +++ b/src/app/components/carousel.tsx @@ -21,7 +21,7 @@ export default function Carousel({ images, className }: Props) { if (!emblaApi) return; setScrollSnaps(emblaApi.scrollSnapList()); emblaApi.on("select", () => setSelectedIndex(emblaApi.selectedScrollSnap())); - }, [emblaApi]); + }, [images, emblaApi]); // Handle keyboard events useEffect(() => { diff --git a/src/app/components/image-viewer.tsx b/src/app/components/image-viewer.tsx index 80e6932..5b32184 100644 --- a/src/app/components/image-viewer.tsx +++ b/src/app/components/image-viewer.tsx @@ -159,7 +159,7 @@ export default function ImageViewer({ src, alt, width, height, className, images {/* Carousel snaps */}
@@ -167,7 +167,7 @@ export default function ImageViewer({ src, alt, width, height, className, images
diff --git a/src/app/components/submit-form/image-list.tsx b/src/app/components/submit-form/image-list.tsx index 6d0bf4d..9bbcdbb 100644 --- a/src/app/components/submit-form/image-list.tsx +++ b/src/app/components/submit-form/image-list.tsx @@ -41,6 +41,8 @@ export default function ImageList({ files, setFiles }: Props) { {file.name}
diff --git a/src/app/components/submit-form/index.tsx b/src/app/components/submit-form/index.tsx index a1edc53..a788f1b 100644 --- a/src/app/components/submit-form/index.tsx +++ b/src/app/components/submit-form/index.tsx @@ -1,7 +1,6 @@ "use client"; import { redirect } from "next/navigation"; -import Image from "next/image"; import { useCallback, useEffect, useState } from "react"; import { FileWithPath, useDropzone } from "react-dropzone"; @@ -18,6 +17,8 @@ import TagSelector from "../tag-selector"; import ImageList from "./image-list"; import QrUpload from "./qr-upload"; import QrScanner from "./qr-scanner"; +import LikeButton from "../like-button"; +import Carousel from "../carousel"; export default function SubmitForm() { const [files, setFiles] = useState([]); @@ -106,7 +107,7 @@ export default function SubmitForm() { } try { - setStudioUrl(conversion.mii.studioUrl({ width: 128 })); + setStudioUrl(conversion.mii.studioUrl({ width: 512 })); // Generate a new QR code for aesthetic reasons const byteString = String.fromCharCode(...qrBytes); @@ -124,53 +125,46 @@ export default function SubmitForm() { }, [qrBytesRaw]); return ( -
-
-
-
- {!studioUrl && Mii} - Nintendo Studio URL -
-
- {!generatedQrCodeUrl && QR Code} - Generated QR Code + +
+
+ URL.createObjectURL(file))]} + /> + +
+

+ {name || "Mii name"} +

+
+ {tags.length == 0 && tag} + {tags.map((tag) => ( + + {tag} + + ))} +
+ +
+ +
- -
-
- - -

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

-
-
- -
-
+
+
+

Submit your Mii

+

Share your creation for others to see.

+
+ + {/* Separator */} +
+
+ Info +
+
+
-
- QR Code + {/* Separator */} +
+
+ QR Code +
+
+
or @@ -207,15 +206,42 @@ export default function SubmitForm() { -
-
+
-
- + {/* Separator */} +
+
+ Custom images +
+
- {error && Error: {error}} +
+
+ + +

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

+
+
+ + + +
+
+ {error && Error: {error}} + + +
); diff --git a/src/app/components/submit-form/qr-upload.tsx b/src/app/components/submit-form/qr-upload.tsx index 410a614..d370b6e 100644 --- a/src/app/components/submit-form/qr-upload.tsx +++ b/src/app/components/submit-form/qr-upload.tsx @@ -52,7 +52,7 @@ export default function QrUpload({ setQrBytesRaw }: Props) { }); return ( -
+
-

Submit your Mii

+
);