@@ -115,19 +115,20 @@ function WorkspaceReceiptPartnersPage({route}: WorkspaceReceiptPartnersPageProps
115115 ( integration : string ) => {
116116 switch ( integration ) {
117117 case CONST . POLICY . RECEIPT_PARTNERS . NAME . UBER :
118+ if ( shouldShowEnterCredentialsError ) {
119+ return [
120+ {
121+ icon : Expensicons . Key ,
122+ text : translate ( 'workspace.accounting.enterCredentials' ) ,
123+ onSelected : ( ) => startIntegrationFlow ( { name : CONST . POLICY . RECEIPT_PARTNERS . NAME . UBER } ) ,
124+ shouldCallAfterModalHide : true ,
125+ disabled : isOffline ,
126+ iconRight : Expensicons . NewWindow ,
127+ } ,
128+ ] ;
129+ }
130+
118131 return [
119- ...( shouldShowEnterCredentialsError
120- ? [
121- {
122- icon : Expensicons . Key ,
123- text : translate ( 'workspace.accounting.enterCredentials' ) ,
124- onSelected : ( ) => startIntegrationFlow ( { name : CONST . POLICY . RECEIPT_PARTNERS . NAME . UBER } ) ,
125- shouldCallAfterModalHide : true ,
126- disabled : isOffline ,
127- iconRight : Expensicons . NewWindow ,
128- } ,
129- ]
130- : [ ] ) ,
131132 {
132133 icon : Expensicons . Trashcan ,
133134 text : translate ( 'workspace.accounting.disconnect' ) ,
@@ -188,27 +189,28 @@ function WorkspaceReceiptPartnersPage({route}: WorkspaceReceiptPartnersPageProps
188189 titleContainerStyle : [ styles . pr2 ] ,
189190 description : integrationData ?. description ,
190191 brickRoadIndicator : ! ! integrationData ?. errorFields || shouldShowEnterCredentialsError ? CONST . BRICK_ROAD_INDICATOR_STATUS . ERROR : undefined ,
191- rightComponent : isUberConnected ? (
192- < View ref = { threeDotsMenuContainerRef } >
193- < ThreeDotsMenu
194- getAnchorPosition = { calculateAndSetThreeDotsMenuPosition }
195- menuItems = { overflowMenu }
196- anchorAlignment = { {
197- horizontal : CONST . MODAL . ANCHOR_ORIGIN_HORIZONTAL . RIGHT ,
198- vertical : CONST . MODAL . ANCHOR_ORIGIN_VERTICAL . TOP ,
199- } }
192+ rightComponent :
193+ isUberConnected || shouldShowEnterCredentialsError ? (
194+ < View ref = { threeDotsMenuContainerRef } >
195+ < ThreeDotsMenu
196+ getAnchorPosition = { calculateAndSetThreeDotsMenuPosition }
197+ menuItems = { overflowMenu }
198+ anchorAlignment = { {
199+ horizontal : CONST . MODAL . ANCHOR_ORIGIN_HORIZONTAL . RIGHT ,
200+ vertical : CONST . MODAL . ANCHOR_ORIGIN_VERTICAL . TOP ,
201+ } }
202+ />
203+ </ View >
204+ ) : (
205+ < Button
206+ onPress = { ( ) => startIntegrationFlow ( { name : integration } ) }
207+ text = { translate ( 'workspace.accounting.setup' ) }
208+ style = { styles . justifyContentCenter }
209+ small
210+ isLoading = { ! policy ?. receiptPartners ?. uber }
211+ isDisabled = { isOffline }
200212 />
201- </ View >
202- ) : (
203- < Button
204- onPress = { ( ) => startIntegrationFlow ( { name : integration } ) }
205- text = { translate ( 'workspace.accounting.setup' ) }
206- style = { styles . justifyContentCenter }
207- small
208- isLoading = { ! policy ?. receiptPartners ?. uber }
209- isDisabled = { isOffline }
210- />
211- ) ,
213+ ) ,
212214 } ;
213215 } )
214216 . filter ( Boolean ) as MenuItemData [ ] ;
0 commit comments