@@ -16,9 +16,9 @@ import useStyleUtils from '@hooks/useStyleUtils';
16
16
import useTheme from '@hooks/useTheme' ;
17
17
import useThemeStyles from '@hooks/useThemeStyles' ;
18
18
import type { TravelNavigatorParamList } from '@libs/Navigation/types' ;
19
- import * as ReportUtils from '@libs/ReportUtils' ;
20
- import * as TripReservationUtils from '@libs/TripReservationUtils' ;
21
- import * as Link from '@userActions/Link' ;
19
+ import { getTripIDFromTransactionParentReportID } from '@libs/ReportUtils' ;
20
+ import { getTripReservationIcon } from '@libs/TripReservationUtils' ;
21
+ import { openTravelDotLink } from '@userActions/Link' ;
22
22
import CONST from '@src/CONST' ;
23
23
import ONYXKEYS from '@src/ONYXKEYS' ;
24
24
import type SCREENS from '@src/SCREENS' ;
@@ -40,7 +40,7 @@ function TripDetailsPage({route}: TripDetailsPageProps) {
40
40
const styles = useThemeStyles ( ) ;
41
41
const StyleUtils = useStyleUtils ( ) ;
42
42
const { translate} = useLocalize ( ) ;
43
- const { canUseSpotnanaTravel} = usePermissions ( ) ;
43
+ const { canUseSpotnanaTravel, isBlockedFromSpotnanaTravel } = usePermissions ( ) ;
44
44
const { isOffline} = useNetwork ( ) ;
45
45
46
46
const [ isModifyTripLoading , setIsModifyTripLoading ] = useState ( false ) ;
@@ -51,10 +51,10 @@ function TripDetailsPage({route}: TripDetailsPageProps) {
51
51
const [ report ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ transaction ?. reportID ?? CONST . DEFAULT_NUMBER_ID } ` ) ;
52
52
const [ parentReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ report ?. parentReportID ?? CONST . DEFAULT_NUMBER_ID } ` ) ;
53
53
54
- const tripID = ReportUtils . getTripIDFromTransactionParentReportID ( parentReport ?. reportID ) ;
54
+ const tripID = getTripIDFromTransactionParentReportID ( parentReport ?. reportID ) ;
55
55
const reservationType = transaction ?. receipt ?. reservationList ?. at ( route . params . reservationIndex ?? 0 ) ?. type ;
56
56
const reservation = transaction ?. receipt ?. reservationList ?. at ( route . params . reservationIndex ?? 0 ) ;
57
- const reservationIcon = TripReservationUtils . getTripReservationIcon ( reservation ?. type ) ;
57
+ const reservationIcon = getTripReservationIcon ( reservation ?. type ) ;
58
58
const [ travelerPersonalDetails ] = useOnyx ( ONYXKEYS . PERSONAL_DETAILS_LIST , { selector : ( personalDetails ) => pickTravelerPersonalDetails ( personalDetails , reservation ) } ) ;
59
59
60
60
return (
@@ -67,7 +67,7 @@ function TripDetailsPage({route}: TripDetailsPageProps) {
67
67
>
68
68
< FullPageNotFoundView
69
69
shouldForceFullScreen
70
- shouldShow = { ! reservation || ( ! canUseSpotnanaTravel && ! NativeModules . HybridAppModule ) }
70
+ shouldShow = { ! reservation || ( ! canUseSpotnanaTravel && ! NativeModules . HybridAppModule ) || ( isBlockedFromSpotnanaTravel && ! NativeModules . HybridAppModule ) }
71
71
>
72
72
< HeaderWithBackButton
73
73
title = { reservationType ? `${ translate ( `travel.${ reservationType } ` ) } ${ translate ( 'common.details' ) . toLowerCase ( ) } ` : translate ( 'common.details' ) }
@@ -112,7 +112,7 @@ function TripDetailsPage({route}: TripDetailsPageProps) {
112
112
shouldShowRightIcon
113
113
onPress = { ( ) => {
114
114
setIsModifyTripLoading ( true ) ;
115
- Link . openTravelDotLink ( activePolicyID , CONST . TRIP_ID_PATH ( tripID ) ) ?. finally ( ( ) => {
115
+ openTravelDotLink ( activePolicyID , CONST . TRIP_ID_PATH ( tripID ) ) ?. finally ( ( ) => {
116
116
setIsModifyTripLoading ( false ) ;
117
117
} ) ;
118
118
} }
@@ -128,7 +128,7 @@ function TripDetailsPage({route}: TripDetailsPageProps) {
128
128
shouldShowRightIcon
129
129
onPress = { ( ) => {
130
130
setIsTripSupportLoading ( true ) ;
131
- Link . openTravelDotLink ( activePolicyID , CONST . TRIP_SUPPORT ) ?. finally ( ( ) => {
131
+ openTravelDotLink ( activePolicyID , CONST . TRIP_SUPPORT ) ?. finally ( ( ) => {
132
132
setIsTripSupportLoading ( false ) ;
133
133
} ) ;
134
134
} }
0 commit comments