From 0f7e98740d9f4e7d4c645d004ea88a91d6db7f9b Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Wed, 21 May 2025 20:53:23 +0500 Subject: [PATCH 1/5] add verify button --- src/components/MagicCodeInput.tsx | 6 +----- .../ValidateCodeForm/BaseValidateCodeForm.tsx | 5 ----- .../BaseOnboardingPrivateDomain.tsx | 14 +++----------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/components/MagicCodeInput.tsx b/src/components/MagicCodeInput.tsx index e989e515c62b..6487530be7d0 100644 --- a/src/components/MagicCodeInput.tsx +++ b/src/components/MagicCodeInput.tsx @@ -57,9 +57,6 @@ type MagicCodeInputProps = { /** TestID for test */ testID?: string; - - /** Whether to allow auto submit again after the previous attempt fails */ - allowResubmit?: boolean; }; type MagicCodeInputHandle = { @@ -108,7 +105,6 @@ function MagicCodeInput( autoComplete, hasError = false, testID = '', - allowResubmit = false, }: MagicCodeInputProps, ref: ForwardedRef, ) { @@ -179,7 +175,7 @@ function MagicCodeInput( const validateAndSubmit = () => { const numbers = decomposeString(value, maxLength); // eslint-disable-next-line @typescript-eslint/no-use-before-define - if ((wasSubmitted && !allowResubmit) || !shouldSubmitOnComplete || numbers.filter((n) => isNumeric(n)).length !== maxLength || isOffline) { + if (wasSubmitted || !shouldSubmitOnComplete || numbers.filter((n) => isNumeric(n)).length !== maxLength || isOffline) { return; } if (!wasSubmitted) { diff --git a/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx b/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx index 8628fc19ab06..56329a501ea2 100644 --- a/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx +++ b/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx @@ -80,9 +80,6 @@ type ValidateCodeFormProps = { /** Whether the form is loading or not */ isLoading?: boolean; - /** Whether to allow auto submit again after the previous attempt fails */ - allowResubmit?: boolean; - /** Whether to show skip button */ shouldShowSkipButton?: boolean; @@ -104,7 +101,6 @@ function BaseValidateCodeForm({ hideSubmitButton, submitButtonText, isLoading, - allowResubmit, shouldShowSkipButton = false, handleSkipButtonPress, }: ValidateCodeFormProps) { @@ -271,7 +267,6 @@ function BaseValidateCodeForm({ hasError={canShowError && !isEmptyObject(finalValidateError)} onFulfill={validateAndSubmitForm} autoFocus={false} - allowResubmit={allowResubmit} /> {shouldShowTimer && ( diff --git a/src/pages/OnboardingPrivateDomain/BaseOnboardingPrivateDomain.tsx b/src/pages/OnboardingPrivateDomain/BaseOnboardingPrivateDomain.tsx index be15bf44326a..320200600100 100644 --- a/src/pages/OnboardingPrivateDomain/BaseOnboardingPrivateDomain.tsx +++ b/src/pages/OnboardingPrivateDomain/BaseOnboardingPrivateDomain.tsx @@ -1,7 +1,6 @@ import React, {useCallback, useEffect, useState} from 'react'; import {View} from 'react-native'; import {useOnyx} from 'react-native-onyx'; -import Button from '@components/Button'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import ScreenWrapper from '@components/ScreenWrapper'; import Text from '@components/Text'; @@ -85,19 +84,12 @@ function BaseOnboardingPrivateDomain({shouldUseNativeStyles, route}: BaseOnboard setHasMagicCodeBeenSent(true); }} clearError={() => clearGetAccessiblePoliciesErrors()} - hideSubmitButton validateError={getAccessiblePoliciesAction?.errors} hasMagicCodeBeenSent={hasMagicCodeBeenSent} - allowResubmit - /> - - -