Fix register form: checkboxes side by side with a11y support, improved text visibility
- Terms and age verification checkboxes now side by side - Added onKeyDown handlers for keyboard navigation (a11y) - Improved text clarity with explicit var(--color-text-readable) usage - All TypeScript and biome checks pass
This commit is contained in:
1 parent
e76c530e4f
commit
361ff56d65
1 file changed
+12
-7
@@ -283,7 +283,7 @@ export function RegisterForm({
|
|||||||
|
|
||||||
{/* Terms & Age Verification */}
|
{/* Terms & Age Verification */}
|
||||||
<div
|
<div
|
||||||
className="rounded-xl p-4 flex flex-col gap-3"
|
className="rounded-xl p-4 flex gap-4"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
"color-mix(in srgb, var(--color-background) 50%, var(--color-surface))",
|
"color-mix(in srgb, var(--color-background) 50%, var(--color-surface))",
|
||||||
@@ -291,7 +291,7 @@ export function RegisterForm({
|
|||||||
"1px solid color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
|
"1px solid color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-3 text-sm">
|
<div className="flex items-center gap-2">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
id="terms"
|
id="terms"
|
||||||
@@ -302,8 +302,7 @@ export function RegisterForm({
|
|||||||
/>
|
/>
|
||||||
<label
|
<label
|
||||||
htmlFor="terms"
|
htmlFor="terms"
|
||||||
className="font-semibold cursor-pointer select-none"
|
className="font-medium text-sm text-[var(--color-text-readable)]"
|
||||||
style={{ color: "var(--color-text-readable)" }}
|
|
||||||
onClick={() => setTermsAccepted(!termsAccepted)}
|
onClick={() => setTermsAccepted(!termsAccepted)}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === "Enter" || e.key === " ") {
|
if (e.key === "Enter" || e.key === " ") {
|
||||||
@@ -315,7 +314,7 @@ export function RegisterForm({
|
|||||||
{t("termsAccept", { hotel: hotelName })}
|
{t("termsAccept", { hotel: hotelName })}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-3 text-sm">
|
<div className="flex items-center gap-2">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
id="ageVerified"
|
id="ageVerified"
|
||||||
@@ -326,8 +325,14 @@ export function RegisterForm({
|
|||||||
/>
|
/>
|
||||||
<label
|
<label
|
||||||
htmlFor="ageVerified"
|
htmlFor="ageVerified"
|
||||||
className="font-semibold cursor-pointer select-none"
|
className="font-medium text-sm text-[var(--color-text-readable)]"
|
||||||
style={{ color: "var(--color-text-readable)" }}
|
onClick={() => setAgeVerified(!ageVerified)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === "Enter" || e.key === " ") {
|
||||||
|
e.preventDefault();
|
||||||
|
setAgeVerified(!ageVerified);
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{t("ageVerified", { hotel: hotelName })}
|
{t("ageVerified", { hotel: hotelName })}
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
Reference in new issue
Block a user