mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-03-28 11:13:16 +00:00
feat: permanent discord button
This commit is contained in:
parent
87b9d3f4c3
commit
8f63e6c365
2 changed files with 38 additions and 25 deletions
|
|
@ -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>
|
||||||
|
|
||||||
<Countdown />
|
{(!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 />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<Suspense fallback={<Skeleton />}>
|
<Suspense fallback={<Skeleton />}>
|
||||||
<MiiList searchParams={await searchParams} />
|
<MiiList searchParams={await searchParams} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|
|
||||||
|
|
@ -34,30 +34,28 @@ 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-xl font-bold">Living the Dream</h1>
|
||||||
<h1 className="text-2xl 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>
|
|
||||||
|
|
||||||
<div className="flex gap-4">
|
<div className="flex gap-4">
|
||||||
<div className="flex flex-col text-center">
|
<div className="flex flex-col text-center">
|
||||||
<span className="text-2xl font-semibold">{days}</span>
|
<span className="text-2xl font-semibold">{days}</span>
|
||||||
<span className="text-xs">days</span>
|
<span className="text-xs">days</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col text-center">
|
<div className="flex flex-col text-center">
|
||||||
<span className="text-2xl font-semibold">{hours}</span>
|
<span className="text-2xl font-semibold">{hours}</span>
|
||||||
<span className="text-xs">hours</span>
|
<span className="text-xs">hours</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col text-center">
|
<div className="flex flex-col text-center">
|
||||||
<span className="text-2xl font-semibold">{minutes}</span>
|
<span className="text-2xl font-semibold">{minutes}</span>
|
||||||
<span className="text-xs">minutes</span>
|
<span className="text-xs">minutes</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col text-center">
|
<div className="flex flex-col text-center">
|
||||||
<span className="text-2xl font-semibold">{seconds}</span>
|
<span className="text-2xl font-semibold">{seconds}</span>
|
||||||
<span className="text-xs">seconds</span>
|
<span className="text-xs">seconds</span>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue