mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-05-13 13:17:45 +00:00
feat: show controversial miis on profiles by default
This commit is contained in:
parent
1805d21b12
commit
c4d01fa8ee
5 changed files with 26 additions and 24 deletions
|
|
@ -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 />
|
<OtherFilters />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
import Link from "next/link";
|
|
||||||
|
|
||||||
import { Prisma } from "@prisma/client";
|
import { Prisma } from "@prisma/client";
|
||||||
import { Icon } from "@iconify/react";
|
|
||||||
|
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import seedrandom from "seedrandom";
|
import seedrandom from "seedrandom";
|
||||||
|
|
@ -11,9 +8,6 @@ import { auth } from "@/lib/auth";
|
||||||
import { prisma } from "@/lib/prisma";
|
import { prisma } from "@/lib/prisma";
|
||||||
|
|
||||||
import SortSelect from "./sort-select";
|
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 Pagination from "./pagination";
|
||||||
import FilterMenu from "./filter-menu";
|
import FilterMenu from "./filter-menu";
|
||||||
import MiiGrid from "./mii-grid";
|
import MiiGrid from "./mii-grid";
|
||||||
|
|
@ -61,7 +55,7 @@ export default async function MiiList({ searchParams, userId, inLikesPage }: Pro
|
||||||
// Makeup
|
// Makeup
|
||||||
...(makeup && { makeup: { equals: makeup } }),
|
...(makeup && { makeup: { equals: makeup } }),
|
||||||
// Quarantined
|
// Quarantined
|
||||||
...(!quarantined && { quarantined: false }),
|
...(!quarantined && !userId && { quarantined: false }),
|
||||||
// Profiles
|
// Profiles
|
||||||
...(userId && { userId }),
|
...(userId && { userId }),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Icon } from "@iconify/react";
|
|
||||||
import { MiiPlatform } from "@prisma/client";
|
import { MiiPlatform } from "@prisma/client";
|
||||||
import { useRouter, useSearchParams } from "next/navigation";
|
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
||||||
import { ChangeEvent, useState, useTransition } from "react";
|
import { ChangeEvent, useState, useTransition } from "react";
|
||||||
|
|
||||||
export default function OtherFilters() {
|
export default function OtherFilters() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
|
const pathname = usePathname();
|
||||||
const [, startTransition] = useTransition();
|
const [, startTransition] = useTransition();
|
||||||
|
|
||||||
const platform = (searchParams.get("platform") as MiiPlatform) || undefined;
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
{platform === "THREE_DS" && (
|
<div className="flex items-center gap-4 text-zinc-500 text-sm font-medium w-full mt-2 mb-1">
|
||||||
<div className="flex justify-between items-center w-full">
|
<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">
|
<label htmlFor="allowCopying" className="text-sm">
|
||||||
Allow Copying
|
Allow Copying
|
||||||
</label>
|
</label>
|
||||||
<input type="checkbox" id="allowCopying" className="checkbox-alt" checked={allowCopying} onChange={handleChangeAllowCopying} />
|
<input type="checkbox" id="allowCopying" className="checkbox-alt" checked={allowCopying} onChange={handleChangeAllowCopying} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="flex justify-between items-center w-full">
|
{showQuarantined && (
|
||||||
<label htmlFor="quarantined" className="text-sm">
|
<div className="flex justify-between items-center w-full">
|
||||||
Show Controversial Miis
|
<label htmlFor="quarantined" className="text-sm">
|
||||||
</label>
|
Show Controversial Miis
|
||||||
<input type="checkbox" id="quarantined" className="checkbox-alt" checked={quarantined} onChange={handleChangeQuarantined} />
|
</label>
|
||||||
</div>
|
<input type="checkbox" id="quarantined" className="checkbox-alt" checked={quarantined} onChange={handleChangeQuarantined} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ export default function HeadTab({ instructions }: Props) {
|
||||||
type="number"
|
type="number"
|
||||||
id="age"
|
id="age"
|
||||||
min={1}
|
min={1}
|
||||||
max={100}
|
max={1000}
|
||||||
className="pill input text-sm py-1! px-3! w-full"
|
className="pill input text-sm py-1! px-3! w-full"
|
||||||
value={birthday.age ?? undefined}
|
value={birthday.age ?? undefined}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ export const switchMiiInstructionsSchema = z
|
||||||
.object({
|
.object({
|
||||||
day: z.number().int().min(1).max(31).optional(),
|
day: z.number().int().min(1).max(31).optional(),
|
||||||
month: z.number().int().min(1).max(12).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(),
|
dontAge: z.boolean().optional(),
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue