Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Form Provider Refactor] NewTaskDescriptionPage #30061

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading