Skip to content

Commit

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

[Form Provider Refactor] NewTaskDetailsPage
  • Loading branch information
luacmartins authored Oct 24, 2023
2 parents 57bf8b6 + b88c1de commit 66ebf0f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/pages/tasks/NewTaskDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import ScreenWrapper from '../../components/ScreenWrapper';
import styles from '../../styles/styles';
import ONYXKEYS from '../../ONYXKEYS';
import * as ErrorUtils from '../../libs/ErrorUtils';
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 CONST from '../../CONST';
import * as Browser from '../../libs/Browser';
import useAutoFocusInput from '../../hooks/useAutoFocusInput';
import FormProvider from '../../components/Form/FormProvider';
import InputWrapper from '../../components/Form/InputWrapper';

const propTypes = {
/** Beta features list */
Expand Down Expand Up @@ -86,7 +87,7 @@ function NewTaskDetailsPage(props) {
shouldShowBackButton
onBackButtonPress={() => Task.dismissModalAndClearOutTaskInfo()}
/>
<Form
<FormProvider
formID={ONYXKEYS.FORMS.NEW_TASK_FORM}
submitButtonText={props.translate('common.next')}
style={[styles.mh5, styles.flexGrow1]}
Expand All @@ -95,7 +96,8 @@ function NewTaskDetailsPage(props) {
enabledWhenOffline
>
<View style={styles.mb5}>
<TextInput
<InputWrapper
InputComponent={TextInput}
ref={inputCallbackRef}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
inputID="taskTitle"
Expand All @@ -106,7 +108,8 @@ function NewTaskDetailsPage(props) {
/>
</View>
<View style={styles.mb5}>
<TextInput
<InputWrapper
InputComponent={TextInput}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
inputID="taskDescription"
label={props.translate('newTaskPage.descriptionOptional')}
Expand All @@ -119,7 +122,7 @@ function NewTaskDetailsPage(props) {
onValueChange={(value) => setTaskDescription(value)}
/>
</View>
</Form>
</FormProvider>
</ScreenWrapper>
);
}
Expand Down

0 comments on commit 66ebf0f

Please sign in to comment.