This commit is contained in:
trafficlunar 2026-04-23 11:20:45 +01:00
parent aa631095fa
commit 0e52a59efa
5 changed files with 28 additions and 49 deletions

View file

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "miis" ADD COLUMN "reviewedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

View file

@ -88,7 +88,8 @@ model Mii {
islandName String? islandName String?
allowedCopying Boolean? allowedCopying Boolean?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
reviewedAt DateTime @default(now())
user User @relation(fields: [userId], references: [id], onDelete: Cascade) user User @relation(fields: [userId], references: [id], onDelete: Cascade)
likeCount Int @default(0) likeCount Int @default(0)

View file

@ -22,6 +22,7 @@ export async function PATCH(request: NextRequest) {
}, },
data: { data: {
in_queue: false, in_queue: false,
reviewedAt: new Date(),
}, },
}); });

View file

@ -69,10 +69,8 @@ export default async function MiiList({ searchParams, userId, parentPage }: Prop
...(!quarantined && !userId && { quarantined: false }), ...(!quarantined && !userId && { quarantined: false }),
// Time range // Time range
...(timeRange && { ...(timeRange && {
createdAt: { reviewedAt: {
gte: new Date( gte: new Date(Date.now() - { day: 86400000, week: 604800000, month: 2592000000, year: 31536000000 }[timeRange]),
Date.now() - { day: 86400000, week: 604800000, month: 2592000000, year: 31536000000 }[timeRange],
),
}, },
}), }),
}; };
@ -146,7 +144,7 @@ export default async function MiiList({ searchParams, userId, parentPage }: Prop
<span className="text-lg text-amber-700">{totalCount === 1 ? "Mii" : "Miis"}</span> <span className="text-lg text-amber-700">{totalCount === 1 ? "Mii" : "Miis"}</span>
</div> </div>
<div className="relative flex items-center justify-end gap-2 w-full md:max-w-2/3 max-md:justify-center"> <div className="relative flex flex-wrap items-center justify-end gap-2 w-full md:max-w-2/3 max-md:justify-center">
<FilterMenu /> <FilterMenu />
<SortSelect /> <SortSelect />
<TimeRangeSelect /> <TimeRangeSelect />

View file

@ -346,49 +346,26 @@ export default function SubmitForm({ inQueueMiisCount }: Props) {
{/* Makeup (switch only) */} {/* Makeup (switch only) */}
<div className={`w-full grid grid-cols-3 items-start ${platform === "SWITCH" ? "" : "hidden"}`}> <div className={`w-full grid grid-cols-3 items-start ${platform === "SWITCH" ? "" : "hidden"}`}>
<label htmlFor="makeup" className="font-semibold py-2"> <label className="font-semibold py-2">Face Paint</label>
Face Paint
</label>
<div className="col-span-2 flex gap-1"> <div className="col-span-2 flex flex-col gap-1.5">
{/* Full Makeup */} {[
<button { value: "FULL", label: "Full", desc: "Most of the face/features are covered", color: "pink" },
type="button" { value: "PARTIAL", label: "Partial", desc: "Small designs that don't cover features, like marks, stickers, etc.", color: "purple" },
onClick={() => setMakeup("FULL")} { value: "NONE", label: "None", desc: "No face paint present.", color: "gray" },
aria-label="Full Face Paint" ].map(({ value, label, desc, color }) => (
data-tooltip="Face covered more than 80%" <button
className={`cursor-pointer rounded-xl flex justify-center items-center size-11 text-4xl border-2 transition-all after:bg-pink-400! after:border-pink-400! before:border-b-pink-400! ${ key={value}
makeup === "FULL" ? "bg-pink-100 border-pink-400 shadow-md" : "bg-white border-gray-300 hover:border-gray-400" type="button"
}`} onClick={() => setMakeup(value as MiiMakeup)}
> className={`cursor-pointer rounded-xl text-left px-3 py-2 border-2 transition-all ${
<Icon icon="mdi:palette" className="text-pink-400" /> makeup === value ? `bg-${color}-100 border-${color}-400 shadow-md` : "bg-white border-gray-300 hover:border-gray-400"
</button> }`}
>
{/* Partial Makeup */} <div className={`font-medium text-sm ${makeup === value ? `text-${color}-500` : "text-gray-500"}`}>{label}</div>
<button <div className="text-xs text-gray-500 mt-0.5">{desc}</div>
type="button" </button>
onClick={() => setMakeup("PARTIAL")} ))}
aria-label="Partial Face Paint"
data-tooltip="For at least any face paint"
className={`cursor-pointer rounded-xl flex justify-center items-center size-11 text-4xl border-2 transition-all after:bg-purple-400! after:border-purple-400! before:border-b-purple-400! ${
makeup === "PARTIAL" ? "bg-purple-100 border-purple-400 shadow-md" : "bg-white border-gray-300 hover:border-gray-400"
}`}
>
<Icon icon="mdi:lipstick" className="text-purple-400" />
</button>
{/* No Makeup */}
<button
type="button"
onClick={() => setMakeup("NONE")}
aria-label="No Face Paint"
data-tooltip="No Face Paint"
className={`cursor-pointer rounded-xl flex justify-center items-center size-11 text-4xl border-2 transition-all after:bg-gray-400! after:border-gray-400! before:border-b-gray-400! ${
makeup === "NONE" ? "bg-gray-200 border-gray-400 shadow-md" : "bg-white border-gray-300 hover:border-gray-400"
}`}
>
<Icon icon="codex:cross" className="text-gray-400" />
</button>
</div> </div>
</div> </div>
@ -507,7 +484,7 @@ export default function SubmitForm({ inQueueMiisCount }: Props) {
<MiiEditor instructions={instructions} /> <MiiEditor instructions={instructions} />
<SwitchSubmitTutorialButton /> <SwitchSubmitTutorialButton />
<span className="text-xs text-zinc-400 text-center px-32 max-sm:px-8"> <span className="text-xs text-zinc-400 text-center px-32 max-sm:px-8">
Mii editor may be inaccurate. Instructions are recommended, but not required - you do not have to add every instruction. Mii editor may be inaccurate. Instructions are REALLY recommended, but you do not have to add every instruction.
</span> </span>
</div> </div>
</div> </div>