Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/HeaderWithBackButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function HeaderWithBackButton({
shouldOverlayDots = false,
shouldOverlay = false,
shouldNavigateToTopMostReport = false,
shouldDisplayHelpButton = true,
shouldDisplayHelpButton = false,
shouldDisplaySearchRouter = false,
progressBarPercentage,
style,
Expand Down Expand Up @@ -344,8 +344,8 @@ function HeaderWithBackButton({
</Tooltip>
)}
</View>
{shouldDisplayHelpButton && <SidePanelButton />}
{shouldDisplaySearchRouter && <SearchButton />}
{shouldDisplayHelpButton && <SidePanelButton />}
</View>
</View>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,7 @@
}
return option;
});
}, [originalSelectedTransactionsOptions, showDeleteModal, dismissedRejectUseExplanation]);

Check warning on line 1768 in src/components/MoneyReportHeader.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useMemo has missing dependencies: 'isDelegateAccessRestricted' and 'showDelegateNoAccessModal'. Either include them or remove the dependency array

Check warning on line 1768 in src/components/MoneyReportHeader.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useMemo has missing dependencies: 'isDelegateAccessRestricted' and 'showDelegateNoAccessModal'. Either include them or remove the dependency array

const shouldShowSelectedTransactionsButton = !!selectedTransactionsOptions.length && !transactionThreadReportID;

Expand Down Expand Up @@ -1817,6 +1817,7 @@
report={moneyRequestReport}
shouldShowBackButton={shouldShowBackButton}
shouldDisplaySearchRouter={shouldDisplaySearchRouter}
shouldDisplayHelpButton={!(isReportInRHP && shouldUseNarrowLayout)}
onBackButtonPress={onBackButtonPress}
shouldShowBorderBottom={false}
shouldEnableDetailPageNavigation
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navigation/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type TopBarProps = {

const authTokenTypeSelector = (session: OnyxEntry<Session>) => session && {authTokenType: session.authTokenType};

function TopBar({breadcrumbLabel, shouldDisplaySearch = true, shouldDisplayHelpButton = true, cancelSearch, shouldShowLoadingBar = false, children}: TopBarProps) {
function TopBar({breadcrumbLabel, shouldDisplaySearch = true, shouldDisplayHelpButton = false, cancelSearch, shouldShowLoadingBar = false, children}: TopBarProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const [session] = useOnyx(ONYXKEYS.SESSION, {selector: authTokenTypeSelector});
Expand Down Expand Up @@ -72,8 +72,8 @@ function TopBar({breadcrumbLabel, shouldDisplaySearch = true, shouldDisplayHelpB
<Text style={[styles.textBlue]}>{translate('common.cancel')}</Text>
</PressableWithoutFeedback>
)}
{shouldDisplayHelpButton && <SidePanelButton />}
{displaySearch && <SearchButton />}
{shouldDisplayHelpButton && <SidePanelButton />}
</View>
<LoadingBar shouldShow={!isWideRHPVisible && (shouldShowLoadingBarForReports || shouldShowLoadingBar)} />
</View>
Expand Down
1 change: 1 addition & 0 deletions src/pages/Search/SearchPageNarrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function SearchPageNarrow({
shouldShowLoadingBar={shouldShowLoadingState}
breadcrumbLabel={translate('common.reports')}
shouldDisplaySearch={false}
shouldDisplayHelpButton
cancelSearch={shouldDisplayCancelSearch ? cancelSearchCallback : undefined}
/>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/pages/TeachersUnite/SaveTheWorldPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function SaveTheWorldPage() {
title={translate('sidebarScreen.saveTheWorld')}
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplaySearchRouter
shouldDisplayHelpButton
onBackButtonPress={Navigation.goBack}
icon={illustrations.TeachersUnite}
shouldUseHeadlineHeader
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function HomePage() {
<TopBar
breadcrumbLabel={translate('common.home')}
shouldShowLoadingBar={false}
shouldDisplayHelpButton
/>
<ScrollView
contentContainerStyle={styles.homePageContentContainer}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/inbox/HeaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked,
</PressableWithoutFeedback>
</Tooltip>
)}
{!isInSidePanel && <SidePanelButton style={styles.ml2} />}
{shouldDisplaySearchRouter && <SearchButton />}
{shouldDisplaySearchRouter && <SearchButton style={styles.ml2} />}
{!isInSidePanel && <SidePanelButton />}
</View>
</View>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,6 @@ function IOURequestStepConfirmation({
title={headerTitle}
subtitle={hasMultipleTransactions ? `${currentTransactionIndex + 1} ${translate('common.of')} ${transactions.length}` : undefined}
onBackButtonPress={navigateBack}
shouldDisplayHelpButton={!hasMultipleTransactions}
>
{hasMultipleTransactions ? (
<PrevNextButtons
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/AboutPage/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ function AboutPage() {
title={translate('initialSettingsPage.about')}
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplaySearchRouter
shouldDisplayHelpButton
onBackButtonPress={Navigation.goBack}
icon={illustrations.PalmTree}
shouldUseHeadlineHeader
Expand Down
8 changes: 8 additions & 0 deletions src/pages/settings/InitialSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import MenuItem from '@components/MenuItem';
import {ModalActions} from '@components/Modal/Global/ModalContext';
import NavigationTabBar from '@components/Navigation/NavigationTabBar';
import NAVIGATION_TABS from '@components/Navigation/NavigationTabBar/NAVIGATION_TABS';
import TopBar from '@components/Navigation/TopBar';
import {PressableWithFeedback} from '@components/Pressable';
import ScreenWrapper from '@components/ScreenWrapper';
import {ScrollOffsetContext} from '@components/ScrollOffsetContextProvider';
Expand Down Expand Up @@ -542,6 +543,13 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr
shouldEnableKeyboardAvoidingView={false}
>
{shouldDisplayLHB && <NavigationTabBar selectedTab={NAVIGATION_TABS.SETTINGS} />}
{shouldUseNarrowLayout && (
<TopBar
breadcrumbLabel={translate('initialSettingsPage.account')}
shouldDisplaySearch
shouldDisplayHelpButton
/>
)}
{headerContent}
<ScrollView
ref={scrollViewRef}
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Preferences/PreferencesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function PreferencesPage() {
shouldUseHeadlineHeader
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplaySearchRouter
shouldDisplayHelpButton
onBackButtonPress={Navigation.goBack}
/>
<ScrollView contentContainerStyle={styles.pt3}>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ function ProfilePage() {
}}
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplaySearchRouter
shouldDisplayHelpButton
icon={Profile}
shouldUseHeadlineHeader
/>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Rules/ExpenseRulesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ function ExpenseRulesPage() {
}}
shouldShowBackButton={shouldUseNarrowLayout}
shouldUseHeadlineHeader={!selectionModeHeader}
shouldDisplayHelpButton
title={selectionModeHeader ? translate('common.selectMultiple') : translate('expenseRulesPage.title')}
>
{!shouldUseNarrowLayout && headerButton}
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Security/SecuritySettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ function SecuritySettingsPage() {
icon={illustrations.LockClosed}
shouldUseHeadlineHeader
shouldDisplaySearchRouter
shouldDisplayHelpButton
/>
<ScrollView contentContainerStyle={styles.pt3}>
<View style={[styles.flex1, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function SubscriptionSettingsPage({route}: SubscriptionSettingsPageProps) {
}}
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplaySearchRouter
shouldDisplayHelpButton
icon={illustrations.CreditCardsNew}
shouldUseHeadlineHeader
/>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Troubleshoot/TroubleshootPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ function TroubleshootPage() {
title={translate('initialSettingsPage.aboutPage.troubleshoot')}
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplaySearchRouter
shouldDisplayHelpButton
onBackButtonPress={Navigation.goBack}
icon={illustrations.Lightbulb}
shouldUseHeadlineHeader
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Wallet/WalletPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ function WalletPage() {
shouldUseHeadlineHeader
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplaySearchRouter
shouldDisplayHelpButton
/>
);

Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/WorkspaceMoreFeaturesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro
shouldUseHeadlineHeader
title={translate('workspace.common.moreFeatures')}
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplayHelpButton
onBackButtonPress={() => Navigation.goBack()}
/>

Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/WorkspacePageWithSections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ function WorkspacePageWithSections({
shouldShowThreeDotsButton={shouldShowThreeDotsButton}
threeDotsMenuItems={threeDotsMenuItems}
shouldUseHeadlineHeader={shouldUseHeadlineHeader}
shouldDisplayHelpButton
>
{headerContent}
</HeaderWithBackButton>
Expand Down
7 changes: 6 additions & 1 deletion src/pages/workspace/WorkspacesListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,12 @@ function WorkspacesListPage() {
}
>
<View style={styles.flex1}>
<TopBar breadcrumbLabel={translate('common.workspaces')}>{!shouldUseNarrowLayout && <View style={styles.pr2}>{headerButton}</View>}</TopBar>
<TopBar
breadcrumbLabel={translate('common.workspaces')}
shouldDisplayHelpButton
>
{!shouldUseNarrowLayout && <View style={styles.pr2}>{headerButton}</View>}
</TopBar>
{shouldUseNarrowLayout && <View style={[styles.ph5, styles.pt2]}>{headerButton}</View>}
{shouldShowLoadingIndicator ? (
<View style={[styles.flex1]}>
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/accounting/PolicyAccountingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) {
shouldShowBackButton={shouldUseNarrowLayout}
icon={illustrations.Accounting}
shouldUseHeadlineHeader
shouldDisplayHelpButton
onBackButtonPress={Navigation.goBack}
/>
<ScrollView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
title={selectionModeHeader ? translate('common.selectMultiple') : translate('workspace.common.categories')}
icon={!selectionModeHeader ? illustrations.FolderOpen : undefined}
shouldUseHeadlineHeader={!selectionModeHeader}
shouldDisplayHelpButton
onBackButtonPress={() => {
if (isMobileSelectionModeEnabled) {
setSelectedCategories([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ function PolicyDistanceRatesPage({
shouldUseHeadlineHeader={!selectionModeHeader}
title={translate(!selectionModeHeader ? 'workspace.common.distanceRates' : 'common.selectMultiple')}
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplayHelpButton
onBackButtonPress={() => {
if (isMobileSelectionModeEnabled) {
setSelectedDistanceRates([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ function WorkspaceExpensifyCardListPage({route, cardsList, fundID}: WorkspaceExp
shouldUseHeadlineHeader
title={translate('workspace.common.expensifyCard')}
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplayHelpButton
onBackButtonPress={handleBackButtonPress}
>
{!shouldShowSelector && !shouldUseNarrowLayout && isBankAccountVerified && getHeaderButtons()}
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/perDiem/WorkspacePerDiemPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ function WorkspacePerDiemPage({route}: WorkspacePerDiemPageProps) {
title={translate(selectionModeHeader ? 'common.selectMultiple' : 'common.perDiem')}
icon={!selectionModeHeader ? illustrations.PerDiem : undefined}
shouldUseHeadlineHeader={!selectionModeHeader}
shouldDisplayHelpButton
onBackButtonPress={() => {
if (isMobileSelectionModeEnabled) {
setSelectedPerDiem([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ function WorkspaceReceiptPartnersPage({route}: WorkspaceReceiptPartnersPageProps
shouldShowBackButton={shouldUseNarrowLayout}
icon={ReceiptPartners}
shouldUseHeadlineHeader
shouldDisplayHelpButton
onBackButtonPress={Navigation.goBack}
/>
<ScrollView
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/reports/WorkspaceReportsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ function WorkspaceReportFieldsPage({
title={translate('common.reports')}
shouldUseHeadlineHeader
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplayHelpButton
onBackButtonPress={Navigation.goBack}
/>
{isLoading && (
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/tags/WorkspaceTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
shouldUseHeadlineHeader={!selectionModeHeader}
title={translate(selectionModeHeader ? 'common.selectMultiple' : 'workspace.common.tags')}
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplayHelpButton
onBackButtonPress={() => {
if (isMobileSelectionModeEnabled) {
setSelectedTags([]);
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/taxes/WorkspaceTaxesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ function WorkspaceTaxesPage({
shouldUseHeadlineHeader={!selectionModeHeader}
title={translate(selectionModeHeader ? 'common.selectMultiple' : 'workspace.common.taxes')}
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplayHelpButton
onBackButtonPress={() => {
if (isMobileSelectionModeEnabled) {
setSelectedTaxesIDs([]);
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/travel/PolicyTravelPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function WorkspaceTravelPage({
title={translate('workspace.moreFeatures.travel.title')}
shouldUseHeadlineHeader
shouldShowBackButton={shouldUseNarrowLayout}
shouldDisplayHelpButton
onBackButtonPress={Navigation.goBack}
/>
<ScrollViewWithContext addBottomSafeAreaPadding>
Expand Down
Loading