Skip to content

Commit e6ac2ed

Browse files
authored
Merge pull request #89930 from Expensify/fix/89861-unable-to-see-content-on-mobile
fix: enhance AddAgentPage for landscape mode support
2 parents 5809a5b + bbfa979 commit e6ac2ed

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/pages/settings/Agents/AddAgentPage.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {botAvatarIDs, botAvatars} from '@components/Icon/DefaultBotAvatars';
1010
import ScreenWrapper from '@components/ScreenWrapper';
1111
import TextInput from '@components/TextInput';
1212
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
13+
import useIsInLandscapeMode from '@hooks/useIsInLandscapeMode';
1314
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
1415
import useLocalize from '@hooks/useLocalize';
1516
import useThemeStyles from '@hooks/useThemeStyles';
@@ -23,6 +24,7 @@ import type {Errors} from '@src/types/onyx/OnyxCommon';
2324
function AddAgentPage() {
2425
const {translate} = useLocalize();
2526
const styles = useThemeStyles();
27+
const isInLandscapeMode = useIsInLandscapeMode();
2628
const {displayName} = useCurrentUserPersonalDetails();
2729
const defaultAgentName = displayName ? translate('addAgentPage.defaultAgentName', displayName) : undefined;
2830
const defaultPrompt = translate('addAgentPage.defaultPrompt');
@@ -54,6 +56,7 @@ function AddAgentPage() {
5456
testID={AddAgentPage.displayName}
5557
includeSafeAreaPaddingBottom
5658
offlineIndicatorStyle={styles.mtAuto}
59+
shouldEnableMaxHeight={isInLandscapeMode}
5760
>
5861
<HeaderWithBackButton
5962
title={translate('addAgentPage.title')}
@@ -65,8 +68,8 @@ function AddAgentPage() {
6568
validate={validate}
6669
submitButtonText={translate('addAgentPage.createAgent')}
6770
style={[styles.flex1, styles.ph5]}
68-
shouldUseScrollView={false}
69-
submitFlexEnabled={false}
71+
shouldUseScrollView={isInLandscapeMode}
72+
submitFlexEnabled={isInLandscapeMode ? undefined : false}
7073
shouldHideFixErrorsAlert
7174
enabledWhenOffline
7275
>
@@ -93,7 +96,7 @@ function AddAgentPage() {
9396
spellCheck={false}
9497
defaultValue={defaultAgentName}
9598
/>
96-
<View style={[styles.flex1]}>
99+
<View style={[styles.flex1, isInLandscapeMode && styles.minHeight42]}>
97100
<InputWrapper
98101
InputComponent={TextInput}
99102
inputID={INPUT_IDS.PROMPT}

0 commit comments

Comments
 (0)