diff --git a/app/sticker/[code]/route.ts b/app/sticker/[code]/route.ts new file mode 100644 index 0000000..661521e --- /dev/null +++ b/app/sticker/[code]/route.ts @@ -0,0 +1,19 @@ +import { redirect, notFound } from "next/navigation"; +import { NextRequest } from "next/server"; +import { resolveAndTrackRedirect } from "../../lib/payload"; + +// Legacy sticker QR codes already printed as https://einfach-produktiv.com/sticker/ +// before the /r/[code] short-link scheme existed — can't be reprinted, so +// this mirrors app/r/[code]/route.ts's exact lookup (same Redirects +// collection, matched by `code`) under the fixed /sticker prefix instead. +// Keeps a single admin-editable/toggleable source of truth for both. +export async function GET(_request: NextRequest, { params }: { params: Promise<{ code: string }> }) { + const { code } = await params; + const targetPath = await resolveAndTrackRedirect(code); + + if (!targetPath || !targetPath.startsWith("/") || targetPath.startsWith("//")) { + notFound(); + } + + redirect(targetPath); +} diff --git a/app/sticker/page.tsx b/app/sticker/page.tsx new file mode 100644 index 0000000..14cb21e --- /dev/null +++ b/app/sticker/page.tsx @@ -0,0 +1,59 @@ +import type { Metadata } from "next"; +import Link from "next/link"; +import { Reveal } from "../components/Reveal"; +import { Footer } from "../components/Footer"; +import { TrustRow } from "../components/TrustRow"; + +// Placeholder landing page for the /sticker/[code] QR redirects (see that +// route) — targetPath for those Redirects docs currently points here until +// a dedicated campaign page exists; swap targetPath in Payload once it does. +export const metadata: Metadata = { + title: "Schön, dass du da bist", + description: "Du hast einen einfach produktiv Sticker gescannt.", +}; + +export default function StickerPage() { + return ( + <> +
+ +
+ +
+

+ Schön, dass du da bist! +

+

+ Du hast einen unserer Sticker entdeckt. +

+
+ +
+

Hallo,

+

+ schön, dass dich der Sticker hierher geführt hat. Schau dich gerne um – hier + findest du alles, was einfach produktiv ausmacht. +

+
+ + + Jetzt stöbern + + + +
+