feat: show controversial miis on profiles by default

This commit is contained in:
trafficlunar 2026-03-30 18:30:03 +01:00
parent 1805d21b12
commit c4d01fa8ee
5 changed files with 26 additions and 24 deletions

View file

@ -128,11 +128,6 @@ export default function FilterMenu() {
</>
)}
<div className="flex items-center gap-4 text-zinc-500 text-sm font-medium w-full mt-2 mb-1">
<hr className="grow border-zinc-300" />
<span>Other</span>
<hr className="grow border-zinc-300" />
</div>
<OtherFilters />
</div>
)}

View file

@ -1,7 +1,4 @@
import Link from "next/link";
import { Prisma } from "@prisma/client";
import { Icon } from "@iconify/react";
import crypto from "crypto";
import seedrandom from "seedrandom";
@ -11,9 +8,6 @@ import { auth } from "@/lib/auth";
import { prisma } from "@/lib/prisma";
import SortSelect from "./sort-select";
import Carousel from "../../carousel";
import LikeButton from "../../like-button";
import DeleteMiiButton from "../delete-mii-button";
import Pagination from "./pagination";
import FilterMenu from "./filter-menu";
import MiiGrid from "./mii-grid";
@ -61,7 +55,7 @@ export default async function MiiList({ searchParams, userId, inLikesPage }: Pro
// Makeup
...(makeup && { makeup: { equals: makeup } }),
// Quarantined
...(!quarantined && { quarantined: false }),
...(!quarantined && !userId && { quarantined: false }),
// Profiles
...(userId && { userId }),
};

View file

@ -1,13 +1,13 @@
"use client";
import { Icon } from "@iconify/react";
import { MiiPlatform } from "@prisma/client";
import { useRouter, useSearchParams } from "next/navigation";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { ChangeEvent, useState, useTransition } from "react";
export default function OtherFilters() {
const router = useRouter();
const searchParams = useSearchParams();
const pathname = usePathname();
const [, startTransition] = useTransition();
const platform = (searchParams.get("platform") as MiiPlatform) || undefined;
@ -48,22 +48,35 @@ export default function OtherFilters() {
});
};
const showAllowCopying = platform !== "SWITCH";
const showQuarantined = !pathname.startsWith("/profile");
if (!showAllowCopying && !showQuarantined) return null;
return (
<>
{platform === "THREE_DS" && (
<div className="flex justify-between items-center w-full">
<div className="flex items-center gap-4 text-zinc-500 text-sm font-medium w-full mt-2 mb-1">
<hr className="grow border-zinc-300" />
<span>Other</span>
<hr className="grow border-zinc-300" />
</div>
{showAllowCopying && (
<div className="flex justify-between items-center w-full mb-1">
<label htmlFor="allowCopying" className="text-sm">
Allow Copying
</label>
<input type="checkbox" id="allowCopying" className="checkbox-alt" checked={allowCopying} onChange={handleChangeAllowCopying} />
</div>
)}
{showQuarantined && (
<div className="flex justify-between items-center w-full">
<label htmlFor="quarantined" className="text-sm">
Show Controversial Miis
</label>
<input type="checkbox" id="quarantined" className="checkbox-alt" checked={quarantined} onChange={handleChangeQuarantined} />
</div>
)}
</>
);
}

View file

@ -181,7 +181,7 @@ export default function HeadTab({ instructions }: Props) {
type="number"
id="age"
min={1}
max={100}
max={1000}
className="pill input text-sm py-1! px-3! w-full"
value={birthday.age ?? undefined}
onChange={(e) => {

View file

@ -288,7 +288,7 @@ export const switchMiiInstructionsSchema = z
.object({
day: z.number().int().min(1).max(31).optional(),
month: z.number().int().min(1).max(12).optional(),
age: z.number().int().min(1).max(100).optional(),
age: z.number().int().min(1).max(1000).optional(),
dontAge: z.boolean().optional(),
})
.optional(),