Skip to content

Commit

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

[Form Provider Refactor] NewTaskDescriptionPage
  • Loading branch information
luacmartins authored Oct 30, 2023
2 parents 4684d29 + def1a5f commit b1d3ee5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pages/tasks/NewTaskDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import PropTypes from 'prop-types';
import React from 'react';
import {View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
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 @@ -63,15 +64,16 @@ function NewTaskDescriptionPage(props) {
onCloseButtonPress={() => Task.dismissModalAndClearOutTaskInfo()}
onBackButtonPress={() => Navigation.goBack(ROUTES.NEW_TASK)}
/>
<Form
<FormProvider
formID={ONYXKEYS.FORMS.NEW_TASK_FORM}
submitButtonText={props.translate('common.next')}
style={[styles.mh5, styles.flexGrow1]}
onSubmit={(values) => onSubmit(values)}
enabledWhenOffline
>
<View style={styles.mb5}>
<TextInput
<InputWrapperWithRef
InputComponent={TextInput}
defaultValue={props.task.description}
inputID="taskDescription"
label={props.translate('newTaskPage.descriptionOptional')}
Expand All @@ -87,7 +89,7 @@ function NewTaskDescriptionPage(props) {
textAlignVertical="top"
/>
</View>
</Form>
</FormProvider>
</>
</ScreenWrapper>
);
Expand Down

0 comments on commit b1d3ee5

Please sign in to comment.