Skip to content

Commit

Permalink
Use FormProvider in NewContactMethodPage
Browse files Browse the repository at this point in the history
  • Loading branch information
cdOut committed Oct 23, 2023
1 parent 1c31bf7 commit c133db8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pages/settings/Profile/Contacts/NewContactMethodPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import styles from '../../../../styles/styles';
import * as User from '../../../../libs/actions/User';
import * as LoginUtils from '../../../../libs/LoginUtils';
import * as ErrorUtils from '../../../../libs/ErrorUtils';
import Form from '../../../../components/Form';
import CONST from '../../../../CONST';
import FormProvider from '../../../../components/Form/FormProvider';
import InputWrapper from '../../../../components/Form/InputWrapper';

const propTypes = {
/* Onyx Props */
Expand Down Expand Up @@ -104,7 +105,7 @@ function NewContactMethodPage(props) {
title={props.translate('contacts.newContactMethod')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS)}
/>
<Form
<FormProvider
formID={ONYXKEYS.FORMS.NEW_CONTACT_METHOD_FORM}
validate={validate}
onSubmit={addNewContactMethod}
Expand All @@ -114,7 +115,8 @@ function NewContactMethodPage(props) {
>
<Text style={[styles.mb5]}>{props.translate('common.pleaseEnterEmailOrPhoneNumber')}</Text>
<View style={[styles.mb6]}>
<TextInput
<InputWrapper
InputComponent={TextInput}
label={`${props.translate('common.email')}/${props.translate('common.phoneNumber')}`}
accessibilityLabel={`${props.translate('common.email')}/${props.translate('common.phoneNumber')}`}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
Expand All @@ -126,7 +128,7 @@ function NewContactMethodPage(props) {
maxLength={CONST.LOGIN_CHARACTER_LIMIT}
/>
</View>
</Form>
</FormProvider>
</ScreenWrapper>
);
}
Expand Down

0 comments on commit c133db8

Please sign in to comment.