fix(striker-ui): pass input values to submit append in GateForm

This commit is contained in:
Tsu-ba-me 2023-04-06 13:19:02 -04:00
parent 305968e5e9
commit 7f826132a4
2 changed files with 15 additions and 0 deletions

View File

@ -96,8 +96,21 @@ const GateForm = forwardRef<GateFormForwardedRefContent, GateFormProps>(
setMessage(MSG_ID_GATE_ACCESS);
setIsSubmitting(true);
const { target } = event;
const { elements } = target as HTMLFormElement;
const { value: identifierValue } = elements.namedItem(
INPUT_ID_GATE_ID,
) as HTMLInputElement;
const { value: passphraseValue } = elements.namedItem(
INPUT_ID_GATE_PASSPHRASE,
) as HTMLInputElement;
onSubmitAppend?.call(
null,
identifierValue,
passphraseValue,
(message?) => {
setMessage(MSG_ID_GATE_ACCESS, message);
},

View File

@ -10,6 +10,8 @@ type GateFormMessageSetter = (
type GateFormSubmittingSetter = (value: boolean) => void;
type GateFormSubmitHandler = (
identifier: string,
passphrase: string,
setMessage: GateFormMessageSetter,
setIsSubmitting: GateFormSubmittingSetter,
...args: Parameters<DivFormEventHandler>