diff --git a/src/app/mii/[id]/page.tsx b/src/app/mii/[id]/page.tsx index e3e554c..a31fadb 100644 --- a/src/app/mii/[id]/page.tsx +++ b/src/app/mii/[id]/page.tsx @@ -130,11 +130,12 @@ export default async function MiiPage({ params }: Props) { )} {mii.in_queue && ( -
+

- This Mii is waiting to be manually reviewed and is hidden from the main page. (This could take a few hours or a couple of days) You can still - share the Mii through the URL! + This Mii is waiting to be manually reviewed and is hidden from the main page. The review could take between a few hours and a few days. +
+ Despite that, you can still share the Mii through the URL!

)} diff --git a/src/app/submit/page.tsx b/src/app/submit/page.tsx index 82e0cfa..52749f3 100644 --- a/src/app/submit/page.tsx +++ b/src/app/submit/page.tsx @@ -22,7 +22,7 @@ export const metadata: Metadata = { export default async function SubmitPage() { const session = await auth(); - if (!session) redirect("/login"); + if (!session || !session.user) redirect("/login"); const activePunishment = await prisma.punishment.findFirst({ where: { userId: Number(session?.user?.id), @@ -45,5 +45,7 @@ export default async function SubmitPage() {
); - return ; + const inQueueMiisCount = await prisma.mii.count({ where: { userId: Number(session.user.id), in_queue: true } }); + + return ; } diff --git a/src/components/mii/list/index.tsx b/src/components/mii/list/index.tsx index 5c1c4d0..6d1485f 100644 --- a/src/components/mii/list/index.tsx +++ b/src/components/mii/list/index.tsx @@ -37,7 +37,19 @@ export default async function MiiList({ searchParams, userId, parentPage }: Prop } const where: Prisma.MiiWhereInput = { - in_queue: parentPage === "admin", + // In queue logic + ...(parentPage === "admin" + ? { in_queue: true } // Only show queued Miis + : userId + ? { + // Include queued Miis if user is on their profile + ...(Number(session?.user?.id) === userId ? {} : { in_queue: false }), + userId, + } + : { + // Don't show queued Miis on main page + in_queue: false, + }), // Only show liked miis on likes page ...(parentPage === "likes" && miiIdsLiked && { id: { in: miiIdsLiked } }), // Searching @@ -57,8 +69,6 @@ export default async function MiiList({ searchParams, userId, parentPage }: Prop ...(makeup && { makeup: { equals: makeup } }), // Quarantined ...(!quarantined && !userId && { quarantined: false }), - // Profiles - ...(userId && { userId }), }; const select: Prisma.MiiSelect = { @@ -81,6 +91,7 @@ export default async function MiiList({ searchParams, userId, parentPage }: Prop makeup: true, allowedCopying: true, quarantined: true, + in_queue: true, // Mii liked check ...(session?.user?.id && { likedBy: { diff --git a/src/components/mii/list/mii-grid.tsx b/src/components/mii/list/mii-grid.tsx index 10652e2..1793dcb 100644 --- a/src/components/mii/list/mii-grid.tsx +++ b/src/components/mii/list/mii-grid.tsx @@ -32,8 +32,15 @@ export default function MiiGrid({ miis, userId, parentPage }: Props) { {miis.map((mii) => (
+ {mii.in_queue && ( +
+ + In Queue +
+ )} + ([]); const handleDrop = useCallback( @@ -192,316 +196,326 @@ export default function SubmitForm() {
-
-
-

Submit your Mii

-

Share your creation for others to see.

-
- - {/* Separator */} -
-
- Info -
-
- - {/* Platform select */} -
- -
- {/* Animated indicator */} - {/* TODO: maybe change width as part of animation? */} -
- - {/* Switch button */} - - - {/* 3DS button */} - -
-
- - {/* Name */} -
- - setName(e.target.value)} - /> -
- -
- - -
- - {/* Description */} -
- -