@@ -17,15 +17,15 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
17
17
import useTheme from '@hooks/useTheme' ;
18
18
import useThemeStyles from '@hooks/useThemeStyles' ;
19
19
import useWindowDimensions from '@hooks/useWindowDimensions' ;
20
- import * as Browser from '@libs/Browser' ;
20
+ import { isSafari } from '@libs/Browser' ;
21
21
import getIconForAction from '@libs/getIconForAction' ;
22
22
import Navigation from '@libs/Navigation/Navigation' ;
23
- import * as ReportUtils from '@libs/ReportUtils' ;
24
- import * as SubscriptionUtils from '@libs/SubscriptionUtils' ;
25
- import * as IOU from '@userActions/IOU' ;
26
- import * as Modal from '@userActions/Modal' ;
27
- import * as Report from '@userActions/Report' ;
28
- import * as Task from '@userActions/Task' ;
23
+ import { canCreateTaskInReport , getPayeeName , temporary_getMoneyRequestOptions } from '@libs/ReportUtils' ;
24
+ import { shouldRestrictUserBillableActions } from '@libs/SubscriptionUtils' ;
25
+ import { startMoneyRequest } from '@userActions/IOU' ;
26
+ import { close } from '@userActions/Modal' ;
27
+ import { setIsComposerFullSize } from '@userActions/Report' ;
28
+ import { clearOutTaskInfoAndNavigate } from '@userActions/Task' ;
29
29
import DelegateNoAccessModal from '@src/components/DelegateNoAccessModal' ;
30
30
import type { IOUType } from '@src/CONST' ;
31
31
import CONST from '@src/CONST' ;
@@ -126,7 +126,7 @@ function AttachmentPickerWithMenuItems({
126
126
*/
127
127
const moneyRequestOptions = useMemo ( ( ) => {
128
128
const selectOption = ( onSelected : ( ) => void , shouldRestrictAction : boolean ) => {
129
- if ( shouldRestrictAction && policy && SubscriptionUtils . shouldRestrictUserBillableActions ( policy . id ) ) {
129
+ if ( shouldRestrictAction && policy && shouldRestrictUserBillableActions ( policy . id ) ) {
130
130
Navigation . navigate ( ROUTES . RESTRICTED_ACTION . getRoute ( policy . id ) ) ;
131
131
return ;
132
132
}
@@ -138,37 +138,37 @@ function AttachmentPickerWithMenuItems({
138
138
[ CONST . IOU . TYPE . SPLIT ] : {
139
139
icon : Expensicons . Transfer ,
140
140
text : translate ( 'iou.splitExpense' ) ,
141
- onSelected : ( ) => selectOption ( ( ) => IOU . startMoneyRequest ( CONST . IOU . TYPE . SPLIT , report ?. reportID ?? String ( CONST . DEFAULT_NUMBER_ID ) ) , true ) ,
141
+ onSelected : ( ) => selectOption ( ( ) => startMoneyRequest ( CONST . IOU . TYPE . SPLIT , report ?. reportID ?? String ( CONST . DEFAULT_NUMBER_ID ) ) , true ) ,
142
142
} ,
143
143
[ CONST . IOU . TYPE . SUBMIT ] : {
144
144
icon : getIconForAction ( CONST . IOU . TYPE . CREATE ) ,
145
145
text : translate ( 'iou.createExpense' ) ,
146
- onSelected : ( ) => selectOption ( ( ) => IOU . startMoneyRequest ( CONST . IOU . TYPE . SUBMIT , report ?. reportID ?? String ( CONST . DEFAULT_NUMBER_ID ) ) , true ) ,
146
+ onSelected : ( ) => selectOption ( ( ) => startMoneyRequest ( CONST . IOU . TYPE . SUBMIT , report ?. reportID ?? String ( CONST . DEFAULT_NUMBER_ID ) ) , true ) ,
147
147
} ,
148
148
[ CONST . IOU . TYPE . PAY ] : {
149
149
icon : getIconForAction ( CONST . IOU . TYPE . SEND ) ,
150
- text : translate ( 'iou.paySomeone' , { name : ReportUtils . getPayeeName ( report ) } ) ,
150
+ text : translate ( 'iou.paySomeone' , { name : getPayeeName ( report ) } ) ,
151
151
onSelected : ( ) => {
152
152
if ( isDelegateAccessRestricted ) {
153
153
setIsNoDelegateAccessMenuVisible ( true ) ;
154
154
return ;
155
155
}
156
- selectOption ( ( ) => IOU . startMoneyRequest ( CONST . IOU . TYPE . PAY , report ?. reportID ?? String ( CONST . DEFAULT_NUMBER_ID ) ) , false ) ;
156
+ selectOption ( ( ) => startMoneyRequest ( CONST . IOU . TYPE . PAY , report ?. reportID ?? String ( CONST . DEFAULT_NUMBER_ID ) ) , false ) ;
157
157
} ,
158
158
} ,
159
159
[ CONST . IOU . TYPE . TRACK ] : {
160
160
icon : getIconForAction ( CONST . IOU . TYPE . CREATE ) ,
161
161
text : translate ( 'iou.createExpense' ) ,
162
- onSelected : ( ) => selectOption ( ( ) => IOU . startMoneyRequest ( CONST . IOU . TYPE . TRACK , report ?. reportID ?? String ( CONST . DEFAULT_NUMBER_ID ) ) , true ) ,
162
+ onSelected : ( ) => selectOption ( ( ) => startMoneyRequest ( CONST . IOU . TYPE . TRACK , report ?. reportID ?? String ( CONST . DEFAULT_NUMBER_ID ) ) , true ) ,
163
163
} ,
164
164
[ CONST . IOU . TYPE . INVOICE ] : {
165
165
icon : Expensicons . InvoiceGeneric ,
166
166
text : translate ( 'workspace.invoices.sendInvoice' ) ,
167
- onSelected : ( ) => selectOption ( ( ) => IOU . startMoneyRequest ( CONST . IOU . TYPE . INVOICE , report ?. reportID ?? String ( CONST . DEFAULT_NUMBER_ID ) ) , false ) ,
167
+ onSelected : ( ) => selectOption ( ( ) => startMoneyRequest ( CONST . IOU . TYPE . INVOICE , report ?. reportID ?? String ( CONST . DEFAULT_NUMBER_ID ) ) , false ) ,
168
168
} ,
169
169
} ;
170
170
171
- const moneyRequestOptionsList = ReportUtils . temporary_getMoneyRequestOptions ( report , policy , reportParticipantIDs ?? [ ] ) . map ( ( option ) => ( {
171
+ const moneyRequestOptionsList = temporary_getMoneyRequestOptions ( report , policy , reportParticipantIDs ?? [ ] ) . map ( ( option ) => ( {
172
172
...options [ option ] ,
173
173
} ) ) ;
174
174
@@ -179,15 +179,15 @@ function AttachmentPickerWithMenuItems({
179
179
* Determines if we can show the task option
180
180
*/
181
181
const taskOption : PopoverMenuItem [ ] = useMemo ( ( ) => {
182
- if ( ! ReportUtils . canCreateTaskInReport ( report ) ) {
182
+ if ( ! canCreateTaskInReport ( report ) ) {
183
183
return [ ] ;
184
184
}
185
185
186
186
return [
187
187
{
188
188
icon : Expensicons . Task ,
189
189
text : translate ( 'newTaskPage.assignTask' ) ,
190
- onSelected : ( ) => Task . clearOutTaskInfoAndNavigate ( reportID , report ) ,
190
+ onSelected : ( ) => clearOutTaskInfoAndNavigate ( reportID , report ) ,
191
191
} ,
192
192
] ;
193
193
} , [ report , reportID , translate ] ) ;
@@ -295,7 +295,7 @@ function AttachmentPickerWithMenuItems({
295
295
onPress = { ( e ) => {
296
296
e ?. preventDefault ( ) ;
297
297
raiseIsScrollLikelyLayoutTriggered ( ) ;
298
- Report . setIsComposerFullSize ( reportID , false ) ;
298
+ setIsComposerFullSize ( reportID , false ) ;
299
299
} }
300
300
// Keep focus on the composer when Collapse button is clicked.
301
301
onMouseDown = { ( e ) => e . preventDefault ( ) }
@@ -316,7 +316,7 @@ function AttachmentPickerWithMenuItems({
316
316
onPress = { ( e ) => {
317
317
e ?. preventDefault ( ) ;
318
318
raiseIsScrollLikelyLayoutTriggered ( ) ;
319
- Report . setIsComposerFullSize ( reportID , true ) ;
319
+ setIsComposerFullSize ( reportID , true ) ;
320
320
} }
321
321
// Keep focus on the composer when Expand button is clicked.
322
322
onMouseDown = { ( e ) => e . preventDefault ( ) }
@@ -347,11 +347,11 @@ function AttachmentPickerWithMenuItems({
347
347
// function must be called from within a event handler that was initiated
348
348
// by the user on Safari.
349
349
if ( index === menuItems . length - 1 ) {
350
- if ( Browser . isSafari ( ) ) {
350
+ if ( isSafari ( ) ) {
351
351
triggerAttachmentPicker ( ) ;
352
352
return ;
353
353
}
354
- Modal . close ( ( ) => {
354
+ close ( ( ) => {
355
355
triggerAttachmentPicker ( ) ;
356
356
} ) ;
357
357
}
0 commit comments