Skip to content

Commit

Permalink
Merge pull request #29869 from software-mansion-labs/form-migration/N…
Browse files Browse the repository at this point in the history
…ewContactMethodPage

[Form Provider Refactor] NewContactMethodPage
  • Loading branch information
luacmartins authored Oct 26, 2023
2 parents 8c76d2a + e052333 commit 9e50be4
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 9e50be4

Please sign in to comment.