Skip to content

Commit

Permalink
Merge pull request Expensify#27987 from hungvu193/fix-27594
Browse files Browse the repository at this point in the history
Fix Save button is not at the bottom of the page
  • Loading branch information
NikkiWines authored Sep 28, 2023
2 parents 632de14 + ecdbd8e commit 33315f9
Showing 1 changed file with 45 additions and 47 deletions.
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 @@ -97,6 +97,7 @@ function PrivateNotesEditPage({route, personalDetailsList, session, report}) {

return (
<ScreenWrapper
shouldEnableMaxHeight
includeSafeAreaPaddingBottom={false}
testID={PrivateNotesEditPage.displayName}
>
Expand All @@ -116,54 +117,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

0 comments on commit 33315f9

Please sign in to comment.