Skip to content

Commit

Permalink
Remove english based verifications
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcaires committed Oct 21, 2024
1 parent 07cebb7 commit 63da307
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useIsEnglishLocale } from '@automattic/i18n-utils';
import { NextButton } from '@automattic/onboarding';
import { useTranslate } from 'i18n-calypso';
import { FC } from 'react';
Expand All @@ -21,14 +20,13 @@ interface CredentialsFormProps {

export const CredentialsForm: FC< CredentialsFormProps > = ( { onSubmit, onSkip } ) => {
const translate = useTranslate();
const isEnglishLocale = useIsEnglishLocale();
const { control, errors, accessMethod, isBusy, submitHandler, canBypassVerification } =
useCredentialsForm( onSubmit );

const queryError = useQuery().get( 'error' ) || null;

let errorMessage;
if ( isEnglishLocale && errors.root && errors.root.type !== 'manual' && errors.root.message ) {
if ( errors.root && errors.root.type !== 'manual' && errors.root.message ) {
errorMessage = errors.root.message;
} else if ( queryError === 'ticket-creation' ) {
errorMessage = translate(
Expand All @@ -37,10 +35,10 @@ export const CredentialsForm: FC< CredentialsFormProps > = ( { onSubmit, onSkip
}

const getContinueButtonText = () => {
if ( isEnglishLocale && isBusy && ! canBypassVerification ) {
if ( isBusy && ! canBypassVerification ) {
return translate( 'Verifying credentials' );
}
if ( isEnglishLocale && canBypassVerification ) {
if ( canBypassVerification ) {
return translate( 'Continue anyways' );
}

Expand Down Expand Up @@ -92,9 +90,7 @@ export const CredentialsForm: FC< CredentialsFormProps > = ( { onSubmit, onSkip
onClick={ onSkip }
type="button"
>
{ isEnglishLocale
? translate( 'I need help, please contact me' )
: translate( 'Skip, I need help providing access' ) }
{ translate( 'I need help, please contact me' ) }
</button>
</div>
</form>
Expand Down

0 comments on commit 63da307

Please sign in to comment.