feat(tl): add see all page on each type,chore: change some text cuz @dmgnr make it wrong

This commit is contained in:
2026-03-08 19:31:43 +07:00 Unverified
parent 7819af4743
commit 3e3ef549d4
5 changed files with 93 additions and 13 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ import { cn } from "@/lib/utils";
export function Navbar() {
const pathname = usePathname();
if (!["/tl", "/artifact", "/rubgram"].includes(pathname)) return "";
if (!/^\/(?:tl(?:\/[a-zA-Z0-9]+)?|rubgram|artifact)$/gm.test(pathname)) return "";
return (
<div className="flex gap-2 p-2 rounded-lg absolute top-3 left-3 border bg-card">
<Item icon={<Home size={16} />} name="หน้าหลัก" href="/" divide />
+2 -2
View File
@@ -39,7 +39,7 @@ export default function Home() {
name="รับกรรมแทนคนดู"
desc={
<>
รับเล่นคอนเท้น Endgame แทนคนดู{" "}
รับเล่นคอนเทนต์เอนเกมแทนคนดู{" "}
<span className="text-red-500">ไม่ฟรีนะคับ</span>
</>
}
@@ -48,7 +48,7 @@ export default function Home() {
/>
<HomeLink
name="จัดเทียร์ลิสต์อบิส"
desc="ระบบจัดเทียร์ลิสต์ตัวละครของคอนเท้น Abyss และ Stygain"
desc="ระบบจัดเทียร์ลิสต์ตัวละครของคอนเทนต์ Abyss และ Stygian"
href="/tl"
logo={TierlistLogo}
/>
+1 -1
View File
@@ -69,7 +69,7 @@ import { RulesDialog } from "./rules";
export const metadata: Metadata = {
title: "รับกรรมแทนทางบ้าน",
description: "รับเล่นคอนเท้น Endgame เกนชินแทนคนดู",
description: "รับเล่นคอนเทนต์เอนเกมเกนชินแทนคนดู",
};
export default async function EndgamePage() {
+72
View File
@@ -0,0 +1,72 @@
import { desc, eq, not } from "drizzle-orm";
import type { Metadata } from "next";
import Link from "next/link";
import Image from "@/components/image";
import { db } from "@/lib/db";
import { tierlistTypes, tierlistVersions } from "@/lib/db/schema";
export const metadata: Metadata = {
title: "จัดเทียร์ลิสต์",
description: "ระบบจัดเทียร์ลิสต์ตัวละครของคอนเทนต์เอนเกม",
};
export default async function TierlistSelectionPage({
params,
}: { params: Promise<{ type: string }> }) {
const { type: typeId } = await params;
const types = await db
.select()
.from(tierlistTypes)
.where(eq(tierlistTypes.id, typeId));
const versionsList = await db
.select()
.from(tierlistVersions)
.orderBy(desc(tierlistVersions.order))
.where(not(tierlistVersions.hidden));
const vers = types.map((t) => ({
...t,
versions: versionsList.filter((v) => v.type === t.id),
}));
return (
<div className="max-w-7xl min-h-full flex flex-col gap-6 mx-auto py-8 px-4">
{vers.map((t) => (
<div className="flex flex-col gap-1" key={t.id}>
<div className="font-bold text-4xl">
<div className="px-2 py-1 border w-fit rounded-md bg-[#2228]">
{t.name}
<span className="text-sm text-muted-foreground ml-2">
{t.mode}
</span>
</div>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2">
{t.versions.map((e) => (
<Link href={`/tl/${t.id}/${e.id}`} key={e.id}>
{e.image ? (
<div className="relative aspect-video w-full rounded-lg border overflow-hidden">
<Image
src={`/cdn/${e.image}`}
alt={e.name}
fill
className="rounded-sm border object-cover bg-primary"
/>
<div className="flex absolute w-full justify-center bottom-0 py-1 bg-black/50 rounded-b-sm">
{e.name}
</div>
</div>
) : (
<div className="flex items-center justify-center aspect-video w-60 border rounded-sm bg-[#1118] backdrop-blur-xl font-bold text-4xl">
{e.name}
</div>
)}
</Link>
))}
</div>
</div>
))}
</div>
);
}
export const dynamic = "force-dynamic";
+17 -9
View File
@@ -3,6 +3,7 @@ import type { Metadata } from "next";
import Link from "next/link";
import TierlistLogo from "#/logos/tierlist.webp";
import { HorizontalDiv } from "@/components/horizontal";
import { SimpleTooltip } from "@/components/tooltip";
import Image from "@/components/image";
import { ScrollBar } from "@/components/ui/scroll-area";
import { db } from "@/lib/db";
@@ -10,7 +11,7 @@ import { tierlistTypes, tierlistVersions } from "@/lib/db/schema";
export const metadata: Metadata = {
title: "จัดเทียร์ลิสต์",
description: "ระบบจัดเทียร์ลิสต์ตัวละครของคอนเท้นเอนเกม",
description: "ระบบจัดเทียร์ลิสต์ตัวละครของคอนเทนต์เอนเกม",
};
export default async function TierlistSelectionPage() {
@@ -40,14 +41,21 @@ export default async function TierlistSelectionPage() {
</center>
{vers.map((t) => (
<div className="flex flex-col gap-1" key={t.id}>
<div className="font-bold text-4xl">
<div className="px-2 py-1 border w-fit rounded-md bg-[#2228]">
{t.name}
<span className="text-sm text-muted-foreground ml-2">
{t.mode}
</span>
</div>
</div>
<Link href={`/tl/${t.id}`} className="font-bold text-4xl w-fit">
<div className="flex items-center gap-2">
<div className="px-2 py-1 border rounded-md bg-[#2228]">
{t.name}
<span className="text-sm text-muted-foreground ml-2">
{t.mode}
</span>
</div>
<SimpleTooltip text="ดูเทียร์ลิสต์ของคอนเทนต์นี้ทั้งหมด">
<span className="text-sm text-muted-foreground ml-2">
ดูทั้งหมด
</span>
</SimpleTooltip>
</div>
</Link>
<HorizontalDiv>
<div className="flex gap-2 max-w-full">
{t.versions.map((e) => (