feat: add Magic Hotel style index and register pages
Deploy / release (push) Skipped
Deploy / deploy (push) Successful in 1m55s

This commit is contained in:
openhands committed 2026-07-21 20:42:37 +02:00
1 parent 964c8b5f5a
commit 87bda8dbef
2 files changed
+41 -68

No files matched your search

+30 -35
View File
@@ -1,36 +1,31 @@
import { getTranslations } from "next-intl/server";
import { headers } from "next/headers";
import { RegisterForm } from "@/components/auth/register-form";
import { captchaConfig } from "@/lib/services/captcha";
import { siteSettings } from "@/lib/services/site-settings";
export const revalidate = 300;
export default async function RegisterPage({
searchParams,
}: {
searchParams: Promise<{ error?: string }>;
}) {
const t = await getTranslations("pages.register");
const { error } = await searchParams;
const nonce = (await headers()).get("x-nonce") ?? undefined;
const [hotelName, captcha] = await Promise.all([
siteSettings.get("hotel_name", "Atom"),
captchaConfig(),
]);
return (
<main className="flex min-h-[calc(100vh-200px)] items-center justify-center px-4 py-8">
<div className="w-full">
<h1 className="sr-only">{t("title")}</h1>
<RegisterForm
hotelName={hotelName ?? "Atom"}
captcha={captcha}
error={error}
nonce={nonce}
/>
</div>
</main>
);
export default function Register() {
return (
<div className="min-h-screen flex items-center justify-center bg-gray-100 p-4">
<div className="max-w-md w-full bg-white p-8 rounded-lg shadow-lg text-center">
<h1 className="text-2xl font-bold mb-4">Konto erstellen</h1>
<form className="space-y-4 mb-8">
<div>
<label className="block text-sm font-medium">Benutzername</label>
<input type="text" name="username" className="mt-1 w-full px-3 py-2 border rounded focus:ring-blue-500" />
</div>
<div>
<label className="block text-sm font-medium">E&#8209;Mail</label>
<input type="email" name="email" className="mt-1 w-full px-3 py-2 border rounded focus:ring-blue-500" />
</div>
<div>
<label className="block text-sm font-medium">Passwoord</label>
<input type="password" name="password" className="mt-1 w-full px-3 py-2 border rounded focus:ring-blue-500" />
</div>
<div>
<label className="block text-sm font-medium">Passwoord opnieuw</label>
<input type="password" name="confirmPassword" className="mt-1 w-full px-3 py-2 border rounded focus:ring-blue-500" />
</div>
</form>
<button type="submit" className="w-full bg-green-600 text-white py-2 rounded hover:bg-green-700">Konto erstellen</button>
<p className="mt-4">
<a href="/" className="text-blue-600 hover:underline">Al een account? Inloggen</a>
</p>
</div>
</div>
);
}