diff --git a/next.config.ts b/next.config.ts index ab1939e..2e7eff9 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,6 +2,7 @@ import type { NextConfig } from "next" const nextConfig: NextConfig = { output: process.env.DOCKER === "1" ? "standalone" : undefined, + typedRoutes: true, eslint: { ignoreDuringBuilds: true }, diff --git a/src/app/(stats)/achievements/[ign]/_client.tsx b/src/app/(stats)/achievements/[ign]/_client.tsx new file mode 100644 index 0000000..3e26a5c --- /dev/null +++ b/src/app/(stats)/achievements/[ign]/_client.tsx @@ -0,0 +1,9 @@ +"use client" + +import { usePathname } from "next/navigation" + +export function AchievementsPageLoadText() { + const path = usePathname() + + return

{`Loading achievemnts for ${path.split("/").at(-1)}`}

+} diff --git a/src/app/(stats)/achievements/[ign]/page.tsx b/src/app/(stats)/achievements/[ign]/page.tsx new file mode 100644 index 0000000..425c24b --- /dev/null +++ b/src/app/(stats)/achievements/[ign]/page.tsx @@ -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 ( +
+ +

Not available right now. This is just so I could have a front page for Hypixel Production API Key.

+
+ ) + } + + return ( + + + + + } + > + + + ) +} + +async function SuspendedPage({ params }: Pick, "params">) { + const { ign } = await params + return ( +
+ {ign} +
+ ) +} diff --git a/src/app/(stats)/guild/[value]/_client.tsx b/src/app/(stats)/guild/[value]/_client.tsx new file mode 100644 index 0000000..139bfb8 --- /dev/null +++ b/src/app/(stats)/guild/[value]/_client.tsx @@ -0,0 +1,9 @@ +"use client" + +import { usePathname } from "next/navigation" + +export function GuildPageLoadText() { + const path = usePathname() + + return

{`Loading guild stats for ${path.split("/").at(-1)}`}

+} diff --git a/src/app/(stats)/guild/[value]/page.tsx b/src/app/(stats)/guild/[value]/page.tsx new file mode 100644 index 0000000..ec01c40 --- /dev/null +++ b/src/app/(stats)/guild/[value]/page.tsx @@ -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 ( +
+ +

Not available right now. This is just so I could have a front page for Hypixel Production API Key.

+
+ ) + } + + return ( + + + + + } + > + + + ) +} + +async function SuspendedPage({ params }: Pick, "params">) { + const { value } = await params + return ( +
+ {value} +
+ ) +} diff --git a/src/app/(stats)/player/[ign]/_components/SocialIcons.tsx b/src/app/(stats)/player/[ign]/_components/SocialIcons.tsx index 6d3845e..b2f71ce 100644 --- a/src/app/(stats)/player/[ign]/_components/SocialIcons.tsx +++ b/src/app/(stats)/player/[ign]/_components/SocialIcons.tsx @@ -38,7 +38,7 @@ function SocialIcon({ href, children }: { href?: string, children: React.ReactNo return ( diff --git a/src/app/(stats)/quests/[ign]/_client.tsx b/src/app/(stats)/quests/[ign]/_client.tsx new file mode 100644 index 0000000..a6c1d76 --- /dev/null +++ b/src/app/(stats)/quests/[ign]/_client.tsx @@ -0,0 +1,9 @@ +"use client" + +import { usePathname } from "next/navigation" + +export function QuestPageLoadText() { + const path = usePathname() + + return

{`Loading quests for ${path.split("/").at(-1)}`}

+} diff --git a/src/app/(stats)/quests/[ign]/page.tsx b/src/app/(stats)/quests/[ign]/page.tsx new file mode 100644 index 0000000..9ca2940 --- /dev/null +++ b/src/app/(stats)/quests/[ign]/page.tsx @@ -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 ( +
+ +

Not available right now. This is just so I could have a front page for Hypixel Production API Key.

+
+ ) + } + + return ( + + + + + } + > + + + ) +} + +async function SuspendedPage({ params }: Pick, "params">) { + const { ign } = await params + return ( +
+ {ign} +
+ ) +}