Remove outfit selection from register form and fix terms checkbox not toggling
This commit is contained in:
1 parent
4ba26fd814
commit
7412bd2dda
4 files changed
+5
-43
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
@@ -13,26 +13,16 @@ export default async function RegisterPage({
|
|||||||
const t = await getTranslations("pages.register");
|
const t = await getTranslations("pages.register");
|
||||||
const { error } = await searchParams;
|
const { error } = await searchParams;
|
||||||
|
|
||||||
const [hotelName, imager, captcha, femaleFigures, maleFigures] = await Promise.all([
|
const [hotelName, captcha] = await Promise.all([
|
||||||
siteSettings.get("hotel_name", "Atom"),
|
siteSettings.get("hotel_name", "Atom"),
|
||||||
siteSettings.get("habbo_imaging_url", "https://www.habbo.com/habbo-imaging/avatarimage"),
|
|
||||||
captchaConfig(),
|
captchaConfig(),
|
||||||
siteSettings.get("register_female_figures", "hr-100-45.hd-180-1.ch-215-62.lg-270-62.sh-290-62,hr-130-45.hd-180-2.ch-220-62.lg-280-62.sh-305-62,hr-140-45.hd-180-3.ch-225-62.lg-270-62.sh-310-62,hr-165-45.hd-180-1.ch-210-62.lg-270-62.sh-290-62,hr-190-45.hd-180-2.ch-215-62.lg-270-62.sh-305-62"),
|
|
||||||
siteSettings.get("register_male_figures", "hr-100-61.hd-180-1.ch-210-66.lg-270-110.sh-305-62,hr-105-61.hd-190-2.ch-215-66.lg-280-110.sh-310-62,hr-110-61.hd-200-3.ch-220-66.lg-290-110.sh-320-62,hr-115-61.hd-185-1.ch-210-66.lg-275-110.sh-315-62,hr-120-61.hd-180-2.ch-205-66.lg-285-110.sh-305-62"),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const allFigures = [
|
|
||||||
...(femaleFigures?.split(",").filter(Boolean) || []),
|
|
||||||
...(maleFigures?.split(",").filter(Boolean) || []),
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="flex min-h-[calc(100vh-200px)] items-center justify-center px-4 py-8">
|
<main className="flex min-h-[calc(100vh-200px)] items-center justify-center px-4 py-8">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<h1 className="sr-only">{t("title")}</h1>
|
<h1 className="sr-only">{t("title")}</h1>
|
||||||
<RegisterForm
|
<RegisterForm
|
||||||
initialFigures={allFigures}
|
|
||||||
imager={imager ?? ""}
|
|
||||||
hotelName={hotelName ?? "Atom"}
|
hotelName={hotelName ?? "Atom"}
|
||||||
captcha={captcha}
|
captcha={captcha}
|
||||||
error={error}
|
error={error}
|
||||||
|
|||||||
@@ -1,22 +1,17 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useActionState, ChangeEvent } from "react";
|
import { useActionState } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { register } from "@/actions/register";
|
import { register } from "@/actions/register";
|
||||||
import { AvatarCarousel } from "@/components/auth/avatar-carousel";
|
|
||||||
|
|
||||||
interface RegisterFormProps {
|
interface RegisterFormProps {
|
||||||
initialFigures: string[];
|
|
||||||
imager: string;
|
|
||||||
hotelName: string;
|
hotelName: string;
|
||||||
captcha: { provider: string; siteKey?: string };
|
captcha: { provider: string; siteKey?: string };
|
||||||
error?: string;
|
error?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function RegisterForm({
|
export function RegisterForm({
|
||||||
initialFigures,
|
|
||||||
imager,
|
|
||||||
hotelName,
|
hotelName,
|
||||||
captcha,
|
captcha,
|
||||||
error,
|
error,
|
||||||
@@ -63,9 +58,6 @@ export function RegisterForm({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Avatar hidden input */}
|
|
||||||
<input type="hidden" name="look" defaultValue={initialFigures[0] || ""} />
|
|
||||||
|
|
||||||
{/* Username & Email */}
|
{/* Username & Email */}
|
||||||
<div className="w-full flex flex-col md:flex-row gap-4">
|
<div className="w-full flex flex-col md:flex-row gap-4">
|
||||||
<div className="w-full md:w-1/2">
|
<div className="w-full md:w-1/2">
|
||||||
@@ -158,24 +150,6 @@ export function RegisterForm({
|
|||||||
</div>
|
</div>
|
||||||
</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 */}
|
{/* Terms */}
|
||||||
<div className="rounded-md p-3 flex flex-col gap-3" style={{
|
<div className="rounded-md p-3 flex flex-col gap-3" style={{
|
||||||
backgroundColor: "color-mix(in srgb, var(--color-background) 50%, var(--color-surface))",
|
backgroundColor: "color-mix(in srgb, var(--color-background) 50%, var(--color-surface))",
|
||||||
@@ -185,14 +159,12 @@ export function RegisterForm({
|
|||||||
id="terms"
|
id="terms"
|
||||||
name="terms"
|
name="terms"
|
||||||
type="checkbox"
|
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)" }}
|
style={{ borderColor: "color-mix(in srgb, var(--color-text-muted) 30%, transparent)" }}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<label htmlFor="terms" className="font-semibold" style={{ color: "var(--color-text)" }}>
|
<label htmlFor="terms" className="font-semibold cursor-pointer" 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 })}
|
{t("termsAccept", { hotel: hotelName })}
|
||||||
</a>
|
|
||||||
</label>
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { prisma } from "@/lib/prisma";
|
|||||||
// so the app still renders (e.g. local dev without a DATABASE_URL).
|
// so the app still renders (e.g. local dev without a DATABASE_URL).
|
||||||
const DEFAULTS: Record<string, string> = {
|
const DEFAULTS: Record<string, string> = {
|
||||||
hotel_name: "Atom",
|
hotel_name: "Atom",
|
||||||
habbo_imaging_url: "https://epicnabbo.nl/imaging/",
|
habbo_imaging_url: "https://www.habbo.com/habbo-imaging/avatarimage",
|
||||||
logo_url: "",
|
logo_url: "",
|
||||||
nitro_client_url: "",
|
nitro_client_url: "",
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user