Skip to content
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
92 changes: 45 additions & 47 deletions src/pages/PrivateNotes/PrivateNotesEditPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useState, useRef, useCallback} from 'react';
import PropTypes from 'prop-types';
import {View, Keyboard} from 'react-native';
import {Keyboard} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import {useFocusEffect} from '@react-navigation/native';
import lodashGet from 'lodash/get';
Expand Down Expand Up @@ -96,6 +96,7 @@ function PrivateNotesEditPage({route, personalDetailsList, session, report}) {

return (
<ScreenWrapper
shouldEnableMaxHeight
includeSafeAreaPaddingBottom={false}
testID={PrivateNotesEditPage.displayName}
>
Expand All @@ -109,54 +110,51 @@ function PrivateNotesEditPage({route, personalDetailsList, session, report}) {
shouldShowBackButton
onCloseButtonPress={() => Navigation.dismissModal()}
/>
<View style={[styles.flexGrow1, styles.ph5]}>
<View style={[styles.mb5]}>
<Text>
{translate(
Str.extractEmailDomain(lodashGet(personalDetailsList, [route.params.accountID, 'login'], '')) === CONST.EMAIL.GUIDES_DOMAIN
? 'privateNotes.sharedNoteMessage'
: 'privateNotes.personalNoteMessage',
)}
</Text>
</View>
<Form
formID={ONYXKEYS.FORMS.PRIVATE_NOTES_FORM}
onSubmit={savePrivateNote}
submitButtonText={translate('common.save')}
enabledWhenOffline
<Form
formID={ONYXKEYS.FORMS.PRIVATE_NOTES_FORM}
onSubmit={savePrivateNote}
style={[styles.flexGrow1, styles.ph5]}
submitButtonText={translate('common.save')}
enabledWhenOffline
>
<Text style={[styles.mb5]}>
{translate(
Str.extractEmailDomain(lodashGet(personalDetailsList, [route.params.accountID, 'login'], '')) === CONST.EMAIL.GUIDES_DOMAIN
? 'privateNotes.sharedNoteMessage'
: 'privateNotes.personalNoteMessage',
)}
</Text>
<OfflineWithFeedback
errors={{
...lodashGet(report, ['privateNotes', route.params.accountID, 'errors'], ''),
}}
onClose={() => Report.clearPrivateNotesError(report.reportID, route.params.accountID)}
style={[styles.mb3]}
>
<OfflineWithFeedback
errors={{
...lodashGet(report, ['privateNotes', route.params.accountID, 'errors'], ''),
<TextInput
accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
inputID="privateNotes"
label={translate('privateNotes.composerLabel')}
accessibilityLabel={translate('privateNotes.title')}
autoCompleteType="off"
maxLength={CONST.MAX_COMMENT_LENGTH}
autoCorrect={false}
autoGrowHeight
textAlignVertical="top"
containerStyles={[styles.autoGrowHeightMultilineInput]}
defaultValue={privateNote}
value={privateNote}
onChangeText={(text) => setPrivateNote(text)}
ref={(el) => {
if (!el) {
return;
}
privateNotesInput.current = el;
updateMultilineInputRange(privateNotesInput.current);
}}
onClose={() => Report.clearPrivateNotesError(report.reportID, route.params.accountID)}
style={[styles.mb3]}
>
<TextInput
accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
inputID="privateNotes"
label={translate('privateNotes.composerLabel')}
accessibilityLabel={translate('privateNotes.title')}
autoCompleteType="off"
maxLength={CONST.MAX_COMMENT_LENGTH}
autoCorrect={false}
autoGrowHeight
textAlignVertical="top"
containerStyles={[styles.autoGrowHeightMultilineInput]}
defaultValue={privateNote}
value={privateNote}
onChangeText={(text) => setPrivateNote(text)}
ref={(el) => {
if (!el) {
return;
}
privateNotesInput.current = el;
updateMultilineInputRange(privateNotesInput.current);
}}
/>
</OfflineWithFeedback>
</Form>
</View>
/>
</OfflineWithFeedback>
</Form>
</FullPageNotFoundView>
</ScreenWrapper>
);
Expand Down