fix(striker-ui): pass input values to submit append in GateForm
This commit is contained in:
parent
305968e5e9
commit
7f826132a4
@ -96,8 +96,21 @@ const GateForm = forwardRef<GateFormForwardedRefContent, GateFormProps>(
|
|||||||
|
|
||||||
setMessage(MSG_ID_GATE_ACCESS);
|
setMessage(MSG_ID_GATE_ACCESS);
|
||||||
setIsSubmitting(true);
|
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(
|
onSubmitAppend?.call(
|
||||||
null,
|
null,
|
||||||
|
identifierValue,
|
||||||
|
passphraseValue,
|
||||||
(message?) => {
|
(message?) => {
|
||||||
setMessage(MSG_ID_GATE_ACCESS, message);
|
setMessage(MSG_ID_GATE_ACCESS, message);
|
||||||
},
|
},
|
||||||
|
2
striker-ui/types/GateForm.d.ts
vendored
2
striker-ui/types/GateForm.d.ts
vendored
@ -10,6 +10,8 @@ type GateFormMessageSetter = (
|
|||||||
type GateFormSubmittingSetter = (value: boolean) => void;
|
type GateFormSubmittingSetter = (value: boolean) => void;
|
||||||
|
|
||||||
type GateFormSubmitHandler = (
|
type GateFormSubmitHandler = (
|
||||||
|
identifier: string,
|
||||||
|
passphrase: string,
|
||||||
setMessage: GateFormMessageSetter,
|
setMessage: GateFormMessageSetter,
|
||||||
setIsSubmitting: GateFormSubmittingSetter,
|
setIsSubmitting: GateFormSubmittingSetter,
|
||||||
...args: Parameters<DivFormEventHandler>
|
...args: Parameters<DivFormEventHandler>
|
||||||
|
Loading…
Reference in New Issue
Block a user