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

main
Tsu-ba-me 2 years ago
parent 305968e5e9
commit 7f826132a4
  1. 13
      striker-ui/components/GateForm.tsx
  2. 2
      striker-ui/types/GateForm.d.ts

@ -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);
},

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

Loading…
Cancel
Save