Added dumby pages

This commit is contained in:
2025-09-08 23:52:53 +02:00
parent 96345d888f
commit 77bda4ea1f
8 changed files with 146 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
"use client"
import { usePathname } from "next/navigation"
export function AchievementsPageLoadText() {
const path = usePathname()
return <p>{`Loading achievemnts for ${path.split("/").at(-1)}`}</p>
}

View File

@@ -0,0 +1,39 @@
import { env } from "@/lib/env/server"
import { Loader2Icon, ShieldAlert } from "lucide-react"
import { Suspense } from "react"
import { AchievementsPageLoadText } from "./_client"
export default function AchievementsPage({ params }: PageProps<"/achievements/[ign]">) {
const maintenance = env.MAINTENANCE_MODE
if (maintenance) {
return (
<div className="flex flex-col gap-2 justify-center items-center h-screen">
<ShieldAlert className="size-30" />
<h1 className="text-xl">Not available right now. This is just so I could have a front page for Hypixel Production API Key.</h1>
</div>
)
}
return (
<Suspense
fallback={
<div className="flex flex-col justify-center items-center h-screen">
<Loader2Icon className="animate-spin size-30" />
<AchievementsPageLoadText />
</div>
}
>
<SuspendedPage params={params} />
</Suspense>
)
}
async function SuspendedPage({ params }: Pick<PageProps<"/achievements/[ign]">, "params">) {
const { ign } = await params
return (
<div className="flex flex-col items-center pb-5 pt-35">
{ign}
</div>
)
}

View File

@@ -0,0 +1,9 @@
"use client"
import { usePathname } from "next/navigation"
export function GuildPageLoadText() {
const path = usePathname()
return <p>{`Loading guild stats for ${path.split("/").at(-1)}`}</p>
}

View File

@@ -0,0 +1,39 @@
import { env } from "@/lib/env/server"
import { Loader2Icon, ShieldAlert } from "lucide-react"
import { Suspense } from "react"
import { GuildPageLoadText } from "./_client"
export default function GuildPage({ params }: PageProps<"/guild/[value]">) {
const maintenance = env.MAINTENANCE_MODE
if (maintenance) {
return (
<div className="flex flex-col gap-2 justify-center items-center h-screen">
<ShieldAlert className="size-30" />
<h1 className="text-xl">Not available right now. This is just so I could have a front page for Hypixel Production API Key.</h1>
</div>
)
}
return (
<Suspense
fallback={
<div className="flex flex-col justify-center items-center h-screen">
<Loader2Icon className="animate-spin size-30" />
<GuildPageLoadText />
</div>
}
>
<SuspendedPage params={params} />
</Suspense>
)
}
async function SuspendedPage({ params }: Pick<PageProps<"/guild/[value]">, "params">) {
const { value } = await params
return (
<div className="flex flex-col items-center pb-5 pt-35">
{value}
</div>
)
}

View File

@@ -38,7 +38,7 @@ function SocialIcon({ href, children }: { href?: string, children: React.ReactNo
return (
<Button variant="ghost" className="transition-all hover:scale-125" asChild>
<Link href={href}>
<Link href={new URL(href)}>
{children}
</Link>
</Button>

View File

@@ -0,0 +1,9 @@
"use client"
import { usePathname } from "next/navigation"
export function QuestPageLoadText() {
const path = usePathname()
return <p>{`Loading quests for ${path.split("/").at(-1)}`}</p>
}

View File

@@ -0,0 +1,39 @@
import { env } from "@/lib/env/server"
import { Loader2Icon, ShieldAlert } from "lucide-react"
import { Suspense } from "react"
import { QuestPageLoadText } from "./_client"
export default function QuestsPage({ params }: PageProps<"/quests/[ign]">) {
const maintenance = env.MAINTENANCE_MODE
if (maintenance) {
return (
<div className="flex flex-col gap-2 justify-center items-center h-screen">
<ShieldAlert className="size-30" />
<h1 className="text-xl">Not available right now. This is just so I could have a front page for Hypixel Production API Key.</h1>
</div>
)
}
return (
<Suspense
fallback={
<div className="flex flex-col justify-center items-center h-screen">
<Loader2Icon className="animate-spin size-30" />
<QuestPageLoadText />
</div>
}
>
<SuspendedPage params={params} />
</Suspense>
)
}
async function SuspendedPage({ params }: Pick<PageProps<"/quests/[ign]">, "params">) {
const { ign } = await params
return (
<div className="flex flex-col items-center pb-5 pt-35">
{ign}
</div>
)
}