Skip to content

Commit

Permalink
Merge pull request Expensify#53942 from FitseTLT/fix-concierge-extra-…
Browse files Browse the repository at this point in the history
…spacing-bug

Fix - Concierge - Concierge header has extra bottom padding
  • Loading branch information
srikarparsi authored Dec 23, 2024
2 parents c61f3a1 + 285aba5 commit 5f65aec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/pages/home/HeaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ function HeaderView({report, parentReportAction, reportID, onNavigationMenuButto
/>
);

const freeTrialButton = <FreeTrial pressable />;

const renderAdditionalText = () => {
if (shouldShowSubtitle() || isPersonalExpenseChat || !policyName || !isEmptyObject(parentNavigationSubtitleData) || isSelfDM) {
return null;
Expand Down Expand Up @@ -287,7 +285,7 @@ function HeaderView({report, parentReportAction, reportID, onNavigationMenuButto
)}
</PressableWithoutFeedback>
<View style={[styles.reportOptions, styles.flexRow, styles.alignItemsCenter]}>
{!shouldUseNarrowLayout && isChatUsedForOnboarding && freeTrialButton}
{!shouldUseNarrowLayout && isChatUsedForOnboarding && <FreeTrial pressable />}
{isTaskReport && !shouldUseNarrowLayout && ReportUtils.isOpenTaskReport(report, parentReportAction) && <TaskHeaderActionButton report={report} />}
{!isParentReportLoading && canJoin && !shouldUseNarrowLayout && joinButton}
</View>
Expand All @@ -311,7 +309,12 @@ function HeaderView({report, parentReportAction, reportID, onNavigationMenuButto
)}
</View>
{!isParentReportLoading && !isLoading && canJoin && shouldUseNarrowLayout && <View style={[styles.ph5, styles.pb2]}>{joinButton}</View>}
{!isLoading && isChatUsedForOnboarding && shouldUseNarrowLayout && <View style={[styles.pb3, styles.ph5]}>{freeTrialButton}</View>}
{!isLoading && isChatUsedForOnboarding && shouldUseNarrowLayout && (
<FreeTrial
pressable
addSpacing
/>
)}
</View>
);
}
Expand Down
10 changes: 8 additions & 2 deletions src/pages/settings/Subscription/FreeTrial.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React, {useEffect, useState} from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import Badge from '@components/Badge';
import Button from '@components/Button';
import useNetwork from '@hooks/useNetwork';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import * as SubscriptionUtils from '@libs/SubscriptionUtils';
import * as Expensicons from '@src/components/Icon/Expensicons';
Expand All @@ -13,9 +15,11 @@ import ROUTES from '@src/ROUTES';
type FreeTrialProps = {
badgeStyles?: StyleProp<ViewStyle>;
pressable?: boolean;
addSpacing?: boolean;
};

function FreeTrial({badgeStyles, pressable = false}: FreeTrialProps) {
function FreeTrial({badgeStyles, pressable = false, addSpacing = false}: FreeTrialProps) {
const styles = useThemeStyles();
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
const [firstDayFreeTrial] = useOnyx(ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL);
const [lastDayFreeTrial] = useOnyx(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL);
Expand All @@ -35,7 +39,7 @@ function FreeTrial({badgeStyles, pressable = false}: FreeTrialProps) {
return null;
}

return pressable ? (
const freeTrial = pressable ? (
<Button
icon={Expensicons.Star}
success
Expand All @@ -49,6 +53,8 @@ function FreeTrial({badgeStyles, pressable = false}: FreeTrialProps) {
badgeStyles={badgeStyles}
/>
);

return addSpacing ? <View style={[styles.pb3, styles.ph5]}>{freeTrial}</View> : freeTrial;
}

FreeTrial.displayName = 'FreeTrial';
Expand Down

0 comments on commit 5f65aec

Please sign in to comment.