-
Notifications
You must be signed in to change notification settings - Fork 4k
Add Super Wide RHP Routes #75886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Super Wide RHP Routes #75886
Changes from all commits
e557808
50bb8d4
9c86a1c
f0ecfd7
b391b8e
bf8a69e
f0f5924
431b47f
f8d2e13
fc9b40c
c7a7ef9
0672f55
8d7fd25
7bfccf3
9fad2be
c31d9dc
01eee9a
c5b43e5
f3cf45d
60af655
be28323
1385ca5
87f53f7
48f3a8e
4b4036f
70d2eb0
2e635fc
a943a74
d57f6d7
85d0044
219b793
732b590
ba05195
799f54e
1124843
6c3fab3
834c72c
9c476b8
08a2d08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ import usePermissions from '@hooks/usePermissions'; | |
| import usePolicy from '@hooks/usePolicy'; | ||
| import useReportIsArchived from '@hooks/useReportIsArchived'; | ||
| import useResponsiveLayout from '@hooks/useResponsiveLayout'; | ||
| import useResponsiveLayoutOnWideRHP from '@hooks/useResponsiveLayoutOnWideRHP'; | ||
| import useSearchShouldCalculateTotals from '@hooks/useSearchShouldCalculateTotals'; | ||
| import useSelectedTransactionsActions from '@hooks/useSelectedTransactionsActions'; | ||
| import useStrictPolicyRules from '@hooks/useStrictPolicyRules'; | ||
|
|
@@ -44,7 +45,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, SearchFullscreenNavigatorParamList, SearchReportParamList} from '@libs/Navigation/types'; | ||
| import type {ReportsSplitNavigatorParamList, SearchMoneyRequestReportParamList, SearchReportParamList} from '@libs/Navigation/types'; | ||
| import {buildOptimisticNextStepForPreventSelfApprovalsEnabled, buildOptimisticNextStepForStrictPolicyRuleViolations} from '@libs/NextStepUtils'; | ||
| import type {KYCFlowEvent, TriggerKYCFlow} from '@libs/PaymentUtils'; | ||
| import {selectPaymentType} from '@libs/PaymentUtils'; | ||
|
|
@@ -151,7 +152,6 @@ import ProcessMoneyReportHoldMenu from './ProcessMoneyReportHoldMenu'; | |
| import {useSearchContext} from './Search/SearchContext'; | ||
| import AnimatedSettlementButton from './SettlementButton/AnimatedSettlementButton'; | ||
| import Text from './Text'; | ||
| import {WideRHPContext} from './WideRHPContextProvider'; | ||
|
|
||
| type MoneyReportHeaderProps = { | ||
| /** The report currently being looked at */ | ||
|
|
@@ -192,7 +192,7 @@ function MoneyReportHeader({ | |
| const shouldDisplayNarrowVersion = shouldUseNarrowLayout || isMediumScreenWidth; | ||
| const route = useRoute< | ||
| | PlatformStackRouteProp<ReportsSplitNavigatorParamList, typeof SCREENS.REPORT> | ||
| | PlatformStackRouteProp<SearchFullscreenNavigatorParamList, typeof SCREENS.SEARCH.MONEY_REQUEST_REPORT> | ||
| | PlatformStackRouteProp<SearchMoneyRequestReportParamList, typeof SCREENS.SEARCH.MONEY_REQUEST_REPORT> | ||
| | PlatformStackRouteProp<SearchReportParamList, typeof SCREENS.SEARCH.REPORT_RHP> | ||
| >(); | ||
| const {login: currentUserLogin, accountID, email} = useCurrentUserPersonalDetails(); | ||
|
|
@@ -387,9 +387,11 @@ function MoneyReportHeader({ | |
| const shouldCalculateTotals = useSearchShouldCalculateTotals(currentSearchKey, currentSearchQueryJSON?.similarSearchHash, true); | ||
| const [currentSearchResults] = useOnyx(`${ONYXKEYS.COLLECTION.SNAPSHOT}${currentSearchQueryJSON?.hash}`, {canBeMissing: true}); | ||
|
|
||
| const {wideRHPRouteKeys} = useContext(WideRHPContext); | ||
| const [network] = useOnyx(ONYXKEYS.NETWORK, {canBeMissing: true}); | ||
| const shouldDisplayNarrowMoreButton = !shouldDisplayNarrowVersion || (wideRHPRouteKeys.length > 0 && !isSmallScreenWidth); | ||
|
|
||
| const {isWideRHPDisplayedOnWideLayout, isSuperWideRHPDisplayedOnWideLayout} = useResponsiveLayoutOnWideRHP(); | ||
|
|
||
| const shouldDisplayNarrowMoreButton = !shouldDisplayNarrowVersion || isWideRHPDisplayedOnWideLayout || isSuperWideRHPDisplayedOnWideLayout; | ||
|
|
||
| const showExportProgressModal = useCallback(() => { | ||
| return showConfirmModal({ | ||
|
|
@@ -1417,7 +1419,9 @@ function MoneyReportHeader({ | |
| const backToRoute = route.params?.backTo ?? (chatReport?.reportID ? ROUTES.REPORT_WITH_ID.getRoute(chatReport.reportID) : undefined); | ||
| Navigation.goBack(backToRoute); | ||
| } | ||
| handleDeleteTransactions(); | ||
| // It has been handled like the rest of the delete cases. It will be refactored along with other cases. | ||
| // eslint-disable-next-line @typescript-eslint/no-deprecated | ||
| InteractionManager.runAfterInteractions(() => handleDeleteTransactions()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we try to use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, we already tried several approaches to remove |
||
| }); | ||
| }, [showConfirmModal, translate, selectedTransactionIDs.length, transactions, handleDeleteTransactions, route.params?.backTo, chatReport?.reportID]); | ||
|
|
||
|
|
@@ -1587,7 +1591,7 @@ function MoneyReportHeader({ | |
| {isReportInSearch && ( | ||
| <MoneyRequestReportNavigation | ||
| reportID={moneyRequestReport?.reportID} | ||
| shouldDisplayNarrowVersion={shouldDisplayNarrowVersion} | ||
| shouldDisplayNarrowVersion={!shouldDisplayNarrowMoreButton} | ||
| /> | ||
| )} | ||
| </View> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a link to the issue that handles this refactoring?