mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-21 18:27:53 +02:00
✨ New Login Page (#1504)
This commit is contained in:
parent
655f38203a
commit
f5ab25ed1f
67 changed files with 1669 additions and 713 deletions
30
apps/web/src/components/input-otp.tsx
Normal file
30
apps/web/src/components/input-otp.tsx
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { Input } from "@rallly/ui/input";
|
||||
import React from "react";
|
||||
|
||||
const InputOTP = React.forwardRef<
|
||||
HTMLInputElement,
|
||||
React.ComponentProps<typeof Input> & { onValidCode?: (code: string) => void }
|
||||
>(({ onValidCode, onChange, ...rest }, ref) => {
|
||||
return (
|
||||
<Input
|
||||
ref={ref}
|
||||
{...rest}
|
||||
onChange={(e) => {
|
||||
onChange?.(e);
|
||||
|
||||
if (e.target.value.length === 6) {
|
||||
onValidCode?.(e.target.value);
|
||||
}
|
||||
}}
|
||||
maxLength={6}
|
||||
data-1p-ignore
|
||||
inputMode="numeric"
|
||||
autoComplete="one-time-code"
|
||||
pattern="\d{6}"
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
InputOTP.displayName = "InputOTP";
|
||||
|
||||
export { InputOTP };
|
Loading…
Add table
Add a link
Reference in a new issue