@@ -30,6 +30,7 @@ import useOnyx from '@hooks/useOnyx';
3030import usePaginatedReportActions from '@hooks/usePaginatedReportActions' ;
3131import usePermissions from '@hooks/usePermissions' ;
3232import useReportIsArchived from '@hooks/useReportIsArchived' ;
33+ import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
3334import useThemeStyles from '@hooks/useThemeStyles' ;
3435import getBase62ReportID from '@libs/getBase62ReportID' ;
3536import Navigation from '@libs/Navigation/Navigation' ;
@@ -161,6 +162,7 @@ function ReportDetailsPage({policy, report, route, reportMetadata}: ReportDetail
161162 const { removeTransaction} = useSearchContext ( ) ;
162163
163164 const transactionThreadReportID = useMemo ( ( ) => getOneTransactionThreadReportID ( report , chatReport , reportActions ?? [ ] , isOffline ) , [ reportActions , isOffline , report , chatReport ] ) ;
165+ const { shouldUseNarrowLayout} = useResponsiveLayout ( ) ;
164166
165167 /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
166168 const [ transactionThreadReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ transactionThreadReportID } ` , { canBeMissing : true } ) ;
@@ -472,7 +474,11 @@ function ReportDetailsPage({policy, report, route, reportMetadata}: ReportDetail
472474 if ( ! report ?. policyID ) {
473475 return ;
474476 }
475- Navigation . navigate ( ROUTES . WORKSPACE_INITIAL . getRoute ( report ?. policyID , Navigation . getActiveRoute ( ) ) ) ;
477+ if ( shouldUseNarrowLayout ) {
478+ Navigation . navigate ( ROUTES . WORKSPACE_INITIAL . getRoute ( report ?. policyID , Navigation . getActiveRoute ( ) ) ) ;
479+ } else {
480+ Navigation . navigate ( ROUTES . WORKSPACE_OVERVIEW . getRoute ( report ?. policyID ) ) ;
481+ }
476482 } ,
477483 isAnonymousAction : false ,
478484 shouldShowRightIcon : true ,
@@ -541,6 +547,7 @@ function ReportDetailsPage({policy, report, route, reportMetadata}: ReportDetail
541547 isTaskActionable ,
542548 isRootGroupChat ,
543549 leaveChat ,
550+ shouldUseNarrowLayout ,
544551 ] ) ;
545552
546553 const displayNamesWithTooltips = useMemo ( ( ) => {
0 commit comments