Remove outfit selection from register form and fix terms checkbox not toggling

This commit is contained in:
openhands committed 2026-07-07 18:53:13 +02:00
1 parent 4ba26fd814
commit 7412bd2dda
4 files changed
+6 -44

No files matched your search

+4 -32
View File
@@ -1,22 +1,17 @@
"use client";
import { useActionState, ChangeEvent } from "react";
import { useActionState } from "react";
import Link from "next/link";
import { useTranslations } from "next-intl";
import { register } from "@/actions/register";
import { AvatarCarousel } from "@/components/auth/avatar-carousel";
interface RegisterFormProps {
initialFigures: string[];
imager: string;
hotelName: string;
captcha: { provider: string; siteKey?: string };
error?: string;
}
export function RegisterForm({
initialFigures,
imager,
hotelName,
captcha,
error,
@@ -63,9 +58,6 @@ export function RegisterForm({
</div>
)}
{/* Avatar hidden input */}
<input type="hidden" name="look" defaultValue={initialFigures[0] || ""} />
{/* Username & Email */}
<div className="w-full flex flex-col md:flex-row gap-4">
<div className="w-full md:w-1/2">
@@ -158,24 +150,6 @@ export function RegisterForm({
</div>
</div>
{/* Avatar Selection */}
<div className="w-full rounded-md p-4" style={{
backgroundColor: "color-mix(in srgb, var(--color-background) 50%, var(--color-surface))",
border: "1px solid color-mix(in srgb, var(--color-text-muted) 15%, transparent)",
}}>
<legend className="text-sm font-semibold mb-3" style={{ color: "var(--color-text)" }}>
{t("selectOutfit")}
</legend>
<AvatarCarousel
figures={initialFigures}
imager={imager}
onSelect={(figure) => {
const input = document.querySelector<HTMLInputElement>('input[name="look"]');
if (input) input.value = figure;
}}
/>
</div>
{/* Terms */}
<div className="rounded-md p-3 flex flex-col gap-3" style={{
backgroundColor: "color-mix(in srgb, var(--color-background) 50%, var(--color-surface))",
@@ -185,14 +159,12 @@ export function RegisterForm({
id="terms"
name="terms"
type="checkbox"
className="w-4 h-4 border-gray-300 rounded focus:ring-0"
className="w-4 h-4 border-gray-300 rounded focus:ring-0 shrink-0"
style={{ borderColor: "color-mix(in srgb, var(--color-text-muted) 30%, transparent)" }}
required
/>
<label htmlFor="terms" className="font-semibold" style={{ color: "var(--color-text)" }}>
<a href="/help-center/rules" target="_blank" rel="noopener noreferrer" className="hover:underline" style={{ color: "var(--color-text)" }}>
{t("termsAccept", { hotel: hotelName })}
</a>
<label htmlFor="terms" className="font-semibold cursor-pointer" style={{ color: "var(--color-text)" }}>
{t("termsAccept", { hotel: hotelName })}
</label>
</fieldset>
</div>