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
2 changes: 1 addition & 1 deletion Mobile-Expensify
11 changes: 0 additions & 11 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,6 @@ const ROUTES = {
return getUrlWithBackToParam(baseRoute, backTo);
},
},

EXPENSE_REPORT_RHP: {
route: 'e/:reportID',
getRoute: ({reportID, backTo}: {reportID: string; backTo?: string}) => {
const baseRoute = `e/${reportID}` as const;

// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
return getUrlWithBackToParam(baseRoute, backTo);
},
},

SEARCH_REPORT_VERIFY_ACCOUNT: {
route: `search/view/:reportID/${VERIFY_ACCOUNT}`,
getRoute: (reportID: string) => `search/view/${reportID}/${VERIFY_ACCOUNT}` as const,
Expand Down
4 changes: 0 additions & 4 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ const SCREENS = {
TRANSACTION_DUPLICATE: 'TransactionDuplicate',
TRAVEL: 'Travel',
SEARCH_REPORT: 'SearchReport',
SEARCH_REPORT_ACTIONS: 'SearchReportActions',
SEARCH_MONEY_REQUEST_REPORT: 'SearchMoneyRequestReport',
SEARCH_ADVANCED_FILTERS: 'SearchAdvancedFilters',
SEARCH_SAVED_SEARCH: 'SearchSavedSearch',
SETTINGS_CATEGORIES: 'SettingsCategories',
Expand All @@ -261,10 +259,8 @@ const SCREENS = {
REPORT_CHANGE_APPROVER: 'Report_Change_Approver',
REPORT_VERIFY_ACCOUNT: 'Report_Verify_Account',
MERGE_TRANSACTION: 'MergeTransaction',
EXPENSE_REPORT: 'ExpenseReport',
DOMAIN: 'Domain',
},
EXPENSE_REPORT_RHP: 'Expense_Report_RHP',
PUBLIC_CONSOLE_DEBUG: 'Console_Debug',
SIGN_IN_WITH_APPLE_DESKTOP: 'AppleSignInDesktop',
SIGN_IN_WITH_GOOGLE_DESKTOP: 'GoogleSignInDesktop',
Expand Down
18 changes: 6 additions & 12 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import Log from '@libs/Log';
import {getThreadReportIDsForTransactions, getTotalAmountForIOUReportPreviewButton} from '@libs/MoneyRequestReportUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackRouteProp} from '@libs/Navigation/PlatformStackNavigation/types';
import type {ReportsSplitNavigatorParamList, SearchMoneyRequestReportParamList, SearchReportParamList} from '@libs/Navigation/types';
import type {ReportsSplitNavigatorParamList, SearchFullscreenNavigatorParamList, SearchReportParamList} from '@libs/Navigation/types';
import {buildOptimisticNextStepForPreventSelfApprovalsEnabled, buildOptimisticNextStepForStrictPolicyRuleViolations} from '@libs/NextStepUtils';
import type {KYCFlowEvent, TriggerKYCFlow} from '@libs/PaymentUtils';
import {selectPaymentType} from '@libs/PaymentUtils';
Expand Down Expand Up @@ -185,7 +185,7 @@ function MoneyReportHeader({
const shouldDisplayNarrowVersion = shouldUseNarrowLayout || isMediumScreenWidth;
const route = useRoute<
| PlatformStackRouteProp<ReportsSplitNavigatorParamList, typeof SCREENS.REPORT>
| PlatformStackRouteProp<SearchMoneyRequestReportParamList, typeof SCREENS.SEARCH.MONEY_REQUEST_REPORT>
| PlatformStackRouteProp<SearchFullscreenNavigatorParamList, typeof SCREENS.SEARCH.MONEY_REQUEST_REPORT>
| PlatformStackRouteProp<SearchReportParamList, typeof SCREENS.SEARCH.REPORT_RHP>
>();
const {login: currentUserLogin, accountID, email} = useCurrentUserPersonalDetails();
Expand Down Expand Up @@ -352,9 +352,9 @@ function MoneyReportHeader({
const {selectedTransactionIDs, removeTransaction, clearSelectedTransactions, currentSearchQueryJSON, currentSearchKey, currentSearchHash} = useSearchContext();
const shouldCalculateTotals = useSearchShouldCalculateTotals(currentSearchKey, currentSearchQueryJSON?.similarSearchHash, true);

const {wideRHPRouteKeys, superWideRHPRouteKeys} = useContext(WideRHPContext);
const {wideRHPRouteKeys} = useContext(WideRHPContext);
const [network] = useOnyx(ONYXKEYS.NETWORK, {canBeMissing: true});
const shouldDisplayNarrowMoreButton = !shouldDisplayNarrowVersion || ((wideRHPRouteKeys.length > 0 || superWideRHPRouteKeys.length > 0) && !isSmallScreenWidth);
const shouldDisplayNarrowMoreButton = !shouldDisplayNarrowVersion || (wideRHPRouteKeys.length > 0 && !isSmallScreenWidth);

const showExportProgressModal = useCallback(() => {
return showConfirmModal({
Expand Down Expand Up @@ -1392,7 +1392,7 @@ function MoneyReportHeader({

const showNextStepBar = shouldShowNextStep && !!optimisticNextStep?.message?.length;
const showNextStepSkeleton = shouldShowNextStep && !optimisticNextStep && !!isLoadingInitialReportActions && !isOffline;
const shouldShowMoreContent = showNextStepBar || showNextStepSkeleton || !!statusBarProps || (isReportInSearch && !shouldDisplayNarrowMoreButton);
const shouldShowMoreContent = showNextStepBar || showNextStepSkeleton || !!statusBarProps || isReportInSearch;

return (
<View style={[styles.pt0, styles.borderBottom]}>
Expand Down Expand Up @@ -1433,12 +1433,6 @@ function MoneyReportHeader({
/>
</View>
)}
{isReportInSearch && (
<MoneyRequestReportNavigation
reportID={moneyRequestReport?.reportID}
shouldDisplayNarrowVersion={!shouldDisplayNarrowMoreButton}
/>
)}
</View>
)}
</HeaderWithBackButton>
Expand Down Expand Up @@ -1483,7 +1477,7 @@ function MoneyReportHeader({
/>
)}
</View>
{isReportInSearch && !shouldDisplayNarrowMoreButton && (
{isReportInSearch && (
<MoneyRequestReportNavigation
reportID={moneyRequestReport?.reportID}
shouldDisplayNarrowVersion={shouldDisplayNarrowVersion}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {isUserValidatedSelector} from '@selectors/Account';
import {accountIDSelector} from '@selectors/Session';
import {tierNameSelector} from '@selectors/UserWallet';
import isEmpty from 'lodash/isEmpty';
import React, {useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState} from 'react';
import React, {useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState} from 'react';
import type {NativeScrollEvent, NativeSyntheticEvent} from 'react-native';
import {DeviceEventEmitter, InteractionManager, View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
Expand All @@ -20,7 +20,6 @@ import {PressableWithFeedback} from '@components/Pressable';
import ScrollView from '@components/ScrollView';
import {useSearchContext} from '@components/Search/SearchContext';
import Text from '@components/Text';
import {WideRHPContext} from '@components/WideRHPContextProvider';
import useLoadReportActions from '@hooks/useLoadReportActions';
import useLocalize from '@hooks/useLocalize';
import useMobileSelectionMode from '@hooks/useMobileSelectionMode';
Expand Down Expand Up @@ -166,10 +165,7 @@ function MoneyRequestReportActionsList({
const isReportArchived = useReportIsArchived(reportID);
const canPerformWriteAction = canUserPerformWriteAction(report, isReportArchived);

// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {shouldUseNarrowLayout: shouldUseNarrowLayoutByDefault, isSmallScreenWidth} = useResponsiveLayout();
const {superWideRHPRouteKeys} = useContext(WideRHPContext);
const shouldUseNarrowLayout = shouldUseNarrowLayoutByDefault && (superWideRHPRouteKeys.length === 0 || isSmallScreenWidth);
const {shouldUseNarrowLayout} = useResponsiveLayout();

const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false});
const [offlineModalVisible, setOfflineModalVisible] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React, {useContext, useEffect, useMemo, useRef} from 'react';
import React, {useEffect, useMemo, useRef} from 'react';
import type {View} from 'react-native';
import {getButtonRole} from '@components/Button/utils';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import {PressableWithFeedback} from '@components/Pressable';
import type {SearchColumnType, TableColumnSize} from '@components/Search/types';
import {getExpenseHeaders} from '@components/SelectionListWithSections/SearchTableHeader';
import TransactionItemRow from '@components/TransactionItemRow';
import {WideRHPContext} from '@components/WideRHPContextProvider';
import useAnimatedHighlightStyle from '@hooks/useAnimatedHighlightStyle';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
Expand Down Expand Up @@ -87,9 +86,7 @@ function MoneyRequestReportTransactionItem({
const {translate} = useLocalize();
const styles = useThemeStyles();
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {isSmallScreenWidth, isMediumScreenWidth, isLargeScreenWidth, shouldUseNarrowLayout: shouldUseNarrowLayoutByDefault} = useResponsiveLayout();
const {superWideRHPRouteKeys} = useContext(WideRHPContext);
const shouldUseNarrowLayout = shouldUseNarrowLayoutByDefault && (superWideRHPRouteKeys.length === 0 || isSmallScreenWidth);
const {isSmallScreenWidth, isMediumScreenWidth, isLargeScreenWidth, shouldUseNarrowLayout} = useResponsiveLayout();
const theme = useTheme();
const isPendingDelete = isTransactionPendingDelete(transaction);
const pendingAction = getTransactionPendingAction(transaction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type {TupleToUnion} from 'type-fest';
import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu';
import Checkbox from '@components/Checkbox';
import * as Expensicons from '@components/Icon/Expensicons';

Check warning on line 8 in src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used by a pattern. Direct imports from Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details

Check warning on line 8 in src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used. Direct imports from @components/Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details
import MenuItem from '@components/MenuItem';
import Modal from '@components/Modal';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
Expand Down Expand Up @@ -161,9 +161,7 @@
const StyleUtils = useStyleUtils();
const {translate, localeCompare} = useLocalize();
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {shouldUseNarrowLayout: shouldUseNarrowLayoutByDefault, isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout();
const {superWideRHPRouteKeys} = useContext(WideRHPContext);
const shouldUseNarrowLayout = shouldUseNarrowLayoutByDefault && (superWideRHPRouteKeys.length === 0 || isSmallScreenWidth);
const {shouldUseNarrowLayout, isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout();
const {markReportIDAsExpense} = useContext(WideRHPContext);
const [isModalVisible, setIsModalVisible] = useState(false);
const [selectedTransactionID, setSelectedTransactionID] = useState<string>('');
Expand Down
Loading
Loading