11import React , { useState } from 'react' ;
2- import { View } from 'react-native' ;
3- import FullPageOfflineBlockingView from '@components/BlockingViews/FullPageOfflineBlockingView' ;
42import ConfirmModal from '@components/ConfirmModal' ;
53import HeaderWithBackButton from '@components/HeaderWithBackButton' ;
64import * as Expensicons from '@components/Icon/Expensicons' ;
@@ -47,8 +45,6 @@ function WorkspacePerDiemDetailsPage({route}: WorkspacePerDiemDetailsPageProps)
4745 const amountValue = selectedSubRate ?. rate ? convertToDisplayStringWithoutCurrency ( Number ( selectedSubRate . rate ) ) : undefined ;
4846 const currencyValue = selectedRate ?. currency ? `${ selectedRate . currency } - ${ getCurrencySymbol ( selectedRate . currency ) } ` : undefined ;
4947
50- const FullPageBlockingView = isEmptyObject ( selectedSubRate ) ? FullPageOfflineBlockingView : View ;
51-
5248 const handleDeletePerDiemRate = ( ) => {
5349 deleteWorkspacePerDiemRates ( policyID , customUnit , [
5450 {
@@ -69,6 +65,7 @@ function WorkspacePerDiemDetailsPage({route}: WorkspacePerDiemDetailsPageProps)
6965 accessVariants = { [ CONST . POLICY . ACCESS_VARIANTS . ADMIN , CONST . POLICY . ACCESS_VARIANTS . CONTROL ] }
7066 policyID = { policyID }
7167 featureName = { CONST . POLICY . MORE_FEATURES . ARE_PER_DIEM_RATES_ENABLED }
68+ shouldBeBlocked = { isEmptyObject ( selectedSubRate ) }
7269 >
7370 < ScreenWrapper
7471 enableEdgeToEdgeBottomSafeAreaPadding
@@ -86,46 +83,41 @@ function WorkspacePerDiemDetailsPage({route}: WorkspacePerDiemDetailsPageProps)
8683 cancelText = { translate ( 'common.cancel' ) }
8784 danger
8885 />
89- < FullPageBlockingView
90- style = { ! isEmptyObject ( selectedSubRate ) ? styles . flexGrow1 : [ ] }
86+ < ScrollView
9187 addBottomSafeAreaPadding
88+ contentContainerStyle = { styles . flexGrow1 }
89+ keyboardShouldPersistTaps = "always"
9290 >
93- < ScrollView
94- addBottomSafeAreaPadding
95- contentContainerStyle = { styles . flexGrow1 }
96- keyboardShouldPersistTaps = "always"
97- >
98- < MenuItemWithTopDescription
99- title = { selectedRate ?. name }
100- description = { translate ( 'common.destination' ) }
101- onPress = { ( ) => Navigation . navigate ( ROUTES . WORKSPACE_PER_DIEM_EDIT_DESTINATION . getRoute ( policyID , rateID , subRateID ) ) }
102- shouldShowRightIcon
103- />
104- < MenuItemWithTopDescription
105- title = { selectedSubRate ?. name }
106- description = { translate ( 'common.subrate' ) }
107- onPress = { ( ) => Navigation . navigate ( ROUTES . WORKSPACE_PER_DIEM_EDIT_SUBRATE . getRoute ( policyID , rateID , subRateID ) ) }
108- shouldShowRightIcon
109- />
110- < MenuItemWithTopDescription
111- title = { amountValue }
112- description = { translate ( 'workspace.perDiem.amount' ) }
113- onPress = { ( ) => Navigation . navigate ( ROUTES . WORKSPACE_PER_DIEM_EDIT_AMOUNT . getRoute ( policyID , rateID , subRateID ) ) }
114- shouldShowRightIcon
115- />
116- < MenuItemWithTopDescription
117- title = { currencyValue }
118- description = { translate ( 'common.currency' ) }
119- onPress = { ( ) => Navigation . navigate ( ROUTES . WORKSPACE_PER_DIEM_EDIT_CURRENCY . getRoute ( policyID , rateID , subRateID ) ) }
120- shouldShowRightIcon
121- />
122- < MenuItem
123- icon = { Expensicons . Trashcan }
124- title = { translate ( 'common.delete' ) }
125- onPress = { ( ) => setDeletePerDiemConfirmModalVisible ( true ) }
126- />
127- </ ScrollView >
128- </ FullPageBlockingView >
91+ < MenuItemWithTopDescription
92+ title = { selectedRate ?. name }
93+ description = { translate ( 'common.destination' ) }
94+ onPress = { ( ) => Navigation . navigate ( ROUTES . WORKSPACE_PER_DIEM_EDIT_DESTINATION . getRoute ( policyID , rateID , subRateID ) ) }
95+ shouldShowRightIcon
96+ />
97+ < MenuItemWithTopDescription
98+ title = { selectedSubRate ?. name }
99+ description = { translate ( 'common.subrate' ) }
100+ onPress = { ( ) => Navigation . navigate ( ROUTES . WORKSPACE_PER_DIEM_EDIT_SUBRATE . getRoute ( policyID , rateID , subRateID ) ) }
101+ shouldShowRightIcon
102+ />
103+ < MenuItemWithTopDescription
104+ title = { amountValue }
105+ description = { translate ( 'workspace.perDiem.amount' ) }
106+ onPress = { ( ) => Navigation . navigate ( ROUTES . WORKSPACE_PER_DIEM_EDIT_AMOUNT . getRoute ( policyID , rateID , subRateID ) ) }
107+ shouldShowRightIcon
108+ />
109+ < MenuItemWithTopDescription
110+ title = { currencyValue }
111+ description = { translate ( 'common.currency' ) }
112+ onPress = { ( ) => Navigation . navigate ( ROUTES . WORKSPACE_PER_DIEM_EDIT_CURRENCY . getRoute ( policyID , rateID , subRateID ) ) }
113+ shouldShowRightIcon
114+ />
115+ < MenuItem
116+ icon = { Expensicons . Trashcan }
117+ title = { translate ( 'common.delete' ) }
118+ onPress = { ( ) => setDeletePerDiemConfirmModalVisible ( true ) }
119+ />
120+ </ ScrollView >
129121 </ ScreenWrapper >
130122 </ AccessOrNotFoundWrapper >
131123 ) ;
0 commit comments