Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update password-requirements.tsx

Tim Wilsonb2c8db6622e7
diff --git a/apps/web/ui/shared/password-requirements.tsx b/apps/web/ui/shared/password-requirements.tsx
index 7e613006f0..22c936611a 100644
--- a/apps/web/ui/shared/password-requirements.tsx
+++ b/apps/web/ui/shared/password-requirements.tsx
@@ -21,6 +21,11 @@ const REQUIREMENTS: {
},
];
+/**
+ * Component to display the password requirements and whether they are each met for a password field.
+ *
+ * Note: This component must be used within a FormProvider context.
+ */
export const PasswordRequirements = memo(function PasswordRequirements({
field = "password",
className,
@@ -34,12 +39,12 @@ export const PasswordRequirements = memo(function PasswordRequirements({
const password = useWatch({ name: field });
return (
- <div className={cn("mt-2 flex flex-wrap items-center gap-3", className)}>
+ <ul className={cn("mt-2 flex flex-wrap items-center gap-3", className)}>
{REQUIREMENTS.map(({ name, check }) => {
const checked = password?.length && check(password);
return (
- <div
+ <li
key={name}
className={cn(
"flex items-center gap-1 text-xs text-neutral-400 transition-colors",
@@ -54,9 +59,9 @@ export const PasswordRequirements = memo(function PasswordRequirements({
)}
/>
<span>{name}</span>
- </div>
+ </li>
);
})}
- </div>
+ </ul>
);
});