diff --git a/src/app/mii/[id]/page.tsx b/src/app/mii/[id]/page.tsx index 7ba6334..d94206a 100644 --- a/src/app/mii/[id]/page.tsx +++ b/src/app/mii/[id]/page.tsx @@ -7,7 +7,6 @@ import { Icon } from "@iconify/react"; import { auth } from "@/lib/auth"; import { prisma } from "@/lib/prisma"; -import Carousel from "@/components/carousel"; import LikeButton from "@/components/like-button"; import ImageViewer from "@/components/image-viewer"; import DeleteMiiButton from "@/components/delete-mii"; @@ -102,102 +101,153 @@ export default async function MiiPage({ params }: Props) { if (!mii) redirect("/404"); - const images = [ - `/mii/${mii.id}/image?type=mii`, - `/mii/${mii.id}/image?type=qr-code`, - ...Array.from({ length: mii.imageCount }, (_, index) => `/mii/${mii.id}/image?type=image${index}`), - ]; + const images = [...Array.from({ length: mii.imageCount }, (_, index) => `/mii/${mii.id}/image?type=image${index}`)]; return ( -
-
- {/* Carousel */} -
- -
+
+
+
+
+ {/* Mii Image */} +
+ +
+ {/* QR Code */} +
+ +
+
- {/* Information */} -
-

{mii.name}

-
- {mii.tags.map((tag) => ( - - {tag} - - ))} -
- -
- - By: @{mii.user.username} - -

- Created: {mii.createdAt.toLocaleDateString("en-GB", { month: "long", day: "2-digit", year: "numeric" })} -

-
- -
- 0} - isLoggedIn={session?.user != null} - big - /> -
-
- - {/* Extra information */} -
-
- Mii Info -
    + {/* Mii Info */} +
    • Name:{" "} - + {mii.firstName} {mii.lastName}
    • - From: {mii.islandName} Island + From: {mii.islandName} Island
    • Allowed Copying:
    -
-
- {session && (Number(session.user.id) === mii.userId || Number(session.user.id) === Number(process.env.NEXT_PUBLIC_ADMIN_USER_ID)) && ( - <> - - - - - - )} - - - - + {/* Mii Gender */} +
+
+ +
+ +
+ +
+
+
+ +
+ {/* Information */} +
+
+ {/* Submission name */} +

{mii.name}

+ {/* Like button */} + 0} + isLoggedIn={session?.user != null} + big + /> +
+ {/* Tags */} +
+ {mii.tags.map((tag) => ( + + {tag} + + ))} +
+ + {/* Author and Created date */} +
+ + By: @{mii.user.username} + +

+ Created: {mii.createdAt.toLocaleDateString("en-GB", { month: "long", day: "2-digit", year: "numeric" })} at{" "} + {mii.createdAt.toLocaleTimeString("en-GB", { timeZone: "UTC" })} UTC +

+
+
+ + {/* Buttons */} +
+ {session && (Number(session.user.id) === mii.userId || Number(session.user.id) === Number(process.env.NEXT_PUBLIC_ADMIN_USER_ID)) && ( + <> + + + Edit + + + + )} + + + + Report + + +
-
- {/* Images */} -
-
- {images.map((src, index) => ( - - ))} + {/* Images */} +
+

+ + Gallery +

+ + {images.length > 0 ? ( +
+ {images.map((src, index) => ( +
+ +
+ ))} +
+ ) : ( +

There is nothing here...

+ )}
diff --git a/src/components/delete-mii.tsx b/src/components/delete-mii.tsx index d14e353..18500b2 100644 --- a/src/components/delete-mii.tsx +++ b/src/components/delete-mii.tsx @@ -13,9 +13,10 @@ interface Props { miiId: number; miiName: string; likes: number; + inMiiPage?: boolean; } -export default function DeleteMiiButton({ miiId, miiName, likes }: Props) { +export default function DeleteMiiButton({ miiId, miiName, likes, inMiiPage }: Props) { const [isOpen, setIsOpen] = useState(false); const [isVisible, setIsVisible] = useState(false); @@ -49,9 +50,16 @@ export default function DeleteMiiButton({ miiId, miiName, likes }: Props) { return ( <> - + {inMiiPage ? ( + + ) : ( + + )} {isOpen && createPortal( diff --git a/src/components/tutorial/scan.tsx b/src/components/tutorial/scan.tsx index 73b8103..5279aa7 100644 --- a/src/components/tutorial/scan.tsx +++ b/src/components/tutorial/scan.tsx @@ -36,13 +36,9 @@ export default function ScanTutorialButton() { return ( <> - {isOpen &&