Skip to content

Commit

Permalink
Merge pull request #30419 from software-mansion-labs/form-migration/M…
Browse files Browse the repository at this point in the history
…oneyRequestDescriptionPage

[Form Provider Refactor] MoneyRequestDescriptionPage
  • Loading branch information
luacmartins authored Oct 30, 2023
2 parents 7d84cbf + dba6fbb commit 591ec44
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/pages/iou/MoneyRequestDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ import React, {useCallback, useEffect, useRef} from 'react';
import {View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
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';
import useLocalize from '@hooks/useLocalize';
import * as IOU from '@libs/actions/IOU';
import * as Browser from '@libs/Browser';
import * as MoneyRequestUtils from '@libs/MoneyRequestUtils';
import Navigation from '@libs/Navigation/Navigation';
import updateMultilineInputRange from '@libs/UpdateMultilineInputRange';
import styles from '@styles/styles';
import * as IOU from '@userActions/IOU';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -115,15 +116,16 @@ function MoneyRequestDescriptionPage({iou, route, selectedTab}) {
title={translate('common.description')}
onBackButtonPress={() => navigateBack()}
/>
<Form
<FormProvider
style={[styles.flexGrow1, styles.ph5]}
formID={ONYXKEYS.FORMS.MONEY_REQUEST_DESCRIPTION_FORM}
onSubmit={(value) => updateComment(value)}
submitButtonText={translate('common.save')}
enabledWhenOffline
>
<View style={styles.mb4}>
<TextInput
<InputWrapperWithRef
InputComponent={TextInput}
inputID="moneyRequestComment"
name="moneyRequestComment"
defaultValue={iou.comment}
Expand All @@ -143,7 +145,7 @@ function MoneyRequestDescriptionPage({iou, route, selectedTab}) {
submitOnEnter={!Browser.isMobile()}
/>
</View>
</Form>
</FormProvider>
</>
</ScreenWrapper>
);
Expand Down

0 comments on commit 591ec44

Please sign in to comment.