Skip to content

Commit 91aafd4

Browse files
authored
Merge pull request Expensify#88195 from software-mansion-labs/@GCygnaek/landscape-mode/fix-learn-more-button
2 parents df08b0d + abb9d17 commit 91aafd4

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/CONST/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8769,6 +8769,9 @@ const CONST = {
87698769
},
87708770

87718771
SENTRY_LABEL: {
8772+
BILLING_BANNER: {
8773+
RIGHT_ICON: 'BillingBanner-RightIcon',
8774+
},
87728775
NAVIGATION_TAB_BAR: {
87738776
EXPENSIFY_LOGO: 'NavigationTabBar-ExpensifyLogo',
87748777
INBOX: 'NavigationTabBar-Inbox',

src/pages/settings/Subscription/CardSection/BillingBanner/BillingBanner.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function BillingBanner({
6363
}: BillingBannerProps) {
6464
const styles = useThemeStyles();
6565
const theme = useTheme();
66-
const {shouldUseNarrowLayout} = useResponsiveLayout();
66+
const {shouldUseNarrowLayout, isInLandscapeMode} = useResponsiveLayout();
6767
const expensifyIcons = useMemoizedLazyExpensifyIcons(['DotIndicator']);
6868

6969
const rightIconComponent = useMemo(() => {
@@ -74,6 +74,7 @@ function BillingBanner({
7474
style={[styles.touchableButtonImage]}
7575
role={CONST.ROLE.BUTTON}
7676
accessibilityLabel={rightIconAccessibilityLabel}
77+
sentryLabel={CONST.SENTRY_LABEL.BILLING_BANNER.RIGHT_ICON}
7778
>
7879
<Icon
7980
src={rightIcon}
@@ -110,7 +111,7 @@ function BillingBanner({
110111
{typeof title === 'string' ? <Text style={[styles.textStrong, titleStyle]}>{title}</Text> : title}
111112
{!!subtitle && (typeof subtitle === 'string' ? <Text style={subtitleStyle}>{subtitle}</Text> : subtitle)}
112113
</View>
113-
{shouldUseNarrowLayout ? (
114+
{shouldUseNarrowLayout && !isInLandscapeMode ? (
114115
<>
115116
{rightIconComponent}
116117
{!!rightComponent && rightComponent}

src/pages/workspace/companyCards/WorkspaceCompanyCardExpensifyCardPromotionBanner.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function WorkspaceCompanyCardExpensifyCardPromotionBanner({policy}: WorkspaceCom
2222
const styles = useThemeStyles();
2323
const {translate} = useLocalize();
2424
const StyleUtils = useStyleUtils();
25-
const {shouldUseNarrowLayout} = useResponsiveLayout();
25+
const {shouldUseNarrowLayout, isInLandscapeMode} = useResponsiveLayout();
2626
const policyID = policy?.id;
2727
const areExpensifyCardsEnabled = policy?.areExpensifyCardsEnabled;
2828

@@ -42,19 +42,19 @@ function WorkspaceCompanyCardExpensifyCardPromotionBanner({policy}: WorkspaceCom
4242
}, [policyID, areExpensifyCardsEnabled]);
4343

4444
const rightComponent = useMemo(() => {
45-
const smallScreenStyle = shouldUseNarrowLayout ? [styles.flex0, styles.flexBasis100, styles.justifyContentCenter] : [];
45+
const smallScreenStyle = shouldUseNarrowLayout && !isInLandscapeMode ? [styles.flex0, styles.justifyContentCenter] : [];
4646
return (
4747
<View style={[styles.flexRow, styles.gap2, smallScreenStyle]}>
4848
<Button
4949
success
5050
onPress={handleLearnMore}
51-
style={shouldUseNarrowLayout && styles.flex1}
51+
style={shouldUseNarrowLayout && !isInLandscapeMode && styles.flex1}
5252
text={translate('workspace.moreFeatures.companyCards.expensifyCardBannerLearnMoreButton')}
5353
accessibilityLabel={`${translate('workspace.moreFeatures.companyCards.expensifyCardBannerLearnMoreButton')}, ${translate('workspace.moreFeatures.companyCards.expensifyCardBannerTitle')}`}
5454
/>
5555
</View>
5656
);
57-
}, [styles, shouldUseNarrowLayout, translate, handleLearnMore]);
57+
}, [styles, shouldUseNarrowLayout, isInLandscapeMode, translate, handleLearnMore]);
5858

5959
return (
6060
<View style={[styles.ph4, styles.mb4]}>

0 commit comments

Comments
 (0)