diff --git a/src/components/LHNOptionsList/OptionRowLHN.tsx b/src/components/LHNOptionsList/OptionRowLHN.tsx index bd19b3a032ea..7b1194fcb775 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.tsx +++ b/src/components/LHNOptionsList/OptionRowLHN.tsx @@ -28,7 +28,7 @@ import Performance from '@libs/Performance'; import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager'; import * as ReportUtils from '@libs/ReportUtils'; import * as ReportActionContextMenu from '@pages/home/report/ContextMenu/ReportActionContextMenu'; -import FreeTrialBadge from '@pages/settings/Subscription/FreeTrialBadge'; +import FreeTrial from '@pages/settings/Subscription/FreeTrial'; import variables from '@styles/variables'; import * as User from '@userActions/User'; import CONST from '@src/CONST'; @@ -277,7 +277,7 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti ReportUtils.isSystemChat(report) } /> - {ReportUtils.isChatUsedForOnboarding(report) && } + {ReportUtils.isChatUsedForOnboarding(report) && } {isStatusVisible && ( ); + const freeTrialButton = ; + const renderAdditionalText = () => { if (shouldShowSubtitle() || isPersonalExpenseChat || !policyName || !isEmptyObject(parentNavigationSubtitleData) || isSelfDM) { return null; @@ -143,6 +145,7 @@ function HeaderView({report, parentReportAction, reportID, onNavigationMenuButto const isReportInRHP = isReportOpenInRHP(navigationRef?.getRootState()); const shouldDisplaySearchRouter = !isReportInRHP; + const isChatUsedForOnboarding = ReportUtils.isChatUsedForOnboarding(report); return ( - {ReportUtils.isChatUsedForOnboarding(report) && } + {!shouldUseNarrowLayout && isChatUsedForOnboarding && freeTrialButton} {isTaskReport && !shouldUseNarrowLayout && ReportUtils.isOpenTaskReport(report, parentReportAction) && } {canJoin && !shouldUseNarrowLayout && joinButton} @@ -304,6 +307,7 @@ function HeaderView({report, parentReportAction, reportID, onNavigationMenuButto )} {!isLoading && canJoin && shouldUseNarrowLayout && {joinButton}} + {!isLoading && isChatUsedForOnboarding && shouldUseNarrowLayout && {freeTrialButton}} ); } diff --git a/src/pages/settings/Subscription/FreeTrialBadge.tsx b/src/pages/settings/Subscription/FreeTrial.tsx similarity index 67% rename from src/pages/settings/Subscription/FreeTrialBadge.tsx rename to src/pages/settings/Subscription/FreeTrial.tsx index 5379d5a888b7..298cb823de97 100644 --- a/src/pages/settings/Subscription/FreeTrialBadge.tsx +++ b/src/pages/settings/Subscription/FreeTrial.tsx @@ -2,15 +2,20 @@ import React, {useEffect, useState} from 'react'; import type {StyleProp, ViewStyle} 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 Navigation from '@libs/Navigation/Navigation'; import * as SubscriptionUtils from '@libs/SubscriptionUtils'; +import * as Expensicons from '@src/components/Icon/Expensicons'; import ONYXKEYS from '@src/ONYXKEYS'; +import ROUTES from '@src/ROUTES'; -type FreeTrialBadgeProps = { +type FreeTrialProps = { badgeStyles?: StyleProp; + pressable?: boolean; }; -function FreeTrialBadge({badgeStyles}: FreeTrialBadgeProps) { +function FreeTrial({badgeStyles, pressable = false}: FreeTrialProps) { const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const [firstDayFreeTrial] = useOnyx(ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL); const [lastDayFreeTrial] = useOnyx(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL); @@ -30,7 +35,14 @@ function FreeTrialBadge({badgeStyles}: FreeTrialBadgeProps) { return null; } - return ( + return pressable ? ( +