Skip to content

Commit

Permalink
Add FormProvider to NewTaskDescriptionPage
Browse files Browse the repository at this point in the history
  • Loading branch information
cdOut committed Oct 23, 2023
1 parent 1c31bf7 commit d0ea5b9
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 @@ -10,14 +10,15 @@ import Navigation from '../../libs/Navigation/Navigation';
import ScreenWrapper from '../../components/ScreenWrapper';
import styles from '../../styles/styles';
import ONYXKEYS from '../../ONYXKEYS';
import Form from '../../components/Form';
import TextInput from '../../components/TextInput';
import Permissions from '../../libs/Permissions';
import ROUTES from '../../ROUTES';
import * as Task from '../../libs/actions/Task';
import updateMultilineInputRange from '../../libs/UpdateMultilineInputRange';
import CONST from '../../CONST';
import * as Browser from '../../libs/Browser';
import FormProvider from '../../components/Form/FormProvider';
import InputWrapper from '../../components/Form/InputWrapper';

const propTypes = {
/** Beta features list */
Expand Down Expand Up @@ -82,15 +83,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
<InputWrapper
InputComponent={TextInput}
defaultValue={props.task.description}
inputID="taskDescription"
label={props.translate('newTaskPage.descriptionOptional')}
Expand All @@ -109,7 +111,7 @@ function NewTaskDescriptionPage(props) {
textAlignVertical="top"
/>
</View>
</Form>
</FormProvider>
</>
</ScreenWrapper>
);
Expand Down

0 comments on commit d0ea5b9

Please sign in to comment.