Skip to content

Commit

Permalink
Merge pull request #30164 from software-mansion-labs/form-migration/T…
Browse files Browse the repository at this point in the history
…askDescriptionPage

[Form Provider Refactor] TaskDescriptionPage
  • Loading branch information
luacmartins authored Oct 25, 2023
2 parents 3d58961 + 430b09c commit 5dbfdf7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pages/tasks/TaskDescriptionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {withOnyx} from 'react-native-onyx';
import ScreenWrapper from '../../components/ScreenWrapper';
import HeaderWithBackButton from '../../components/HeaderWithBackButton';
import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize';
import Form from '../../components/Form';
import ONYXKEYS from '../../ONYXKEYS';
import TextInput from '../../components/TextInput';
import reportPropTypes from '../reportPropTypes';
Expand All @@ -20,6 +19,8 @@ import Navigation from '../../libs/Navigation/Navigation';
import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView';
import withCurrentUserPersonalDetails from '../../components/withCurrentUserPersonalDetails';
import withReportOrNotFound from '../home/report/withReportOrNotFound';
import FormProvider from '../../components/Form/FormProvider';
import InputWrapper from '../../components/Form/InputWrapper';

const propTypes = {
/** The report currently being looked at */
Expand Down Expand Up @@ -81,7 +82,7 @@ function TaskDescriptionPage(props) {
>
<FullPageNotFoundView shouldShow={isTaskNonEditable}>
<HeaderWithBackButton title={props.translate('task.task')} />
<Form
<FormProvider
style={[styles.flexGrow1, styles.ph5]}
formID={ONYXKEYS.FORMS.EDIT_TASK_FORM}
validate={validate}
Expand All @@ -90,7 +91,8 @@ function TaskDescriptionPage(props) {
enabledWhenOffline
>
<View style={[styles.mb4]}>
<TextInput
<InputWrapper
InputComponent={TextInput}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
inputID="description"
name="description"
Expand All @@ -110,7 +112,7 @@ function TaskDescriptionPage(props) {
textAlignVertical="top"
/>
</View>
</Form>
</FormProvider>
</FullPageNotFoundView>
</ScreenWrapper>
);
Expand Down

0 comments on commit 5dbfdf7

Please sign in to comment.