Skip to content

Commit

Permalink
Merge pull request #30382 from software-mansion-labs/form-migration/E…
Browse files Browse the repository at this point in the history
…ditRequestDescriptionPage

[Form Provider Refactor] EditRequestDescriptionPage
  • Loading branch information
luacmartins authored Oct 30, 2023
2 parents 052fd0b + a027e64 commit 2f4d50d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pages/EditRequestDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {useFocusEffect} from '@react-navigation/native';
import PropTypes from 'prop-types';
import React, {useCallback, useRef} from 'react';
import {View} from 'react-native';
import Form from '@components/Form';
import FormProvider from '@components/Form/FormProvider';
import InputWrapperWithRef from '@components/Form/InputWrapper';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
import TextInput from '@components/TextInput';
Expand Down Expand Up @@ -49,16 +50,17 @@ function EditRequestDescriptionPage({defaultDescription, onSubmit}) {
testID={EditRequestDescriptionPage.displayName}
>
<HeaderWithBackButton title={translate('common.description')} />
<Form
<FormProvider
style={[styles.flexGrow1, styles.ph5]}
formID={ONYXKEYS.FORMS.MONEY_REQUEST_DESCRIPTION_FORM}
onSubmit={onSubmit}
submitButtonText={translate('common.save')}
enabledWhenOffline
>
<View style={styles.mb4}>
<TextInput
<InputWrapperWithRef
// Comment field does not have its modified counterpart
InputComponent={TextInput}
inputID="comment"
name="comment"
defaultValue={defaultDescription}
Expand All @@ -78,7 +80,7 @@ function EditRequestDescriptionPage({defaultDescription, onSubmit}) {
submitOnEnter={!Browser.isMobile()}
/>
</View>
</Form>
</FormProvider>
</ScreenWrapper>
);
}
Expand Down

0 comments on commit 2f4d50d

Please sign in to comment.