Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove english based verifications #95552

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading