1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-30 16:17:41 +01:00

autocompletion

This commit is contained in:
mrjvs 2023-11-22 17:00:14 +01:00
parent f3146b9a00
commit 2def74cb32
4 changed files with 41 additions and 25 deletions

View file

@ -3,6 +3,8 @@ import { TextInputControl } from "./TextInputControl";
export function AuthInputBox(props: { export function AuthInputBox(props: {
value?: string; value?: string;
label?: string; label?: string;
name?: string;
autoComplete?: string;
placeholder?: string; placeholder?: string;
onChange?: (data: string) => void; onChange?: (data: string) => void;
}) { }) {
@ -12,7 +14,9 @@ export function AuthInputBox(props: {
<p className="font-bold text-white">{props.label}</p> <p className="font-bold text-white">{props.label}</p>
) : null} ) : null}
<TextInputControl <TextInputControl
name={props.name}
value={props.value} value={props.value}
autoComplete={props.autoComplete}
onChange={props.onChange} onChange={props.onChange}
placeholder={props.placeholder} placeholder={props.placeholder}
className="w-full flex-1 bg-authentication-inputBg px-4 py-3 text-search-text focus:outline-none rounded-lg placeholder:text-gray-700" className="w-full flex-1 bg-authentication-inputBg px-4 py-3 text-search-text focus:outline-none rounded-lg placeholder:text-gray-700"

View file

@ -3,6 +3,8 @@ export interface TextInputControlPropsNoLabel {
onUnFocus?: () => void; onUnFocus?: () => void;
onFocus?: () => void; onFocus?: () => void;
value?: string; value?: string;
name?: string;
autoComplete?: string;
placeholder?: string; placeholder?: string;
className?: string; className?: string;
} }
@ -16,6 +18,8 @@ export function TextInputControl({
onUnFocus, onUnFocus,
value, value,
label, label,
name,
autoComplete,
className, className,
placeholder, placeholder,
onFocus, onFocus,
@ -27,6 +31,8 @@ export function TextInputControl({
placeholder={placeholder} placeholder={placeholder}
onChange={(e) => onChange && onChange(e.target.value)} onChange={(e) => onChange && onChange(e.target.value)}
value={value} value={value}
name={name}
autoComplete={autoComplete}
onBlur={() => onUnFocus && onUnFocus()} onBlur={() => onUnFocus && onUnFocus()}
onFocus={() => onFocus?.()} onFocus={() => onFocus?.()}
/> />

View file

@ -58,6 +58,8 @@ export function LoginFormPart(props: LoginFormPartProps) {
<AuthInputBox <AuthInputBox
label="12-Word Passphrase" label="12-Word Passphrase"
value={mnemonic} value={mnemonic}
autoComplete="username"
name="username"
onChange={setMnemonic} onChange={setMnemonic}
placeholder="Passphrase" placeholder="Passphrase"
/> />

View file

@ -82,6 +82,7 @@ export function VerifyPassphrase(props: VerifyPassphraseProps) {
return ( return (
<LargeCard> <LargeCard>
<form>
<LargeCardText <LargeCardText
icon={<Icon icon={Icons.CIRCLE_CHECK} />} icon={<Icon icon={Icons.CIRCLE_CHECK} />}
title="Enter your passphrase" title="Enter your passphrase"
@ -91,6 +92,8 @@ export function VerifyPassphrase(props: VerifyPassphraseProps) {
</LargeCardText> </LargeCardText>
<AuthInputBox <AuthInputBox
label="Your passphrase" label="Your passphrase"
autoComplete="username"
name="username"
value={mnemonic} value={mnemonic}
onChange={setMnemonic} onChange={setMnemonic}
/> />
@ -108,6 +111,7 @@ export function VerifyPassphrase(props: VerifyPassphraseProps) {
Register Register
</Button> </Button>
</LargeCardButtons> </LargeCardButtons>
</form>
</LargeCard> </LargeCard>
); );
} }