From 87d28dafa4a7393f4f9d32ff2d841fc57c826684 Mon Sep 17 00:00:00 2001 From: Jonas Hungershausen Date: Tue, 29 Oct 2024 15:11:26 +0100 Subject: [PATCH] fix: duplicate resend button on recovery & verification (#254) --- .../src/components/form/nodes/input.tsx | 2 +- .../components/form/pin-code-input.tsx | 34 ++++++++----------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/packages/elements-react/src/components/form/nodes/input.tsx b/packages/elements-react/src/components/form/nodes/input.tsx index e0c88ecdc..cf5d8ffdc 100644 --- a/packages/elements-react/src/components/form/nodes/input.tsx +++ b/packages/elements-react/src/components/form/nodes/input.tsx @@ -65,7 +65,7 @@ export const NodeInput = ({ const isPinCodeInput = (attrs.name === "code" && node.group === "code") || (attrs.name === "totp_code" && node.group === "totp") - const isResend = attrs.name === "resend" && node.group === "code" + const isResend = node.meta.label?.id === 1070008 switch (nodeType) { case UiNodeInputAttributesTypeEnum.Submit: diff --git a/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx b/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx index 45b5b417b..316d2a183 100644 --- a/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx +++ b/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx @@ -18,25 +18,21 @@ export const DefaultPinCodeInput = ({ attributes }: OryNodeInputProps) => { const value = watch(name) return ( -
- - - {[...Array(elements)].map((_, index) => ( - - ))} - - -
+ + {[...Array(elements)].map((_, index) => ( + + ))} + + ) }