Skip to content

Commit

Permalink
Merge pull request #49400 from bernhardoj/fix/48468-empty-space-below…
Browse files Browse the repository at this point in the history
…-button

Fix the "Next" button is not positioned above the keyboard
  • Loading branch information
roryabraham authored Sep 20, 2024
2 parents eaa7969 + 920e74f commit 9160fa5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 35 deletions.
30 changes: 9 additions & 21 deletions src/pages/settings/AboutPage/ConsolePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {format} from 'date-fns';
import React, {useCallback, useMemo, useRef, useState} from 'react';
import {View} from 'react-native';
import type {ListRenderItem, ListRenderItemInfo} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import {useOnyx} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import Button from '@components/Button';
import ConfirmModal from '@components/ConfirmModal';
Expand Down Expand Up @@ -33,23 +33,15 @@ import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type {CapturedLogs} from '@src/types/onyx';

type ConsolePageOnyxProps = {
/** Logs captured on the current device */
capturedLogs: OnyxEntry<CapturedLogs>;

/** Whether or not logs should be stored */
shouldStoreLogs: OnyxEntry<boolean>;
};

type ConsolePageProps = ConsolePageOnyxProps;

const filterBy = {
all: '',
network: '[Network]',
} as const;
type FilterBy = (typeof filterBy)[keyof typeof filterBy];

function ConsolePage({capturedLogs, shouldStoreLogs}: ConsolePageProps) {
function ConsolePage() {
const [capturedLogs] = useOnyx(ONYXKEYS.LOGS);
const [shouldStoreLogs] = useOnyx(ONYXKEYS.SHOULD_STORE_LOGS);
const [input, setInput] = useState('');
const [isGeneratingLogsFile, setIsGeneratingLogsFile] = useState(false);
const [isLimitModalVisible, setIsLimitModalVisible] = useState(false);
Expand Down Expand Up @@ -159,7 +151,10 @@ function ConsolePage({capturedLogs, shouldStoreLogs}: ConsolePageProps) {
);

return (
<ScreenWrapper testID={ConsolePage.displayName}>
<ScreenWrapper
testID={ConsolePage.displayName}
shouldEnableMaxHeight
>
<HeaderWithBackButton
title={translate('initialSettingsPage.troubleshoot.debugConsole')}
onBackButtonPress={() => Navigation.goBack(route.params?.backTo)}
Expand Down Expand Up @@ -228,11 +223,4 @@ function ConsolePage({capturedLogs, shouldStoreLogs}: ConsolePageProps) {

ConsolePage.displayName = 'ConsolePage';

export default withOnyx<ConsolePageProps, ConsolePageOnyxProps>({
capturedLogs: {
key: ONYXKEYS.LOGS,
},
shouldStoreLogs: {
key: ONYXKEYS.SHOULD_STORE_LOGS,
},
})(ConsolePage);
export default ConsolePage;
23 changes: 9 additions & 14 deletions src/pages/settings/ExitSurvey/ExitSurveyResponsePage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {StackScreenProps} from '@react-navigation/stack';
import React, {useCallback, useEffect, useState} from 'react';
import {withOnyx} from 'react-native-onyx';
import {useOnyx} from 'react-native-onyx';
import FormProvider from '@components/Form/FormProvider';
import InputWrapper from '@components/Form/InputWrapper';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
Expand Down Expand Up @@ -34,13 +34,10 @@ import INPUT_IDS from '@src/types/form/ExitSurveyResponseForm';
import type {Errors} from '@src/types/onyx/OnyxCommon';
import ExitSurveyOffline from './ExitSurveyOffline';

type ExitSurveyResponsePageOnyxProps = {
draftResponse: string;
};
type ExitSurveyResponsePageProps = StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.SETTINGS.EXIT_SURVEY.RESPONSE>;

type ExitSurveyResponsePageProps = ExitSurveyResponsePageOnyxProps & StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.SETTINGS.EXIT_SURVEY.RESPONSE>;

function ExitSurveyResponsePage({draftResponse, route, navigation}: ExitSurveyResponsePageProps) {
function ExitSurveyResponsePage({route, navigation}: ExitSurveyResponsePageProps) {
const [draftResponse = ''] = useOnyx(ONYXKEYS.FORMS.EXIT_SURVEY_RESPONSE_FORM_DRAFT, {selector: (value) => value?.[INPUT_IDS.RESPONSE]});
const {translate} = useLocalize();
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
Expand Down Expand Up @@ -119,7 +116,10 @@ function ExitSurveyResponsePage({draftResponse, route, navigation}: ExitSurveyRe
);

return (
<ScreenWrapper testID={ExitSurveyResponsePage.displayName}>
<ScreenWrapper
testID={ExitSurveyResponsePage.displayName}
shouldEnableMaxHeight
>
<HeaderWithBackButton
title={translate('exitSurvey.header')}
onBackButtonPress={() => Navigation.goBack()}
Expand Down Expand Up @@ -179,9 +179,4 @@ function ExitSurveyResponsePage({draftResponse, route, navigation}: ExitSurveyRe

ExitSurveyResponsePage.displayName = 'ExitSurveyResponsePage';

export default withOnyx<ExitSurveyResponsePageProps, ExitSurveyResponsePageOnyxProps>({
draftResponse: {
key: ONYXKEYS.FORMS.EXIT_SURVEY_RESPONSE_FORM_DRAFT,
selector: (value) => value?.[INPUT_IDS.RESPONSE] ?? '',
},
})(ExitSurveyResponsePage);
export default ExitSurveyResponsePage;

0 comments on commit 9160fa5

Please sign in to comment.