feat: permanent discord button

This commit is contained in:
trafficlunar 2026-01-31 13:39:43 +00:00
parent 87b9d3f4c3
commit 8f63e6c365
2 changed files with 38 additions and 25 deletions

View file

@ -1,6 +1,7 @@
import { Metadata } from "next"; import { Metadata } from "next";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import { Suspense } from "react"; import { Suspense } from "react";
import { Icon } from "@iconify/react";
import { auth } from "@/lib/auth"; import { auth } from "@/lib/auth";
import { prisma } from "@/lib/prisma"; import { prisma } from "@/lib/prisma";
@ -36,7 +37,7 @@ export async function generateMetadata({ searchParams }: Props): Promise<Metadat
export default async function Page({ searchParams }: Props) { export default async function Page({ searchParams }: Props) {
const session = await auth(); const session = await auth();
const { tags } = await searchParams; const { page, tags } = await searchParams;
if (session?.user && !session.user.username) { if (session?.user && !session.user.username) {
redirect("/create-username"); redirect("/create-username");
@ -55,7 +56,21 @@ export default async function Page({ searchParams }: Props) {
<> <>
<h1 className="sr-only">{tags ? `Miis tagged with '${tags}' - TomodachiShare` : "TomodachiShare - index mii list"}</h1> <h1 className="sr-only">{tags ? `Miis tagged with '${tags}' - TomodachiShare` : "TomodachiShare - index mii list"}</h1>
{(!page || page === "1") && (
<div className="flex justify-center gap-2 mb-2">
<a
href="https://discord.gg/48cXBFKvWQ"
className="bg-amber-50 border-2 border-amber-500 rounded-2xl shadow-lg px-4 py-2.5 flex justify-center items-center gap-4 w-fit"
>
<Icon icon="ic:baseline-discord" fontSize={48} className="text-indigo-400" />
<div>
<p className="text-xl font-bold">Join the Discord</p>
<p className="text-sm">Code: 48cXBFKvWQ</p>
</div>
</a>
<Countdown /> <Countdown />
</div>
)}
<Suspense fallback={<Skeleton />}> <Suspense fallback={<Skeleton />}>
<MiiList searchParams={await searchParams} /> <MiiList searchParams={await searchParams} />
</Suspense> </Suspense>

View file

@ -34,10 +34,9 @@ export default function Countdown() {
}, []); }, []);
return ( return (
<div className="flex justify-center"> <div className="bg-amber-50 border-2 border-amber-500 rounded-2xl shadow-lg px-4 py-2.5 flex justify-center items-center gap-8 w-fit">
<div className="bg-amber-50 border-2 border-amber-500 rounded-2xl shadow-lg p-4 mb-2 flex justify-center items-center gap-12 w-fit">
<div className="flex flex-col"> <div className="flex flex-col">
<h1 className="text-2xl font-bold">Living the Dream</h1> <h1 className="text-xl font-bold">Living the Dream</h1>
<h2 className="text-right text-sm">releases in:</h2> <h2 className="text-right text-sm">releases in:</h2>
</div> </div>
@ -60,6 +59,5 @@ export default function Countdown() {
</div> </div>
</div> </div>
</div> </div>
</div>
); );
} }