From 6752e493967ca128a95a8c8c9ace509c1c07189a Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Fri, 24 Jan 2025 00:53:40 +0530
Subject: [PATCH 01/14] change function name

---
 src/components/MenuItem.tsx                                   | 4 ++--
 src/components/PinButton.tsx                                  | 2 +-
 src/components/PromotedActionsBar.tsx                         | 2 +-
 src/components/Reactions/AddReactionBubble.tsx                | 2 +-
 src/components/Reactions/MiniQuickEmojiReactions.tsx          | 4 ++--
 .../Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx | 2 +-
 src/components/ReportActionItem/TaskPreview.tsx               | 2 +-
 src/components/ReportActionItem/TaskView.tsx                  | 4 ++--
 src/components/Search/SearchRouter/SearchButton.tsx           | 2 +-
 src/components/TaskHeaderActionButton.tsx                     | 2 +-
 src/libs/HeaderUtils.ts                                       | 2 +-
 src/libs/Navigation/AppNavigator/AuthScreens.tsx              | 4 ++--
 src/libs/actions/Session/index.ts                             | 4 ++--
 src/pages/FlagCommentPage.tsx                                 | 2 +-
 src/pages/ProfilePage.tsx                                     | 4 ++--
 src/pages/ReportDetailsPage.tsx                               | 4 ++--
 src/pages/home/HeaderView.tsx                                 | 4 ++--
 src/pages/workspace/WorkspacesListPage.tsx                    | 4 ++--
 18 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx
index 8492f18d2512..5564041d80cd 100644
--- a/src/components/MenuItem.tsx
+++ b/src/components/MenuItem.tsx
@@ -15,7 +15,7 @@ import getButtonState from '@libs/getButtonState';
 import Parser from '@libs/Parser';
 import type {AvatarSource} from '@libs/UserUtils';
 import variables from '@styles/variables';
-import {checkIfActionIsAllowed} from '@userActions/Session';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import type {Icon as IconType} from '@src/types/onyx/OnyxCommon';
 import type {TooltipAnchorAlignment} from '@src/types/utils/AnchorAlignment';
@@ -611,7 +611,7 @@ function MenuItem(
                     <Hoverable>
                         {(isHovered) => (
                             <PressableWithSecondaryInteraction
-                                onPress={shouldCheckActionAllowedOnPress ? checkIfActionIsAllowed(onPressAction, isAnonymousAction) : onPressAction}
+                                onPress={shouldCheckActionAllowedOnPress ? callFnIfActionIsAllowed(onPressAction, isAnonymousAction) : onPressAction}
                                 onPressIn={() => shouldBlockSelection && shouldUseNarrowLayout && canUseTouchScreen() && ControlSelection.block()}
                                 onPressOut={ControlSelection.unblock}
                                 onSecondaryInteraction={onSecondaryInteraction}
diff --git a/src/components/PinButton.tsx b/src/components/PinButton.tsx
index 2ae74853d571..f6b12053c976 100644
--- a/src/components/PinButton.tsx
+++ b/src/components/PinButton.tsx
@@ -24,7 +24,7 @@ function PinButton({report}: PinButtonProps) {
     return (
         <Tooltip text={report.isPinned ? translate('common.unPin') : translate('common.pin')}>
             <PressableWithFeedback
-                onPress={Session.checkIfActionIsAllowed(() => ReportActions.togglePinnedState(report.reportID, report.isPinned ?? false))}
+                onPress={Session.callFnIfActionIsAllowed(() => ReportActions.togglePinnedState(report.reportID, report.isPinned ?? false))}
                 style={styles.touchableButtonImage}
                 accessibilityLabel={report.isPinned ? translate('common.unPin') : translate('common.pin')}
                 role={CONST.ROLE.BUTTON}
diff --git a/src/components/PromotedActionsBar.tsx b/src/components/PromotedActionsBar.tsx
index e6ce3080ee0a..de1f38eb8ec3 100644
--- a/src/components/PromotedActionsBar.tsx
+++ b/src/components/PromotedActionsBar.tsx
@@ -54,7 +54,7 @@ const PromotedActions = {
         key: CONST.PROMOTED_ACTIONS.JOIN,
         icon: Expensicons.ChatBubbles,
         text: Localize.translateLocal('common.join'),
-        onSelected: Session.checkIfActionIsAllowed(() => {
+        onSelected: Session.callFnIfActionIsAllowed(() => {
             Navigation.dismissModal();
             ReportActions.joinRoom(report);
         }),
diff --git a/src/components/Reactions/AddReactionBubble.tsx b/src/components/Reactions/AddReactionBubble.tsx
index 8364a6658270..dce1892737ba 100644
--- a/src/components/Reactions/AddReactionBubble.tsx
+++ b/src/components/Reactions/AddReactionBubble.tsx
@@ -90,7 +90,7 @@ function AddReactionBubble({onSelectEmoji, reportAction, onPressOpenPicker, onWi
             <PressableWithFeedback
                 ref={ref}
                 style={({hovered, pressed}) => [styles.emojiReactionBubble, styles.userSelectNone, StyleUtils.getEmojiReactionBubbleStyle(hovered || pressed, false, isContextMenu)]}
-                onPress={Session.checkIfActionIsAllowed(onPress)}
+                onPress={Session.callFnIfActionIsAllowed(onPress)}
                 onMouseDown={(event) => {
                     // Allow text input blur when Add reaction is right clicked
                     if (!event || event.button === 2) {
diff --git a/src/components/Reactions/MiniQuickEmojiReactions.tsx b/src/components/Reactions/MiniQuickEmojiReactions.tsx
index 815736d8af76..931fddc387a4 100644
--- a/src/components/Reactions/MiniQuickEmojiReactions.tsx
+++ b/src/components/Reactions/MiniQuickEmojiReactions.tsx
@@ -67,7 +67,7 @@ function MiniQuickEmojiReactions({
                     key={emoji.name}
                     isDelayButtonStateComplete={false}
                     tooltipText={`:${EmojiUtils.getLocalizedEmojiName(emoji.name, preferredLocale)}:`}
-                    onPress={Session.checkIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
+                    onPress={Session.callFnIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
                 >
                     <Text
                         style={[styles.miniQuickEmojiReactionText, styles.userSelectNone]}
@@ -79,7 +79,7 @@ function MiniQuickEmojiReactions({
             ))}
             <BaseMiniContextMenuItem
                 ref={ref}
-                onPress={Session.checkIfActionIsAllowed(() => {
+                onPress={Session.callFnIfActionIsAllowed(() => {
                     if (!EmojiPickerAction.emojiPickerRef.current?.isEmojiPickerVisible) {
                         openEmojiPicker();
                     } else {
diff --git a/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx b/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
index 87968fa38261..862d426a3bcc 100644
--- a/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
+++ b/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
@@ -35,7 +35,7 @@ function BaseQuickEmojiReactions({
                         <EmojiReactionBubble
                             emojiCodes={[EmojiUtils.getPreferredEmojiCode(emoji, preferredSkinTone)]}
                             isContextMenu
-                            onPress={Session.checkIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
+                            onPress={Session.callFnIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
                         />
                     </View>
                 </Tooltip>
diff --git a/src/components/ReportActionItem/TaskPreview.tsx b/src/components/ReportActionItem/TaskPreview.tsx
index 2ea295d16143..3b3eebc158c3 100644
--- a/src/components/ReportActionItem/TaskPreview.tsx
+++ b/src/components/ReportActionItem/TaskPreview.tsx
@@ -108,7 +108,7 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che
                             style={[styles.mr2]}
                             isChecked={isTaskCompleted}
                             disabled={!Task.canActionTask(taskReport, currentUserPersonalDetails.accountID, taskOwnerAccountID, taskAssigneeAccountID)}
-                            onPress={Session.checkIfActionIsAllowed(() => {
+                            onPress={Session.callFnIfActionIsAllowed(() => {
                                 if (isTaskCompleted) {
                                     Task.reopenTask(taskReport, taskReportID);
                                 } else {
diff --git a/src/components/ReportActionItem/TaskView.tsx b/src/components/ReportActionItem/TaskView.tsx
index 7901426b33e0..d60419ac0426 100644
--- a/src/components/ReportActionItem/TaskView.tsx
+++ b/src/components/ReportActionItem/TaskView.tsx
@@ -63,7 +63,7 @@ function TaskView({report}: TaskViewProps) {
                 <Hoverable>
                     {(hovered) => (
                         <PressableWithSecondaryInteraction
-                            onPress={Session.checkIfActionIsAllowed((e) => {
+                            onPress={Session.callFnIfActionIsAllowed((e) => {
                                 if (isDisableInteractive) {
                                     return;
                                 }
@@ -87,7 +87,7 @@ function TaskView({report}: TaskViewProps) {
                                     <Text style={styles.taskTitleDescription}>{translate('task.title')}</Text>
                                     <View style={[styles.flexRow, styles.flex1]}>
                                         <Checkbox
-                                            onPress={Session.checkIfActionIsAllowed(() => {
+                                            onPress={Session.callFnIfActionIsAllowed(() => {
                                                 // If we're already navigating to these task editing pages, early return not to mark as completed, otherwise we would have not found page.
                                                 if (TaskUtils.isActiveTaskEditRoute(report.reportID)) {
                                                     return;
diff --git a/src/components/Search/SearchRouter/SearchButton.tsx b/src/components/Search/SearchRouter/SearchButton.tsx
index e69a11c30da2..71fdfff7f50c 100644
--- a/src/components/Search/SearchRouter/SearchButton.tsx
+++ b/src/components/Search/SearchRouter/SearchButton.tsx
@@ -32,7 +32,7 @@ function SearchButton({style}: SearchButtonProps) {
                 accessibilityLabel={translate('common.search')}
                 style={[styles.flexRow, styles.touchableButtonImage, style]}
                 // eslint-disable-next-line react-compiler/react-compiler
-                onPress={Session.checkIfActionIsAllowed(() => {
+                onPress={Session.callFnIfActionIsAllowed(() => {
                     pressableRef?.current?.blur();
 
                     Timing.start(CONST.TIMING.OPEN_SEARCH);
diff --git a/src/components/TaskHeaderActionButton.tsx b/src/components/TaskHeaderActionButton.tsx
index dd2ba54c2f6d..5859d68955d3 100644
--- a/src/components/TaskHeaderActionButton.tsx
+++ b/src/components/TaskHeaderActionButton.tsx
@@ -31,7 +31,7 @@ function TaskHeaderActionButton({report}: TaskHeaderActionButtonProps) {
                 success
                 isDisabled={!Task.canActionTask(report, session?.accountID ?? CONST.DEFAULT_NUMBER_ID)}
                 text={translate(ReportUtils.isCompletedTaskReport(report) ? 'task.markAsIncomplete' : 'task.markAsComplete')}
-                onPress={Session.checkIfActionIsAllowed(() => {
+                onPress={Session.callFnIfActionIsAllowed(() => {
                     // If we're already navigating to these task editing pages, early return not to mark as completed, otherwise we would have not found page.
                     if (TaskUtils.isActiveTaskEditRoute(report.reportID)) {
                         return;
diff --git a/src/libs/HeaderUtils.ts b/src/libs/HeaderUtils.ts
index b31d59804c51..0d9588015e50 100644
--- a/src/libs/HeaderUtils.ts
+++ b/src/libs/HeaderUtils.ts
@@ -13,7 +13,7 @@ function getPinMenuItem(report: OnyxReport): ThreeDotsMenuItem {
     return {
         icon: Expensicons.Pin,
         text: Localize.translateLocal(isPinned ? 'common.unPin' : 'common.pin'),
-        onSelected: Session.checkIfActionIsAllowed(() => Report.togglePinnedState(report.reportID, isPinned)),
+        onSelected: Session.callFnIfActionIsAllowed(() => Report.togglePinnedState(report.reportID, isPinned)),
     };
 }
 
diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx
index 82211eabe00f..be46952c0521 100644
--- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx
+++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx
@@ -384,7 +384,7 @@ function AuthScreens() {
         const unsubscribeSearchShortcut = KeyboardShortcut.subscribe(
             searchShortcutConfig.shortcutKey,
             () => {
-                Session.checkIfActionIsAllowed(() => {
+                Session.callFnIfActionIsAllowed(() => {
                     const state = navigationRef.getRootState();
                     const currentFocusedRoute = findFocusedRoute(state);
                     if (isOnboardingFlowName(currentFocusedRoute?.name)) {
@@ -401,7 +401,7 @@ function AuthScreens() {
         const unsubscribeChatShortcut = KeyboardShortcut.subscribe(
             chatShortcutConfig.shortcutKey,
             () => {
-                Modal.close(Session.checkIfActionIsAllowed(() => Navigation.navigate(ROUTES.NEW)));
+                Modal.close(Session.callFnIfActionIsAllowed(() => Navigation.navigate(ROUTES.NEW)));
             },
             chatShortcutConfig.descriptionKey,
             chatShortcutConfig.modifiers,
diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts
index ea764c24c2ad..a699b3751e2b 100644
--- a/src/libs/actions/Session/index.ts
+++ b/src/libs/actions/Session/index.ts
@@ -300,7 +300,7 @@ function signOutAndRedirectToSignIn(shouldResetToHome?: boolean, shouldStashSess
  * @returns same callback if the action is allowed, otherwise a function that signs out and redirects to sign in
  */
 // eslint-disable-next-line @typescript-eslint/no-explicit-any
-function checkIfActionIsAllowed<TCallback extends ((...args: any[]) => any) | void>(callback: TCallback, isAnonymousAction = false): TCallback | (() => void) {
+function callFnIfActionIsAllowed<TCallback extends ((...args: any[]) => any) | void>(callback: TCallback, isAnonymousAction = false): TCallback | (() => void) {
     if (isAnonymousUser() && !isAnonymousAction) {
         return () => signOutAndRedirectToSignIn();
     }
@@ -1289,7 +1289,7 @@ export {
     beginAppleSignIn,
     beginGoogleSignIn,
     setSupportAuthToken,
-    checkIfActionIsAllowed,
+    callFnIfActionIsAllowed,
     signIn,
     signInWithValidateCode,
     handleExitToNavigation,
diff --git a/src/pages/FlagCommentPage.tsx b/src/pages/FlagCommentPage.tsx
index fbedd5fc6c39..86170cd90ce3 100644
--- a/src/pages/FlagCommentPage.tsx
+++ b/src/pages/FlagCommentPage.tsx
@@ -122,7 +122,7 @@ function FlagCommentPage({parentReportAction, route, report, parentReport, repor
             shouldShowRightIcon
             title={item.name}
             description={item.description}
-            onPress={Session.checkIfActionIsAllowed(() => flagComment(item.severity))}
+            onPress={Session.callFnIfActionIsAllowed(() => flagComment(item.severity))}
             style={[styles.pt2, styles.pb4, styles.ph5, styles.flexRow]}
             furtherDetails={item.furtherDetails}
             furtherDetailsIcon={item.furtherDetailsIcon}
diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx
index 485d612fc5ac..7aca6b8202a0 100755
--- a/src/pages/ProfilePage.tsx
+++ b/src/pages/ProfilePage.tsx
@@ -41,7 +41,7 @@ import type {ProfileNavigatorParamList} from '@navigation/types';
 import {openExternalLink} from '@userActions/Link';
 import {openPublicProfilePage} from '@userActions/PersonalDetails';
 import {hasErrorInPrivateNotes} from '@userActions/Report';
-import {checkIfActionIsAllowed, isAnonymousUser as isAnonymousUserSession} from '@userActions/Session';
+import {callFnIfActionIsAllowed, isAnonymousUser as isAnonymousUserSession} from '@userActions/Session';
 import CONST from '@src/CONST';
 import type {TranslationPaths} from '@src/languages/types';
 import ONYXKEYS from '@src/ONYXKEYS';
@@ -302,7 +302,7 @@ function ProfilePage({route}: ProfilePageProps) {
                                 title={translate('videoChatButtonAndMenu.tooltip')}
                                 icon={Expensicons.Phone}
                                 isAnonymousAction={false}
-                                onPress={checkIfActionIsAllowed(() => {
+                                onPress={callFnIfActionIsAllowed(() => {
                                     openExternalLink(guideCalendarLink);
                                 })}
                             />
diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx
index ac6bd0fe904d..37bb53c2127c 100644
--- a/src/pages/ReportDetailsPage.tsx
+++ b/src/pages/ReportDetailsPage.tsx
@@ -124,7 +124,7 @@ import {
     setDeleteTransactionNavigateBackUrl,
     updateGroupChatAvatar,
 } from '@userActions/Report';
-import {checkIfActionIsAllowed} from '@userActions/Session';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
 import {canActionTask as canActionTaskAction, canModifyTask as canModifyTaskAction, deleteTask, reopenTask} from '@userActions/Task';
 import CONST from '@src/CONST';
 import type {TranslationPaths} from '@src/languages/types';
@@ -512,7 +512,7 @@ function ReportDetailsPage({policies, report, route, reportMetadata}: ReportDeta
                     icon: Expensicons.Checkmark,
                     translationKey: 'task.markAsIncomplete',
                     isAnonymousAction: false,
-                    action: checkIfActionIsAllowed(() => {
+                    action: callFnIfActionIsAllowed(() => {
                         Navigation.dismissModal();
                         reopenTask(report);
                     }),
diff --git a/src/pages/home/HeaderView.tsx b/src/pages/home/HeaderView.tsx
index 02dffe751beb..fa061d2a09a7 100644
--- a/src/pages/home/HeaderView.tsx
+++ b/src/pages/home/HeaderView.tsx
@@ -59,7 +59,7 @@ import {
 } from '@libs/ReportUtils';
 import FreeTrial from '@pages/settings/Subscription/FreeTrial';
 import {joinRoom} from '@userActions/Report';
-import {checkIfActionIsAllowed} from '@userActions/Session';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
 import {deleteTask} from '@userActions/Task';
 import CONST from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
@@ -152,7 +152,7 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked,
 
     const shouldShowGuideBooking = !!account && report?.reportID === account?.adminsRoomReportID && !!account?.guideDetails?.calendarLink;
 
-    const join = checkIfActionIsAllowed(() => joinRoom(report));
+    const join = callFnIfActionIsAllowed(() => joinRoom(report));
 
     const canJoin = canJoinChat(report, parentReportAction, policy);
 
diff --git a/src/pages/workspace/WorkspacesListPage.tsx b/src/pages/workspace/WorkspacesListPage.tsx
index acd0b158fa67..7ad40c3bb76a 100755
--- a/src/pages/workspace/WorkspacesListPage.tsx
+++ b/src/pages/workspace/WorkspacesListPage.tsx
@@ -28,7 +28,7 @@ import useTheme from '@hooks/useTheme';
 import useThemeStyles from '@hooks/useThemeStyles';
 import {isConnectionInProgress} from '@libs/actions/connections';
 import {clearDeleteWorkspaceError, clearErrors, deleteWorkspace, leaveWorkspace, removeWorkspace, updateDefaultPolicy} from '@libs/actions/Policy/Policy';
-import {checkIfActionIsAllowed, isSupportAuthToken} from '@libs/actions/Session';
+import {callFnIfActionIsAllowed, isSupportAuthToken} from '@libs/actions/Session';
 import interceptAnonymousUser from '@libs/interceptAnonymousUser';
 import localeCompare from '@libs/LocaleCompare';
 import getTopmostBottomTabRoute from '@libs/Navigation/getTopmostBottomTabRoute';
@@ -203,7 +203,7 @@ function WorkspacesListPage() {
                 threeDotsMenuItems.push({
                     icon: Expensicons.Exit,
                     text: translate('common.leave'),
-                    onSelected: checkIfActionIsAllowed(() => leaveWorkspace(item.policyID)),
+                    onSelected: callFnIfActionIsAllowed(() => leaveWorkspace(item.policyID)),
                 });
             }
 

From e9e2f955e562cfad23e6640ae484cfe420293f90 Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Mon, 27 Jan 2025 14:35:05 +0530
Subject: [PATCH 02/14] fix type error

---
 src/components/ReportActionItem/TaskPreview.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/components/ReportActionItem/TaskPreview.tsx b/src/components/ReportActionItem/TaskPreview.tsx
index b1f9d89440a0..251725abcba7 100644
--- a/src/components/ReportActionItem/TaskPreview.tsx
+++ b/src/components/ReportActionItem/TaskPreview.tsx
@@ -20,7 +20,7 @@ import useLocalize from '@hooks/useLocalize';
 import useStyleUtils from '@hooks/useStyleUtils';
 import useTheme from '@hooks/useTheme';
 import useThemeStyles from '@hooks/useThemeStyles';
-import {checkIfActionIsAllowed} from '@libs/actions/Session';
+import {callFnIfActionIsAllowed} from '@libs/actions/Session';
 import {canActionTask, completeTask, getTaskAssigneeAccountID, reopenTask} from '@libs/actions/Task';
 import ControlSelection from '@libs/ControlSelection';
 import {canUseTouchScreen} from '@libs/DeviceCapabilities';

From cc18979518f770f31aede328d367bcf094029aaa Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Mon, 27 Jan 2025 14:43:59 +0530
Subject: [PATCH 03/14] fix Namespace imports not allowed in pinbutton and
 promotedactionsbar

---
 src/components/PinButton.tsx          |  6 ++---
 src/components/PromotedActionsBar.tsx | 32 +++++++++++++--------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/components/PinButton.tsx b/src/components/PinButton.tsx
index f6b12053c976..6f2702252ed5 100644
--- a/src/components/PinButton.tsx
+++ b/src/components/PinButton.tsx
@@ -2,8 +2,8 @@ import React from 'react';
 import useLocalize from '@hooks/useLocalize';
 import useTheme from '@hooks/useTheme';
 import useThemeStyles from '@hooks/useThemeStyles';
-import * as ReportActions from '@userActions/Report';
-import * as Session from '@userActions/Session';
+import {togglePinnedState} from '@userActions/Report';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import type {Report} from '@src/types/onyx';
 import Icon from './Icon';
@@ -24,7 +24,7 @@ function PinButton({report}: PinButtonProps) {
     return (
         <Tooltip text={report.isPinned ? translate('common.unPin') : translate('common.pin')}>
             <PressableWithFeedback
-                onPress={Session.callFnIfActionIsAllowed(() => ReportActions.togglePinnedState(report.reportID, report.isPinned ?? false))}
+                onPress={callFnIfActionIsAllowed(() => togglePinnedState(report.reportID, report.isPinned ?? false))}
                 style={styles.touchableButtonImage}
                 accessibilityLabel={report.isPinned ? translate('common.unPin') : translate('common.pin')}
                 role={CONST.ROLE.BUTTON}
diff --git a/src/components/PromotedActionsBar.tsx b/src/components/PromotedActionsBar.tsx
index de1f38eb8ec3..ebf4e4cdf891 100644
--- a/src/components/PromotedActionsBar.tsx
+++ b/src/components/PromotedActionsBar.tsx
@@ -3,14 +3,14 @@ import type {StyleProp, ViewStyle} from 'react-native';
 import {View} from 'react-native';
 import useTheme from '@hooks/useTheme';
 import useThemeStyles from '@hooks/useThemeStyles';
-import * as HeaderUtils from '@libs/HeaderUtils';
-import * as Localize from '@libs/Localize';
+import {getPinMenuItem, getShareMenuItem} from '@libs/HeaderUtils';
+import {translateLocal} from '@libs/Localize';
 import getTopmostCentralPaneRoute from '@libs/Navigation/getTopmostCentralPaneRoute';
 import Navigation, {navigationRef} from '@libs/Navigation/Navigation';
 import type {RootStackParamList, State} from '@libs/Navigation/types';
-import * as ReportUtils from '@libs/ReportUtils';
-import * as ReportActions from '@userActions/Report';
-import * as Session from '@userActions/Session';
+import {changeMoneyRequestHoldStatus} from '@libs/ReportUtils';
+import {joinRoom, navigateToAndOpenReport, navigateToAndOpenReportWithAccountIDs} from '@userActions/Report';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import ROUTES from '@src/ROUTES';
 import SCREENS from '@src/SCREENS';
@@ -44,25 +44,25 @@ type PromotedActionsType = Record<BasePromotedActions, (report: OnyxReport) => P
 const PromotedActions = {
     pin: (report) => ({
         key: CONST.PROMOTED_ACTIONS.PIN,
-        ...HeaderUtils.getPinMenuItem(report),
+        ...getPinMenuItem(report),
     }),
     share: (report, backTo) => ({
         key: CONST.PROMOTED_ACTIONS.SHARE,
-        ...HeaderUtils.getShareMenuItem(report, backTo),
+        ...getShareMenuItem(report, backTo),
     }),
     join: (report) => ({
         key: CONST.PROMOTED_ACTIONS.JOIN,
         icon: Expensicons.ChatBubbles,
-        text: Localize.translateLocal('common.join'),
-        onSelected: Session.callFnIfActionIsAllowed(() => {
+        text: translateLocal('common.join'),
+        onSelected: callFnIfActionIsAllowed(() => {
             Navigation.dismissModal();
-            ReportActions.joinRoom(report);
+            joinRoom(report);
         }),
     }),
     message: ({reportID, accountID, login}) => ({
         key: CONST.PROMOTED_ACTIONS.MESSAGE,
         icon: Expensicons.CommentBubbles,
-        text: Localize.translateLocal('common.message'),
+        text: translateLocal('common.message'),
         onSelected: () => {
             if (reportID) {
                 Navigation.dismissModal(reportID);
@@ -71,18 +71,18 @@ const PromotedActions = {
 
             // The accountID might be optimistic, so we should use the login if we have it
             if (login) {
-                ReportActions.navigateToAndOpenReport([login]);
+                navigateToAndOpenReport([login]);
                 return;
             }
             if (accountID) {
-                ReportActions.navigateToAndOpenReportWithAccountIDs([accountID]);
+                navigateToAndOpenReportWithAccountIDs([accountID]);
             }
         },
     }),
     hold: ({isTextHold, reportAction, reportID, isDelegateAccessRestricted, setIsNoDelegateAccessMenuVisible, currentSearchHash}) => ({
         key: CONST.PROMOTED_ACTIONS.HOLD,
         icon: Expensicons.Stopwatch,
-        text: Localize.translateLocal(`iou.${isTextHold ? 'hold' : 'unhold'}`),
+        text: translateLocal(`iou.${isTextHold ? 'hold' : 'unhold'}`),
         onSelected: () => {
             if (isDelegateAccessRestricted) {
                 setIsNoDelegateAccessMenuVisible(true); // Show the menu
@@ -96,11 +96,11 @@ const PromotedActions = {
             const topmostCentralPaneRoute = getTopmostCentralPaneRoute(navigationRef.getRootState() as State<RootStackParamList>);
 
             if (topmostCentralPaneRoute?.name !== SCREENS.SEARCH.CENTRAL_PANE && isTextHold) {
-                ReportUtils.changeMoneyRequestHoldStatus(reportAction, ROUTES.REPORT_WITH_ID.getRoute(targetedReportID));
+                changeMoneyRequestHoldStatus(reportAction, ROUTES.REPORT_WITH_ID.getRoute(targetedReportID));
                 return;
             }
 
-            ReportUtils.changeMoneyRequestHoldStatus(reportAction, ROUTES.SEARCH_REPORT.getRoute({reportID: targetedReportID}), currentSearchHash);
+            changeMoneyRequestHoldStatus(reportAction, ROUTES.SEARCH_REPORT.getRoute({reportID: targetedReportID}), currentSearchHash);
         },
     }),
 } satisfies PromotedActionsType;

From 06c55f497a6a620832e699ea27c49c6b33f32884 Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Mon, 27 Jan 2025 14:47:12 +0530
Subject: [PATCH 04/14] fix Namespace imports not allowed in AddReactionBubble

---
 src/components/Reactions/AddReactionBubble.tsx | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/components/Reactions/AddReactionBubble.tsx b/src/components/Reactions/AddReactionBubble.tsx
index dce1892737ba..91837ed03819 100644
--- a/src/components/Reactions/AddReactionBubble.tsx
+++ b/src/components/Reactions/AddReactionBubble.tsx
@@ -11,9 +11,9 @@ import useStyleUtils from '@hooks/useStyleUtils';
 import useThemeStyles from '@hooks/useThemeStyles';
 import getButtonState from '@libs/getButtonState';
 import variables from '@styles/variables';
-import * as EmojiPickerAction from '@userActions/EmojiPickerAction';
+import {emojiPickerRef, resetEmojiPopoverAnchor, showEmojiPicker} from '@userActions/EmojiPickerAction';
 import type {AnchorOrigin} from '@userActions/EmojiPickerAction';
-import * as Session from '@userActions/Session';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import type {ReportAction} from '@src/types/onyx';
 import type {CloseContextMenuCallback, OpenPickerCallback, PickerRefElement} from './QuickEmojiReactions/types';
@@ -54,11 +54,11 @@ function AddReactionBubble({onSelectEmoji, reportAction, onPressOpenPicker, onWi
     const ref = useRef<View | HTMLDivElement>(null);
     const {translate} = useLocalize();
 
-    useEffect(() => EmojiPickerAction.resetEmojiPopoverAnchor, []);
+    useEffect(() => resetEmojiPopoverAnchor, []);
 
     const onPress = () => {
         const openPicker = (refParam?: PickerRefElement, anchorOrigin?: AnchorOrigin) => {
-            EmojiPickerAction.showEmojiPicker(
+            showEmojiPicker(
                 () => {
                     setIsEmojiPickerActive?.(false);
                 },
@@ -72,7 +72,7 @@ function AddReactionBubble({onSelectEmoji, reportAction, onPressOpenPicker, onWi
             );
         };
 
-        if (!EmojiPickerAction.emojiPickerRef.current?.isEmojiPickerVisible) {
+        if (!emojiPickerRef.current?.isEmojiPickerVisible) {
             setIsEmojiPickerActive?.(true);
             if (onPressOpenPicker) {
                 onPressOpenPicker(openPicker);
@@ -81,7 +81,7 @@ function AddReactionBubble({onSelectEmoji, reportAction, onPressOpenPicker, onWi
             }
         } else {
             setIsEmojiPickerActive?.(false);
-            EmojiPickerAction.emojiPickerRef.current.hideEmojiPicker();
+            emojiPickerRef.current.hideEmojiPicker();
         }
     };
 
@@ -90,7 +90,7 @@ function AddReactionBubble({onSelectEmoji, reportAction, onPressOpenPicker, onWi
             <PressableWithFeedback
                 ref={ref}
                 style={({hovered, pressed}) => [styles.emojiReactionBubble, styles.userSelectNone, StyleUtils.getEmojiReactionBubbleStyle(hovered || pressed, false, isContextMenu)]}
-                onPress={Session.callFnIfActionIsAllowed(onPress)}
+                onPress={callFnIfActionIsAllowed(onPress)}
                 onMouseDown={(event) => {
                     // Allow text input blur when Add reaction is right clicked
                     if (!event || event.button === 2) {

From 8b22e031dc294461f7e3d8a7f6575406d3da9bb2 Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Mon, 27 Jan 2025 14:50:21 +0530
Subject: [PATCH 05/14] fix Namespace imports not allowed in
 MiniQuickEmojiReactions

---
 .../Reactions/MiniQuickEmojiReactions.tsx     | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/components/Reactions/MiniQuickEmojiReactions.tsx b/src/components/Reactions/MiniQuickEmojiReactions.tsx
index 931fddc387a4..d083254a8b3c 100644
--- a/src/components/Reactions/MiniQuickEmojiReactions.tsx
+++ b/src/components/Reactions/MiniQuickEmojiReactions.tsx
@@ -9,11 +9,11 @@ import Text from '@components/Text';
 import useLocalize from '@hooks/useLocalize';
 import useStyleUtils from '@hooks/useStyleUtils';
 import useThemeStyles from '@hooks/useThemeStyles';
-import * as EmojiUtils from '@libs/EmojiUtils';
+import {getLocalizedEmojiName, getPreferredEmojiCode} from '@libs/EmojiUtils';
 import getButtonState from '@libs/getButtonState';
 import variables from '@styles/variables';
-import * as EmojiPickerAction from '@userActions/EmojiPickerAction';
-import * as Session from '@userActions/Session';
+import {emojiPickerRef, showEmojiPicker} from '@userActions/EmojiPickerAction';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
 import type {BaseQuickEmojiReactionsOnyxProps, BaseQuickEmojiReactionsProps} from './QuickEmojiReactions/types';
@@ -48,7 +48,7 @@ function MiniQuickEmojiReactions({
 
     const openEmojiPicker = () => {
         onPressOpenPicker();
-        EmojiPickerAction.showEmojiPicker(
+        showEmojiPicker(
             onEmojiPickerClosed,
             (emojiCode, emojiObject) => {
                 onEmojiSelected(emojiObject, emojiReactions);
@@ -66,24 +66,24 @@ function MiniQuickEmojiReactions({
                 <BaseMiniContextMenuItem
                     key={emoji.name}
                     isDelayButtonStateComplete={false}
-                    tooltipText={`:${EmojiUtils.getLocalizedEmojiName(emoji.name, preferredLocale)}:`}
-                    onPress={Session.callFnIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
+                    tooltipText={`:${getLocalizedEmojiName(emoji.name, preferredLocale)}:`}
+                    onPress={callFnIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
                 >
                     <Text
                         style={[styles.miniQuickEmojiReactionText, styles.userSelectNone]}
                         dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}}
                     >
-                        {EmojiUtils.getPreferredEmojiCode(emoji, preferredSkinTone)}
+                        {getPreferredEmojiCode(emoji, preferredSkinTone)}
                     </Text>
                 </BaseMiniContextMenuItem>
             ))}
             <BaseMiniContextMenuItem
                 ref={ref}
-                onPress={Session.callFnIfActionIsAllowed(() => {
-                    if (!EmojiPickerAction.emojiPickerRef.current?.isEmojiPickerVisible) {
+                onPress={callFnIfActionIsAllowed(() => {
+                    if (!emojiPickerRef.current?.isEmojiPickerVisible) {
                         openEmojiPicker();
                     } else {
-                        EmojiPickerAction.emojiPickerRef.current?.hideEmojiPicker();
+                        emojiPickerRef.current?.hideEmojiPicker();
                     }
                 })}
                 isDelayButtonStateComplete={false}

From f8e6b06d3650e64a7caaa5e0cbead83217424e81 Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Mon, 27 Jan 2025 14:52:07 +0530
Subject: [PATCH 06/14] fix Namespace imports not allowed in
 BaseQuickEmojiReactions

---
 .../QuickEmojiReactions/BaseQuickEmojiReactions.tsx    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx b/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
index 862d426a3bcc..19e6c1661784 100644
--- a/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
+++ b/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
@@ -6,8 +6,8 @@ import AddReactionBubble from '@components/Reactions/AddReactionBubble';
 import EmojiReactionBubble from '@components/Reactions/EmojiReactionBubble';
 import Tooltip from '@components/Tooltip';
 import useThemeStyles from '@hooks/useThemeStyles';
-import * as EmojiUtils from '@libs/EmojiUtils';
-import * as Session from '@userActions/Session';
+import {getLocalizedEmojiName, getPreferredEmojiCode} from '@libs/EmojiUtils';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
 import type {BaseQuickEmojiReactionsOnyxProps, BaseQuickEmojiReactionsProps} from './types';
@@ -28,14 +28,14 @@ function BaseQuickEmojiReactions({
         <View style={styles.quickReactionsContainer}>
             {CONST.QUICK_REACTIONS.map((emoji: Emoji) => (
                 <Tooltip
-                    text={`:${EmojiUtils.getLocalizedEmojiName(emoji.name, preferredLocale)}:`}
+                    text={`:${getLocalizedEmojiName(emoji.name, preferredLocale)}:`}
                     key={emoji.name}
                 >
                     <View>
                         <EmojiReactionBubble
-                            emojiCodes={[EmojiUtils.getPreferredEmojiCode(emoji, preferredSkinTone)]}
+                            emojiCodes={[getPreferredEmojiCode(emoji, preferredSkinTone)]}
                             isContextMenu
-                            onPress={Session.callFnIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
+                            onPress={callFnIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
                         />
                     </View>
                 </Tooltip>

From 01e28c07ef94d6a81c41d3bdaf730016cebc2be6 Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Mon, 27 Jan 2025 18:05:06 +0530
Subject: [PATCH 07/14] fix Namespace imports not allowed in remaining files

---
 src/components/ReportActionItem/TaskView.tsx  | 41 +++++++++----------
 .../Search/SearchRouter/SearchButton.tsx      |  4 +-
 src/components/TaskHeaderActionButton.tsx     | 24 +++++------
 src/libs/HeaderUtils.ts                       |  6 +--
 src/pages/FlagCommentPage.tsx                 | 16 ++++----
 5 files changed, 44 insertions(+), 47 deletions(-)

diff --git a/src/components/ReportActionItem/TaskView.tsx b/src/components/ReportActionItem/TaskView.tsx
index d60419ac0426..fc05993fc3dc 100644
--- a/src/components/ReportActionItem/TaskView.tsx
+++ b/src/components/ReportActionItem/TaskView.tsx
@@ -17,11 +17,11 @@ import useThemeStyles from '@hooks/useThemeStyles';
 import convertToLTR from '@libs/convertToLTR';
 import getButtonState from '@libs/getButtonState';
 import Navigation from '@libs/Navigation/Navigation';
-import * as OptionsListUtils from '@libs/OptionsListUtils';
-import * as ReportUtils from '@libs/ReportUtils';
-import * as TaskUtils from '@libs/TaskUtils';
-import * as Session from '@userActions/Session';
-import * as Task from '@userActions/Task';
+import {getAvatarsForAccountIDs, getPersonalDetailsForAccountIDs} from '@libs/OptionsListUtils';
+import {getDisplayNameForParticipant, getDisplayNamesWithTooltips, isCompletedTaskReport, isOpenTaskReport} from '@libs/ReportUtils';
+import {isActiveTaskEditRoute} from '@libs/TaskUtils';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {canActionTask as canActionTaskUtil, canModifyTask as canModifyTaskUtilAction, clearTaskErrors, completeTask, reopenTask, setTaskReport} from '@userActions/Task';
 import CONST from '@src/CONST';
 import ROUTES from '@src/ROUTES';
 import type {Report} from '@src/types/onyx';
@@ -37,17 +37,14 @@ function TaskView({report}: TaskViewProps) {
     const currentUserPersonalDetails = useCurrentUserPersonalDetails();
     const personalDetails = usePersonalDetails();
     useEffect(() => {
-        Task.setTaskReport(report);
+        setTaskReport(report);
     }, [report]);
     const taskTitle = convertToLTR(report.reportName ?? '');
-    const assigneeTooltipDetails = ReportUtils.getDisplayNamesWithTooltips(
-        OptionsListUtils.getPersonalDetailsForAccountIDs(report.managerID ? [report.managerID] : [], personalDetails),
-        false,
-    );
-    const isOpen = ReportUtils.isOpenTaskReport(report);
-    const isCompleted = ReportUtils.isCompletedTaskReport(report);
-    const canModifyTask = Task.canModifyTask(report, currentUserPersonalDetails.accountID);
-    const canActionTask = Task.canActionTask(report, currentUserPersonalDetails.accountID);
+    const assigneeTooltipDetails = getDisplayNamesWithTooltips(getPersonalDetailsForAccountIDs(report.managerID ? [report.managerID] : [], personalDetails), false);
+    const isOpen = isOpenTaskReport(report);
+    const isCompleted = isCompletedTaskReport(report);
+    const canModifyTask = canModifyTaskUtilAction(report, currentUserPersonalDetails.accountID);
+    const canActionTask = canActionTaskUtil(report, currentUserPersonalDetails.accountID);
     const disableState = !canModifyTask;
     const isDisableInteractive = !canModifyTask || !isOpen;
     const {translate} = useLocalize();
@@ -57,13 +54,13 @@ function TaskView({report}: TaskViewProps) {
             <OfflineWithFeedback
                 shouldShowErrorMessages
                 errors={report.errorFields?.editTask ?? report.errorFields?.createTask}
-                onClose={() => Task.clearTaskErrors(report.reportID)}
+                onClose={() => clearTaskErrors(report.reportID)}
                 errorRowStyles={styles.ph5}
             >
                 <Hoverable>
                     {(hovered) => (
                         <PressableWithSecondaryInteraction
-                            onPress={Session.callFnIfActionIsAllowed((e) => {
+                            onPress={callFnIfActionIsAllowed((e) => {
                                 if (isDisableInteractive) {
                                     return;
                                 }
@@ -87,15 +84,15 @@ function TaskView({report}: TaskViewProps) {
                                     <Text style={styles.taskTitleDescription}>{translate('task.title')}</Text>
                                     <View style={[styles.flexRow, styles.flex1]}>
                                         <Checkbox
-                                            onPress={Session.callFnIfActionIsAllowed(() => {
+                                            onPress={callFnIfActionIsAllowed(() => {
                                                 // If we're already navigating to these task editing pages, early return not to mark as completed, otherwise we would have not found page.
-                                                if (TaskUtils.isActiveTaskEditRoute(report.reportID)) {
+                                                if (isActiveTaskEditRoute(report.reportID)) {
                                                     return;
                                                 }
                                                 if (isCompleted) {
-                                                    Task.reopenTask(report);
+                                                    reopenTask(report);
                                                 } else {
-                                                    Task.completeTask(report);
+                                                    completeTask(report);
                                                 }
                                             })}
                                             isChecked={isCompleted}
@@ -148,8 +145,8 @@ function TaskView({report}: TaskViewProps) {
                     {report.managerID ? (
                         <MenuItem
                             label={translate('task.assignee')}
-                            title={ReportUtils.getDisplayNameForParticipant(report.managerID)}
-                            icon={OptionsListUtils.getAvatarsForAccountIDs([report.managerID], personalDetails)}
+                            title={getDisplayNameForParticipant(report.managerID)}
+                            icon={getAvatarsForAccountIDs([report.managerID], personalDetails)}
                             iconType={CONST.ICON_TYPE_AVATAR}
                             avatarSize={CONST.AVATAR_SIZE.SMALLER}
                             titleStyle={styles.assigneeTextStyle}
diff --git a/src/components/Search/SearchRouter/SearchButton.tsx b/src/components/Search/SearchRouter/SearchButton.tsx
index 71fdfff7f50c..8d538214b323 100644
--- a/src/components/Search/SearchRouter/SearchButton.tsx
+++ b/src/components/Search/SearchRouter/SearchButton.tsx
@@ -8,7 +8,7 @@ import useLocalize from '@hooks/useLocalize';
 import useTheme from '@hooks/useTheme';
 import useThemeStyles from '@hooks/useThemeStyles';
 import Performance from '@libs/Performance';
-import * as Session from '@userActions/Session';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
 import Timing from '@userActions/Timing';
 import CONST from '@src/CONST';
 import {useSearchRouterContext} from './SearchRouterContext';
@@ -32,7 +32,7 @@ function SearchButton({style}: SearchButtonProps) {
                 accessibilityLabel={translate('common.search')}
                 style={[styles.flexRow, styles.touchableButtonImage, style]}
                 // eslint-disable-next-line react-compiler/react-compiler
-                onPress={Session.callFnIfActionIsAllowed(() => {
+                onPress={callFnIfActionIsAllowed(() => {
                     pressableRef?.current?.blur();
 
                     Timing.start(CONST.TIMING.OPEN_SEARCH);
diff --git a/src/components/TaskHeaderActionButton.tsx b/src/components/TaskHeaderActionButton.tsx
index 5859d68955d3..7c2481c5c17f 100644
--- a/src/components/TaskHeaderActionButton.tsx
+++ b/src/components/TaskHeaderActionButton.tsx
@@ -2,10 +2,10 @@ import React from 'react';
 import {View} from 'react-native';
 import useLocalize from '@hooks/useLocalize';
 import useThemeStyles from '@hooks/useThemeStyles';
-import * as ReportUtils from '@libs/ReportUtils';
-import * as TaskUtils from '@libs/TaskUtils';
-import * as Session from '@userActions/Session';
-import * as Task from '@userActions/Task';
+import {canWriteInReport, isCompletedTaskReport} from '@libs/ReportUtils';
+import {isActiveTaskEditRoute} from '@libs/TaskUtils';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {canActionTask, completeTask, reopenTask} from '@userActions/Task';
 import CONST from '@src/CONST';
 import type * as OnyxTypes from '@src/types/onyx';
 import Button from './Button';
@@ -21,7 +21,7 @@ function TaskHeaderActionButton({report}: TaskHeaderActionButtonProps) {
     const styles = useThemeStyles();
     const session = useSession();
 
-    if (!ReportUtils.canWriteInReport(report)) {
+    if (!canWriteInReport(report)) {
         return null;
     }
 
@@ -29,17 +29,17 @@ function TaskHeaderActionButton({report}: TaskHeaderActionButtonProps) {
         <View style={[styles.flexRow, styles.alignItemsCenter, styles.justifyContentEnd]}>
             <Button
                 success
-                isDisabled={!Task.canActionTask(report, session?.accountID ?? CONST.DEFAULT_NUMBER_ID)}
-                text={translate(ReportUtils.isCompletedTaskReport(report) ? 'task.markAsIncomplete' : 'task.markAsComplete')}
-                onPress={Session.callFnIfActionIsAllowed(() => {
+                isDisabled={!canActionTask(report, session?.accountID ?? CONST.DEFAULT_NUMBER_ID)}
+                text={translate(isCompletedTaskReport(report) ? 'task.markAsIncomplete' : 'task.markAsComplete')}
+                onPress={callFnIfActionIsAllowed(() => {
                     // If we're already navigating to these task editing pages, early return not to mark as completed, otherwise we would have not found page.
-                    if (TaskUtils.isActiveTaskEditRoute(report.reportID)) {
+                    if (isActiveTaskEditRoute(report.reportID)) {
                         return;
                     }
-                    if (ReportUtils.isCompletedTaskReport(report)) {
-                        Task.reopenTask(report);
+                    if (isCompletedTaskReport(report)) {
+                        reopenTask(report);
                     } else {
-                        Task.completeTask(report);
+                        completeTask(report);
                     }
                 })}
                 style={styles.flex1}
diff --git a/src/libs/HeaderUtils.ts b/src/libs/HeaderUtils.ts
index 0d9588015e50..5351470ea85d 100644
--- a/src/libs/HeaderUtils.ts
+++ b/src/libs/HeaderUtils.ts
@@ -2,8 +2,8 @@ import type {ThreeDotsMenuItem} from '@components/HeaderWithBackButton/types';
 import * as Expensicons from '@components/Icon/Expensicons';
 import ROUTES from '@src/ROUTES';
 import type OnyxReport from '@src/types/onyx/Report';
-import * as Report from './actions/Report';
-import * as Session from './actions/Session';
+import {togglePinnedState} from './actions/Report';
+import {callFnIfActionIsAllowed} from './actions/Session';
 import * as Localize from './Localize';
 import Navigation from './Navigation/Navigation';
 
@@ -13,7 +13,7 @@ function getPinMenuItem(report: OnyxReport): ThreeDotsMenuItem {
     return {
         icon: Expensicons.Pin,
         text: Localize.translateLocal(isPinned ? 'common.unPin' : 'common.pin'),
-        onSelected: Session.callFnIfActionIsAllowed(() => Report.togglePinnedState(report.reportID, isPinned)),
+        onSelected: callFnIfActionIsAllowed(() => togglePinnedState(report.reportID, isPinned)),
     };
 }
 
diff --git a/src/pages/FlagCommentPage.tsx b/src/pages/FlagCommentPage.tsx
index 86170cd90ce3..77accf338093 100644
--- a/src/pages/FlagCommentPage.tsx
+++ b/src/pages/FlagCommentPage.tsx
@@ -14,9 +14,9 @@ import useThemeStyles from '@hooks/useThemeStyles';
 import Navigation from '@libs/Navigation/Navigation';
 import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
 import type {FlagCommentNavigatorParamList} from '@libs/Navigation/types';
-import * as ReportUtils from '@libs/ReportUtils';
-import * as Report from '@userActions/Report';
-import * as Session from '@userActions/Session';
+import {canFlagReportAction, isChatThread, shouldShowFlagComment} from '@libs/ReportUtils';
+import {flagComment as flagCommentUtil} from '@userActions/Report';
+import {callFnIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import type SCREENS from '@src/SCREENS';
 import withReportAndReportActionOrNotFound from './home/report/withReportAndReportActionOrNotFound';
@@ -105,12 +105,12 @@ function FlagCommentPage({parentReportAction, route, report, parentReport, repor
         let reportID: string | undefined = getReportID(route);
 
         // Handle threads if needed
-        if (ReportUtils.isChatThread(report) && reportAction?.reportActionID === parentReportAction?.reportActionID) {
+        if (isChatThread(report) && reportAction?.reportActionID === parentReportAction?.reportActionID) {
             reportID = parentReport?.reportID;
         }
 
-        if (reportAction && ReportUtils.canFlagReportAction(reportAction, reportID)) {
-            Report.flagComment(reportID ?? '-1', reportAction, severity);
+        if (reportAction && canFlagReportAction(reportAction, reportID)) {
+            flagCommentUtil(reportID ?? '-1', reportAction, severity);
         }
 
         Navigation.dismissModal();
@@ -122,7 +122,7 @@ function FlagCommentPage({parentReportAction, route, report, parentReport, repor
             shouldShowRightIcon
             title={item.name}
             description={item.description}
-            onPress={Session.callFnIfActionIsAllowed(() => flagComment(item.severity))}
+            onPress={callFnIfActionIsAllowed(() => flagComment(item.severity))}
             style={[styles.pt2, styles.pb4, styles.ph5, styles.flexRow]}
             furtherDetails={item.furtherDetails}
             furtherDetailsIcon={item.furtherDetailsIcon}
@@ -135,7 +135,7 @@ function FlagCommentPage({parentReportAction, route, report, parentReport, repor
             testID={FlagCommentPage.displayName}
         >
             {({safeAreaPaddingBottomStyle}) => (
-                <FullPageNotFoundView shouldShow={!ReportUtils.shouldShowFlagComment(reportAction, report)}>
+                <FullPageNotFoundView shouldShow={!shouldShowFlagComment(reportAction, report)}>
                     <HeaderWithBackButton
                         title={translate('reportActionContextMenu.flagAsOffensive')}
                         onBackButtonPress={() => Navigation.goBack(route.params.backTo)}

From 473e3b79662abf9214c336fc7955c333bcffa5a2 Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Tue, 28 Jan 2025 02:27:01 +0530
Subject: [PATCH 08/14] fix checks failing

---
 src/components/ReportActionItem/TaskView.tsx | 2 +-
 src/libs/HeaderUtils.ts                      | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/components/ReportActionItem/TaskView.tsx b/src/components/ReportActionItem/TaskView.tsx
index 77b12ee5f0ff..8c8d0aa2b449 100644
--- a/src/components/ReportActionItem/TaskView.tsx
+++ b/src/components/ReportActionItem/TaskView.tsx
@@ -89,7 +89,7 @@ function TaskView({report}: TaskViewProps) {
                                         <Checkbox
                                             onPress={callFnIfActionIsAllowed(() => {
                                                 // If we're already navigating to these task editing pages, early return not to mark as completed, otherwise we would have not found page.
-                                                if (isActiveTaskEditRoute(report.reportID)) {
+                                                if (isActiveTaskEditRoute(report?.reportID)) {
                                                     return;
                                                 }
                                                 if (isCompleted) {
diff --git a/src/libs/HeaderUtils.ts b/src/libs/HeaderUtils.ts
index 5351470ea85d..7fd472e3039f 100644
--- a/src/libs/HeaderUtils.ts
+++ b/src/libs/HeaderUtils.ts
@@ -4,7 +4,7 @@ import ROUTES from '@src/ROUTES';
 import type OnyxReport from '@src/types/onyx/Report';
 import {togglePinnedState} from './actions/Report';
 import {callFnIfActionIsAllowed} from './actions/Session';
-import * as Localize from './Localize';
+import {translateLocal} from './Localize';
 import Navigation from './Navigation/Navigation';
 
 function getPinMenuItem(report: OnyxReport): ThreeDotsMenuItem {
@@ -12,7 +12,7 @@ function getPinMenuItem(report: OnyxReport): ThreeDotsMenuItem {
 
     return {
         icon: Expensicons.Pin,
-        text: Localize.translateLocal(isPinned ? 'common.unPin' : 'common.pin'),
+        text: translateLocal(isPinned ? 'common.unPin' : 'common.pin'),
         onSelected: callFnIfActionIsAllowed(() => togglePinnedState(report.reportID, isPinned)),
     };
 }
@@ -20,7 +20,8 @@ function getPinMenuItem(report: OnyxReport): ThreeDotsMenuItem {
 function getShareMenuItem(report: OnyxReport, backTo?: string): ThreeDotsMenuItem {
     return {
         icon: Expensicons.QrCode,
-        text: Localize.translateLocal('common.share'),
+        text: translateLocal('common.share'),
+        // eslint-disable-next-line rulesdir/no-default-id-values
         onSelected: () => Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS_SHARE_CODE.getRoute(report?.reportID ?? '', backTo)),
     };
 }

From 851c05ed996b580169b6e54d9a8a718f58227aa5 Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Tue, 28 Jan 2025 02:39:35 +0530
Subject: [PATCH 09/14] remove disable comment

---
 src/libs/HeaderUtils.ts | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/libs/HeaderUtils.ts b/src/libs/HeaderUtils.ts
index 7fd472e3039f..7bdd96ae3827 100644
--- a/src/libs/HeaderUtils.ts
+++ b/src/libs/HeaderUtils.ts
@@ -21,7 +21,6 @@ function getShareMenuItem(report: OnyxReport, backTo?: string): ThreeDotsMenuIte
     return {
         icon: Expensicons.QrCode,
         text: translateLocal('common.share'),
-        // eslint-disable-next-line rulesdir/no-default-id-values
         onSelected: () => Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS_SHARE_CODE.getRoute(report?.reportID ?? '', backTo)),
     };
 }

From 533230abda468b57f4022e04429bdc5e664dbc02 Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Wed, 29 Jan 2025 02:33:50 +0530
Subject: [PATCH 10/14] changes as per review

---
 src/components/MenuItem.tsx                                 | 4 ++--
 src/components/PinButton.tsx                                | 4 ++--
 src/components/PromotedActionsBar.tsx                       | 4 ++--
 src/components/Reactions/AddReactionBubble.tsx              | 4 ++--
 src/components/Reactions/MiniQuickEmojiReactions.tsx        | 6 +++---
 .../QuickEmojiReactions/BaseQuickEmojiReactions.tsx         | 4 ++--
 src/components/ReportActionItem/TaskPreview.tsx             | 4 ++--
 src/components/ReportActionItem/TaskView.tsx                | 6 +++---
 src/components/Search/SearchRouter/SearchButton.tsx         | 4 ++--
 src/components/TaskHeaderActionButton.tsx                   | 4 ++--
 src/libs/HeaderUtils.ts                                     | 4 ++--
 src/libs/Navigation/AppNavigator/AuthScreens.tsx            | 4 ++--
 src/libs/actions/Session/index.ts                           | 4 ++--
 src/pages/FlagCommentPage.tsx                               | 4 ++--
 src/pages/ProfilePage.tsx                                   | 4 ++--
 src/pages/ReportDetailsPage.tsx                             | 4 ++--
 src/pages/home/HeaderView.tsx                               | 4 ++--
 src/pages/workspace/WorkspacesListPage.tsx                  | 4 ++--
 18 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx
index 5564041d80cd..40ec431ca893 100644
--- a/src/components/MenuItem.tsx
+++ b/src/components/MenuItem.tsx
@@ -15,7 +15,7 @@ import getButtonState from '@libs/getButtonState';
 import Parser from '@libs/Parser';
 import type {AvatarSource} from '@libs/UserUtils';
 import variables from '@styles/variables';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import type {Icon as IconType} from '@src/types/onyx/OnyxCommon';
 import type {TooltipAnchorAlignment} from '@src/types/utils/AnchorAlignment';
@@ -611,7 +611,7 @@ function MenuItem(
                     <Hoverable>
                         {(isHovered) => (
                             <PressableWithSecondaryInteraction
-                                onPress={shouldCheckActionAllowedOnPress ? callFnIfActionIsAllowed(onPressAction, isAnonymousAction) : onPressAction}
+                                onPress={shouldCheckActionAllowedOnPress ? callFunctionIfActionIsAllowed(onPressAction, isAnonymousAction) : onPressAction}
                                 onPressIn={() => shouldBlockSelection && shouldUseNarrowLayout && canUseTouchScreen() && ControlSelection.block()}
                                 onPressOut={ControlSelection.unblock}
                                 onSecondaryInteraction={onSecondaryInteraction}
diff --git a/src/components/PinButton.tsx b/src/components/PinButton.tsx
index 6f2702252ed5..d5be4e32c1c6 100644
--- a/src/components/PinButton.tsx
+++ b/src/components/PinButton.tsx
@@ -3,7 +3,7 @@ import useLocalize from '@hooks/useLocalize';
 import useTheme from '@hooks/useTheme';
 import useThemeStyles from '@hooks/useThemeStyles';
 import {togglePinnedState} from '@userActions/Report';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import type {Report} from '@src/types/onyx';
 import Icon from './Icon';
@@ -24,7 +24,7 @@ function PinButton({report}: PinButtonProps) {
     return (
         <Tooltip text={report.isPinned ? translate('common.unPin') : translate('common.pin')}>
             <PressableWithFeedback
-                onPress={callFnIfActionIsAllowed(() => togglePinnedState(report.reportID, report.isPinned ?? false))}
+                onPress={callFunctionIfActionIsAllowed(() => togglePinnedState(report.reportID, report.isPinned ?? false))}
                 style={styles.touchableButtonImage}
                 accessibilityLabel={report.isPinned ? translate('common.unPin') : translate('common.pin')}
                 role={CONST.ROLE.BUTTON}
diff --git a/src/components/PromotedActionsBar.tsx b/src/components/PromotedActionsBar.tsx
index ebf4e4cdf891..6c5d8a06416e 100644
--- a/src/components/PromotedActionsBar.tsx
+++ b/src/components/PromotedActionsBar.tsx
@@ -10,7 +10,7 @@ import Navigation, {navigationRef} from '@libs/Navigation/Navigation';
 import type {RootStackParamList, State} from '@libs/Navigation/types';
 import {changeMoneyRequestHoldStatus} from '@libs/ReportUtils';
 import {joinRoom, navigateToAndOpenReport, navigateToAndOpenReportWithAccountIDs} from '@userActions/Report';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import ROUTES from '@src/ROUTES';
 import SCREENS from '@src/SCREENS';
@@ -54,7 +54,7 @@ const PromotedActions = {
         key: CONST.PROMOTED_ACTIONS.JOIN,
         icon: Expensicons.ChatBubbles,
         text: translateLocal('common.join'),
-        onSelected: callFnIfActionIsAllowed(() => {
+        onSelected: callFunctionIfActionIsAllowed(() => {
             Navigation.dismissModal();
             joinRoom(report);
         }),
diff --git a/src/components/Reactions/AddReactionBubble.tsx b/src/components/Reactions/AddReactionBubble.tsx
index 91837ed03819..f755f2a6a4af 100644
--- a/src/components/Reactions/AddReactionBubble.tsx
+++ b/src/components/Reactions/AddReactionBubble.tsx
@@ -13,7 +13,7 @@ import getButtonState from '@libs/getButtonState';
 import variables from '@styles/variables';
 import {emojiPickerRef, resetEmojiPopoverAnchor, showEmojiPicker} from '@userActions/EmojiPickerAction';
 import type {AnchorOrigin} from '@userActions/EmojiPickerAction';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import type {ReportAction} from '@src/types/onyx';
 import type {CloseContextMenuCallback, OpenPickerCallback, PickerRefElement} from './QuickEmojiReactions/types';
@@ -90,7 +90,7 @@ function AddReactionBubble({onSelectEmoji, reportAction, onPressOpenPicker, onWi
             <PressableWithFeedback
                 ref={ref}
                 style={({hovered, pressed}) => [styles.emojiReactionBubble, styles.userSelectNone, StyleUtils.getEmojiReactionBubbleStyle(hovered || pressed, false, isContextMenu)]}
-                onPress={callFnIfActionIsAllowed(onPress)}
+                onPress={callFunctionIfActionIsAllowed(onPress)}
                 onMouseDown={(event) => {
                     // Allow text input blur when Add reaction is right clicked
                     if (!event || event.button === 2) {
diff --git a/src/components/Reactions/MiniQuickEmojiReactions.tsx b/src/components/Reactions/MiniQuickEmojiReactions.tsx
index d083254a8b3c..af1a1c96efb7 100644
--- a/src/components/Reactions/MiniQuickEmojiReactions.tsx
+++ b/src/components/Reactions/MiniQuickEmojiReactions.tsx
@@ -13,7 +13,7 @@ import {getLocalizedEmojiName, getPreferredEmojiCode} from '@libs/EmojiUtils';
 import getButtonState from '@libs/getButtonState';
 import variables from '@styles/variables';
 import {emojiPickerRef, showEmojiPicker} from '@userActions/EmojiPickerAction';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
 import type {BaseQuickEmojiReactionsOnyxProps, BaseQuickEmojiReactionsProps} from './QuickEmojiReactions/types';
@@ -67,7 +67,7 @@ function MiniQuickEmojiReactions({
                     key={emoji.name}
                     isDelayButtonStateComplete={false}
                     tooltipText={`:${getLocalizedEmojiName(emoji.name, preferredLocale)}:`}
-                    onPress={callFnIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
+                    onPress={callFunctionIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
                 >
                     <Text
                         style={[styles.miniQuickEmojiReactionText, styles.userSelectNone]}
@@ -79,7 +79,7 @@ function MiniQuickEmojiReactions({
             ))}
             <BaseMiniContextMenuItem
                 ref={ref}
-                onPress={callFnIfActionIsAllowed(() => {
+                onPress={callFunctionIfActionIsAllowed(() => {
                     if (!emojiPickerRef.current?.isEmojiPickerVisible) {
                         openEmojiPicker();
                     } else {
diff --git a/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx b/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
index 19e6c1661784..546711bba80f 100644
--- a/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
+++ b/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
@@ -7,7 +7,7 @@ import EmojiReactionBubble from '@components/Reactions/EmojiReactionBubble';
 import Tooltip from '@components/Tooltip';
 import useThemeStyles from '@hooks/useThemeStyles';
 import {getLocalizedEmojiName, getPreferredEmojiCode} from '@libs/EmojiUtils';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
 import type {BaseQuickEmojiReactionsOnyxProps, BaseQuickEmojiReactionsProps} from './types';
@@ -35,7 +35,7 @@ function BaseQuickEmojiReactions({
                         <EmojiReactionBubble
                             emojiCodes={[getPreferredEmojiCode(emoji, preferredSkinTone)]}
                             isContextMenu
-                            onPress={callFnIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
+                            onPress={callFunctionIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
                         />
                     </View>
                 </Tooltip>
diff --git a/src/components/ReportActionItem/TaskPreview.tsx b/src/components/ReportActionItem/TaskPreview.tsx
index c85c409dd656..495b3dbd51fd 100644
--- a/src/components/ReportActionItem/TaskPreview.tsx
+++ b/src/components/ReportActionItem/TaskPreview.tsx
@@ -20,7 +20,7 @@ import useLocalize from '@hooks/useLocalize';
 import useStyleUtils from '@hooks/useStyleUtils';
 import useTheme from '@hooks/useTheme';
 import useThemeStyles from '@hooks/useThemeStyles';
-import {callFnIfActionIsAllowed} from '@libs/actions/Session';
+import {callFunctionIfActionIsAllowed} from '@libs/actions/Session';
 import {canActionTask, completeTask, getTaskAssigneeAccountID, reopenTask} from '@libs/actions/Task';
 import ControlSelection from '@libs/ControlSelection';
 import {canUseTouchScreen} from '@libs/DeviceCapabilities';
@@ -108,7 +108,7 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che
                             style={[styles.mr2]}
                             isChecked={isTaskCompleted}
                             disabled={!canActionTask(taskReport, currentUserPersonalDetails.accountID, taskOwnerAccountID, taskAssigneeAccountID)}
-                            onPress={callFnIfActionIsAllowed(() => {
+                            onPress={callFunctionIfActionIsAllowed(() => {
                                 if (isTaskCompleted) {
                                     reopenTask(taskReport, taskReportID);
                                 } else {
diff --git a/src/components/ReportActionItem/TaskView.tsx b/src/components/ReportActionItem/TaskView.tsx
index 8c8d0aa2b449..efd6c1061720 100644
--- a/src/components/ReportActionItem/TaskView.tsx
+++ b/src/components/ReportActionItem/TaskView.tsx
@@ -21,7 +21,7 @@ import Navigation from '@libs/Navigation/Navigation';
 import {getAvatarsForAccountIDs, getPersonalDetailsForAccountIDs} from '@libs/OptionsListUtils';
 import {getDisplayNameForParticipant, getDisplayNamesWithTooltips, isCompletedTaskReport, isOpenTaskReport} from '@libs/ReportUtils';
 import {isActiveTaskEditRoute} from '@libs/TaskUtils';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import {canActionTask as canActionTaskUtil, canModifyTask as canModifyTaskUtil, clearTaskErrors, completeTask, reopenTask, setTaskReport} from '@userActions/Task';
 import CONST from '@src/CONST';
 import ROUTES from '@src/ROUTES';
@@ -63,7 +63,7 @@ function TaskView({report}: TaskViewProps) {
                 <Hoverable>
                     {(hovered) => (
                         <PressableWithSecondaryInteraction
-                            onPress={callFnIfActionIsAllowed((e) => {
+                            onPress={callFunctionIfActionIsAllowed((e) => {
                                 if (isDisableInteractive) {
                                     return;
                                 }
@@ -87,7 +87,7 @@ function TaskView({report}: TaskViewProps) {
                                     <Text style={styles.taskTitleDescription}>{translate('task.title')}</Text>
                                     <View style={[styles.flexRow, styles.flex1]}>
                                         <Checkbox
-                                            onPress={callFnIfActionIsAllowed(() => {
+                                            onPress={callFunctionIfActionIsAllowed(() => {
                                                 // If we're already navigating to these task editing pages, early return not to mark as completed, otherwise we would have not found page.
                                                 if (isActiveTaskEditRoute(report?.reportID)) {
                                                     return;
diff --git a/src/components/Search/SearchRouter/SearchButton.tsx b/src/components/Search/SearchRouter/SearchButton.tsx
index 8d538214b323..e9d0de8cb9b5 100644
--- a/src/components/Search/SearchRouter/SearchButton.tsx
+++ b/src/components/Search/SearchRouter/SearchButton.tsx
@@ -8,7 +8,7 @@ import useLocalize from '@hooks/useLocalize';
 import useTheme from '@hooks/useTheme';
 import useThemeStyles from '@hooks/useThemeStyles';
 import Performance from '@libs/Performance';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import Timing from '@userActions/Timing';
 import CONST from '@src/CONST';
 import {useSearchRouterContext} from './SearchRouterContext';
@@ -32,7 +32,7 @@ function SearchButton({style}: SearchButtonProps) {
                 accessibilityLabel={translate('common.search')}
                 style={[styles.flexRow, styles.touchableButtonImage, style]}
                 // eslint-disable-next-line react-compiler/react-compiler
-                onPress={callFnIfActionIsAllowed(() => {
+                onPress={callFunctionIfActionIsAllowed(() => {
                     pressableRef?.current?.blur();
 
                     Timing.start(CONST.TIMING.OPEN_SEARCH);
diff --git a/src/components/TaskHeaderActionButton.tsx b/src/components/TaskHeaderActionButton.tsx
index 7c2481c5c17f..7265ef82a95c 100644
--- a/src/components/TaskHeaderActionButton.tsx
+++ b/src/components/TaskHeaderActionButton.tsx
@@ -4,7 +4,7 @@ import useLocalize from '@hooks/useLocalize';
 import useThemeStyles from '@hooks/useThemeStyles';
 import {canWriteInReport, isCompletedTaskReport} from '@libs/ReportUtils';
 import {isActiveTaskEditRoute} from '@libs/TaskUtils';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import {canActionTask, completeTask, reopenTask} from '@userActions/Task';
 import CONST from '@src/CONST';
 import type * as OnyxTypes from '@src/types/onyx';
@@ -31,7 +31,7 @@ function TaskHeaderActionButton({report}: TaskHeaderActionButtonProps) {
                 success
                 isDisabled={!canActionTask(report, session?.accountID ?? CONST.DEFAULT_NUMBER_ID)}
                 text={translate(isCompletedTaskReport(report) ? 'task.markAsIncomplete' : 'task.markAsComplete')}
-                onPress={callFnIfActionIsAllowed(() => {
+                onPress={callFunctionIfActionIsAllowed(() => {
                     // If we're already navigating to these task editing pages, early return not to mark as completed, otherwise we would have not found page.
                     if (isActiveTaskEditRoute(report.reportID)) {
                         return;
diff --git a/src/libs/HeaderUtils.ts b/src/libs/HeaderUtils.ts
index 7bdd96ae3827..8988094f6965 100644
--- a/src/libs/HeaderUtils.ts
+++ b/src/libs/HeaderUtils.ts
@@ -3,7 +3,7 @@ import * as Expensicons from '@components/Icon/Expensicons';
 import ROUTES from '@src/ROUTES';
 import type OnyxReport from '@src/types/onyx/Report';
 import {togglePinnedState} from './actions/Report';
-import {callFnIfActionIsAllowed} from './actions/Session';
+import {callFunctionIfActionIsAllowed} from './actions/Session';
 import {translateLocal} from './Localize';
 import Navigation from './Navigation/Navigation';
 
@@ -13,7 +13,7 @@ function getPinMenuItem(report: OnyxReport): ThreeDotsMenuItem {
     return {
         icon: Expensicons.Pin,
         text: translateLocal(isPinned ? 'common.unPin' : 'common.pin'),
-        onSelected: callFnIfActionIsAllowed(() => togglePinnedState(report.reportID, isPinned)),
+        onSelected: callFunctionIfActionIsAllowed(() => togglePinnedState(report.reportID, isPinned)),
     };
 }
 
diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx
index f8db02dabdb6..60a9ce35dee9 100644
--- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx
+++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx
@@ -380,7 +380,7 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie
         const unsubscribeSearchShortcut = KeyboardShortcut.subscribe(
             searchShortcutConfig.shortcutKey,
             () => {
-                Session.callFnIfActionIsAllowed(() => {
+                Session.callFunctionIfActionIsAllowed(() => {
                     const state = navigationRef.getRootState();
                     const currentFocusedRoute = findFocusedRoute(state);
                     if (isOnboardingFlowName(currentFocusedRoute?.name)) {
@@ -397,7 +397,7 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie
         const unsubscribeChatShortcut = KeyboardShortcut.subscribe(
             chatShortcutConfig.shortcutKey,
             () => {
-                Modal.close(Session.callFnIfActionIsAllowed(() => Navigation.navigate(ROUTES.NEW)));
+                Modal.close(Session.callFunctionIfActionIsAllowed(() => Navigation.navigate(ROUTES.NEW)));
             },
             chatShortcutConfig.descriptionKey,
             chatShortcutConfig.modifiers,
diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts
index a0cf35bfd44c..512019b6db6e 100644
--- a/src/libs/actions/Session/index.ts
+++ b/src/libs/actions/Session/index.ts
@@ -301,7 +301,7 @@ function signOutAndRedirectToSignIn(shouldResetToHome?: boolean, shouldStashSess
  * @returns same callback if the action is allowed, otherwise a function that signs out and redirects to sign in
  */
 // eslint-disable-next-line @typescript-eslint/no-explicit-any
-function callFnIfActionIsAllowed<TCallback extends ((...args: any[]) => any) | void>(callback: TCallback, isAnonymousAction = false): TCallback | (() => void) {
+function callFunctionIfActionIsAllowed<TCallback extends ((...args: any[]) => any) | void>(callback: TCallback, isAnonymousAction = false): TCallback | (() => void) {
     if (isAnonymousUser() && !isAnonymousAction) {
         return () => signOutAndRedirectToSignIn();
     }
@@ -1299,7 +1299,7 @@ export {
     beginAppleSignIn,
     beginGoogleSignIn,
     setSupportAuthToken,
-    callFnIfActionIsAllowed,
+    callFunctionIfActionIsAllowed,
     signIn,
     signInWithValidateCode,
     handleExitToNavigation,
diff --git a/src/pages/FlagCommentPage.tsx b/src/pages/FlagCommentPage.tsx
index 77accf338093..980558359cec 100644
--- a/src/pages/FlagCommentPage.tsx
+++ b/src/pages/FlagCommentPage.tsx
@@ -16,7 +16,7 @@ import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavig
 import type {FlagCommentNavigatorParamList} from '@libs/Navigation/types';
 import {canFlagReportAction, isChatThread, shouldShowFlagComment} from '@libs/ReportUtils';
 import {flagComment as flagCommentUtil} from '@userActions/Report';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import type SCREENS from '@src/SCREENS';
 import withReportAndReportActionOrNotFound from './home/report/withReportAndReportActionOrNotFound';
@@ -122,7 +122,7 @@ function FlagCommentPage({parentReportAction, route, report, parentReport, repor
             shouldShowRightIcon
             title={item.name}
             description={item.description}
-            onPress={callFnIfActionIsAllowed(() => flagComment(item.severity))}
+            onPress={callFunctionIfActionIsAllowed(() => flagComment(item.severity))}
             style={[styles.pt2, styles.pb4, styles.ph5, styles.flexRow]}
             furtherDetails={item.furtherDetails}
             furtherDetailsIcon={item.furtherDetailsIcon}
diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx
index 7aca6b8202a0..5e2bad5cab1f 100755
--- a/src/pages/ProfilePage.tsx
+++ b/src/pages/ProfilePage.tsx
@@ -41,7 +41,7 @@ import type {ProfileNavigatorParamList} from '@navigation/types';
 import {openExternalLink} from '@userActions/Link';
 import {openPublicProfilePage} from '@userActions/PersonalDetails';
 import {hasErrorInPrivateNotes} from '@userActions/Report';
-import {callFnIfActionIsAllowed, isAnonymousUser as isAnonymousUserSession} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed, isAnonymousUser as isAnonymousUserSession} from '@userActions/Session';
 import CONST from '@src/CONST';
 import type {TranslationPaths} from '@src/languages/types';
 import ONYXKEYS from '@src/ONYXKEYS';
@@ -302,7 +302,7 @@ function ProfilePage({route}: ProfilePageProps) {
                                 title={translate('videoChatButtonAndMenu.tooltip')}
                                 icon={Expensicons.Phone}
                                 isAnonymousAction={false}
-                                onPress={callFnIfActionIsAllowed(() => {
+                                onPress={callFunctionIfActionIsAllowed(() => {
                                     openExternalLink(guideCalendarLink);
                                 })}
                             />
diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx
index 4863886f3f94..66b66d482bba 100644
--- a/src/pages/ReportDetailsPage.tsx
+++ b/src/pages/ReportDetailsPage.tsx
@@ -124,7 +124,7 @@ import {
     setDeleteTransactionNavigateBackUrl,
     updateGroupChatAvatar,
 } from '@userActions/Report';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import {canActionTask as canActionTaskAction, canModifyTask as canModifyTaskAction, deleteTask, reopenTask} from '@userActions/Task';
 import CONST from '@src/CONST';
 import type {TranslationPaths} from '@src/languages/types';
@@ -512,7 +512,7 @@ function ReportDetailsPage({policies, report, route, reportMetadata}: ReportDeta
                     icon: Expensicons.Checkmark,
                     translationKey: 'task.markAsIncomplete',
                     isAnonymousAction: false,
-                    action: callFnIfActionIsAllowed(() => {
+                    action: callFunctionIfActionIsAllowed(() => {
                         Navigation.dismissModal();
                         reopenTask(report);
                     }),
diff --git a/src/pages/home/HeaderView.tsx b/src/pages/home/HeaderView.tsx
index 993ddd740253..f1f3083277f2 100644
--- a/src/pages/home/HeaderView.tsx
+++ b/src/pages/home/HeaderView.tsx
@@ -62,7 +62,7 @@ import {shouldShowDiscountBanner} from '@libs/SubscriptionUtils';
 import EarlyDiscountBanner from '@pages/settings/Subscription/CardSection/BillingBanner/EarlyDiscountBanner';
 import FreeTrial from '@pages/settings/Subscription/FreeTrial';
 import {joinRoom} from '@userActions/Report';
-import {callFnIfActionIsAllowed} from '@userActions/Session';
+import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import {deleteTask} from '@userActions/Task';
 import CONST from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
@@ -158,7 +158,7 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked,
 
     const shouldShowGuideBooking = !!account && report?.reportID === account?.adminsRoomReportID && !!account?.guideDetails?.calendarLink;
 
-    const join = callFnIfActionIsAllowed(() => joinRoom(report));
+    const join = callFunctionIfActionIsAllowed(() => joinRoom(report));
 
     const canJoin = canJoinChat(report, parentReportAction, policy);
 
diff --git a/src/pages/workspace/WorkspacesListPage.tsx b/src/pages/workspace/WorkspacesListPage.tsx
index 7ad40c3bb76a..cdf6a798aa11 100755
--- a/src/pages/workspace/WorkspacesListPage.tsx
+++ b/src/pages/workspace/WorkspacesListPage.tsx
@@ -28,7 +28,7 @@ import useTheme from '@hooks/useTheme';
 import useThemeStyles from '@hooks/useThemeStyles';
 import {isConnectionInProgress} from '@libs/actions/connections';
 import {clearDeleteWorkspaceError, clearErrors, deleteWorkspace, leaveWorkspace, removeWorkspace, updateDefaultPolicy} from '@libs/actions/Policy/Policy';
-import {callFnIfActionIsAllowed, isSupportAuthToken} from '@libs/actions/Session';
+import {callFunctionIfActionIsAllowed, isSupportAuthToken} from '@libs/actions/Session';
 import interceptAnonymousUser from '@libs/interceptAnonymousUser';
 import localeCompare from '@libs/LocaleCompare';
 import getTopmostBottomTabRoute from '@libs/Navigation/getTopmostBottomTabRoute';
@@ -203,7 +203,7 @@ function WorkspacesListPage() {
                 threeDotsMenuItems.push({
                     icon: Expensicons.Exit,
                     text: translate('common.leave'),
-                    onSelected: callFnIfActionIsAllowed(() => leaveWorkspace(item.policyID)),
+                    onSelected: callFunctionIfActionIsAllowed(() => leaveWorkspace(item.policyID)),
                 });
             }
 

From 778b85d4932988d9d5779f0f1aefc132abe5357d Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Wed, 29 Jan 2025 03:00:04 +0530
Subject: [PATCH 11/14] fix lint errors

---
 src/ROUTES.ts                         | 12 ++++++++++--
 src/components/PromotedActionsBar.tsx |  2 +-
 src/libs/HeaderUtils.ts               |  2 +-
 src/libs/actions/Report.ts            |  2 +-
 src/pages/FlagCommentPage.tsx         |  2 +-
 5 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/ROUTES.ts b/src/ROUTES.ts
index 9972c03d7b68..fa2af9ff51a4 100644
--- a/src/ROUTES.ts
+++ b/src/ROUTES.ts
@@ -68,7 +68,10 @@ const ROUTES = {
     SEARCH_ADVANCED_FILTERS_POSTED: 'search/filters/posted',
     SEARCH_REPORT: {
         route: 'search/view/:reportID/:reportActionID?',
-        getRoute: ({reportID, reportActionID, backTo}: {reportID: string; reportActionID?: string; backTo?: string}) => {
+        getRoute: ({reportID, reportActionID, backTo}: {reportID: string | undefined; reportActionID?: string; backTo?: string}) => {
+            if (!reportID) {
+                Log.warn('Invalid reportID is used to build the SEARCH_REPORT route');
+            }
             const baseRoute = reportActionID ? (`search/view/${reportID}/${reportActionID}` as const) : (`search/view/${reportID}` as const);
             return getUrlWithBackToParam(baseRoute, backTo);
         },
@@ -337,7 +340,12 @@ const ROUTES = {
     },
     REPORT_WITH_ID_DETAILS_SHARE_CODE: {
         route: 'r/:reportID/details/shareCode',
-        getRoute: (reportID: string, backTo?: string) => getUrlWithBackToParam(`r/${reportID}/details/shareCode` as const, backTo),
+        getRoute: (reportID: string | undefined, backTo?: string) => {
+            if (!reportID){
+                Log.warn('Invalid reportID is used to build the REPORT_WITH_ID_DETAILS_SHARE_CODE route');
+            }
+            return getUrlWithBackToParam(`r/${reportID}/details/shareCode` as const, backTo)
+        },
     },
     ATTACHMENTS: {
         route: 'attachment',
diff --git a/src/components/PromotedActionsBar.tsx b/src/components/PromotedActionsBar.tsx
index 6c5d8a06416e..79a213dc15b0 100644
--- a/src/components/PromotedActionsBar.tsx
+++ b/src/components/PromotedActionsBar.tsx
@@ -92,7 +92,7 @@ const PromotedActions = {
             if (!isTextHold) {
                 Navigation.goBack();
             }
-            const targetedReportID = reportID ?? reportAction?.childReportID ?? '';
+            const targetedReportID = reportID ?? reportAction?.childReportID;
             const topmostCentralPaneRoute = getTopmostCentralPaneRoute(navigationRef.getRootState() as State<RootStackParamList>);
 
             if (topmostCentralPaneRoute?.name !== SCREENS.SEARCH.CENTRAL_PANE && isTextHold) {
diff --git a/src/libs/HeaderUtils.ts b/src/libs/HeaderUtils.ts
index 8988094f6965..d23277448d15 100644
--- a/src/libs/HeaderUtils.ts
+++ b/src/libs/HeaderUtils.ts
@@ -21,7 +21,7 @@ function getShareMenuItem(report: OnyxReport, backTo?: string): ThreeDotsMenuIte
     return {
         icon: Expensicons.QrCode,
         text: translateLocal('common.share'),
-        onSelected: () => Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS_SHARE_CODE.getRoute(report?.reportID ?? '', backTo)),
+        onSelected: () => Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS_SHARE_CODE.getRoute(report?.reportID, backTo)),
     };
 }
 
diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts
index fa6046c6baa4..f01a9bf55f1d 100644
--- a/src/libs/actions/Report.ts
+++ b/src/libs/actions/Report.ts
@@ -3436,7 +3436,7 @@ function openLastOpenedPublicRoom(lastOpenedPublicRoomID: string) {
 }
 
 /** Flag a comment as offensive */
-function flagComment(reportID: string, reportAction: OnyxEntry<ReportAction>, severity: string) {
+function flagComment(reportID: string | undefined, reportAction: OnyxEntry<ReportAction>, severity: string) {
     const originalReportID = getOriginalReportID(reportID, reportAction);
     const message = ReportActionsUtils.getReportActionMessage(reportAction);
 
diff --git a/src/pages/FlagCommentPage.tsx b/src/pages/FlagCommentPage.tsx
index 980558359cec..8db504520529 100644
--- a/src/pages/FlagCommentPage.tsx
+++ b/src/pages/FlagCommentPage.tsx
@@ -110,7 +110,7 @@ function FlagCommentPage({parentReportAction, route, report, parentReport, repor
         }
 
         if (reportAction && canFlagReportAction(reportAction, reportID)) {
-            flagCommentUtil(reportID ?? '-1', reportAction, severity);
+            flagCommentUtil(reportID, reportAction, severity);
         }
 
         Navigation.dismissModal();

From a9dcd98dc8e69411e1b612cd0ec8a39e94680ae3 Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Wed, 29 Jan 2025 03:17:51 +0530
Subject: [PATCH 12/14] format

---
 src/ROUTES.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ROUTES.ts b/src/ROUTES.ts
index fa2af9ff51a4..14313496d211 100644
--- a/src/ROUTES.ts
+++ b/src/ROUTES.ts
@@ -341,10 +341,10 @@ const ROUTES = {
     REPORT_WITH_ID_DETAILS_SHARE_CODE: {
         route: 'r/:reportID/details/shareCode',
         getRoute: (reportID: string | undefined, backTo?: string) => {
-            if (!reportID){
+            if (!reportID) {
                 Log.warn('Invalid reportID is used to build the REPORT_WITH_ID_DETAILS_SHARE_CODE route');
             }
-            return getUrlWithBackToParam(`r/${reportID}/details/shareCode` as const, backTo)
+            return getUrlWithBackToParam(`r/${reportID}/details/shareCode` as const, backTo);
         },
     },
     ATTACHMENTS: {

From 47ccefcbf3bcebc573d08a16c5a89d8f76d0c82d Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Thu, 30 Jan 2025 01:57:38 +0530
Subject: [PATCH 13/14] do withOnyx to useOnyx Migration

---
 .../Reactions/MiniQuickEmojiReactions.tsx     | 29 +++++--------------
 .../BaseQuickEmojiReactions.tsx               | 23 +++++----------
 2 files changed, 14 insertions(+), 38 deletions(-)

diff --git a/src/components/Reactions/MiniQuickEmojiReactions.tsx b/src/components/Reactions/MiniQuickEmojiReactions.tsx
index af1a1c96efb7..7c8b02412df9 100644
--- a/src/components/Reactions/MiniQuickEmojiReactions.tsx
+++ b/src/components/Reactions/MiniQuickEmojiReactions.tsx
@@ -1,6 +1,6 @@
 import React, {useRef} from 'react';
 import {View} from 'react-native';
-import {withOnyx} from 'react-native-onyx';
+import {useOnyx} from 'react-native-onyx';
 import type {Emoji} from '@assets/emojis/types';
 import BaseMiniContextMenuItem from '@components/BaseMiniContextMenuItem';
 import Icon from '@components/Icon';
@@ -16,7 +16,7 @@ import {emojiPickerRef, showEmojiPicker} from '@userActions/EmojiPickerAction';
 import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
-import type {BaseQuickEmojiReactionsOnyxProps, BaseQuickEmojiReactionsProps} from './QuickEmojiReactions/types';
+import type {BaseQuickEmojiReactionsProps} from './QuickEmojiReactions/types';
 
 type MiniQuickEmojiReactionsProps = BaseQuickEmojiReactionsProps & {
     /**
@@ -32,19 +32,14 @@ type MiniQuickEmojiReactionsProps = BaseQuickEmojiReactionsProps & {
  * context menu which we just show on web, when hovering
  * a message.
  */
-function MiniQuickEmojiReactions({
-    reportAction,
-    onEmojiSelected,
-    preferredLocale = CONST.LOCALES.DEFAULT,
-    preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE,
-    emojiReactions = {},
-    onPressOpenPicker = () => {},
-    onEmojiPickerClosed = () => {},
-}: MiniQuickEmojiReactionsProps) {
+function MiniQuickEmojiReactions({reportAction, reportActionID, onEmojiSelected, onPressOpenPicker = () => {}, onEmojiPickerClosed = () => {}}: MiniQuickEmojiReactionsProps) {
     const styles = useThemeStyles();
     const StyleUtils = useStyleUtils();
     const ref = useRef<View>(null);
     const {translate} = useLocalize();
+    const [preferredLocale] = useOnyx(ONYXKEYS.NVP_PREFERRED_LOCALE, {initialValue: CONST.LOCALES.DEFAULT});
+    const [preferredSkinTone] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {initialValue: CONST.EMOJI_DEFAULT_SKIN_TONE});
+    const [emojiReactions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${reportActionID}`, {initialValue: {}});
 
     const openEmojiPicker = () => {
         onPressOpenPicker();
@@ -104,14 +99,4 @@ function MiniQuickEmojiReactions({
 
 MiniQuickEmojiReactions.displayName = 'MiniQuickEmojiReactions';
 
-export default withOnyx<MiniQuickEmojiReactionsProps, BaseQuickEmojiReactionsOnyxProps>({
-    preferredSkinTone: {
-        key: ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE,
-    },
-    emojiReactions: {
-        key: ({reportActionID}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${reportActionID}`,
-    },
-    preferredLocale: {
-        key: ONYXKEYS.NVP_PREFERRED_LOCALE,
-    },
-})(MiniQuickEmojiReactions);
+export default MiniQuickEmojiReactions;
diff --git a/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx b/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
index 546711bba80f..246c9a5dd0d5 100644
--- a/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
+++ b/src/components/Reactions/QuickEmojiReactions/BaseQuickEmojiReactions.tsx
@@ -1,6 +1,6 @@
 import React from 'react';
 import {View} from 'react-native';
-import {withOnyx} from 'react-native-onyx';
+import {useOnyx} from 'react-native-onyx';
 import type {Emoji} from '@assets/emojis/types';
 import AddReactionBubble from '@components/Reactions/AddReactionBubble';
 import EmojiReactionBubble from '@components/Reactions/EmojiReactionBubble';
@@ -10,19 +10,20 @@ import {getLocalizedEmojiName, getPreferredEmojiCode} from '@libs/EmojiUtils';
 import {callFunctionIfActionIsAllowed} from '@userActions/Session';
 import CONST from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
-import type {BaseQuickEmojiReactionsOnyxProps, BaseQuickEmojiReactionsProps} from './types';
+import type {BaseQuickEmojiReactionsProps} from './types';
 
 function BaseQuickEmojiReactions({
     reportAction,
+    reportActionID,
     onEmojiSelected,
-    preferredLocale = CONST.LOCALES.DEFAULT,
-    preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE,
-    emojiReactions = {},
     onPressOpenPicker = () => {},
     onWillShowPicker = () => {},
     setIsEmojiPickerActive,
 }: BaseQuickEmojiReactionsProps) {
     const styles = useThemeStyles();
+    const [preferredLocale] = useOnyx(ONYXKEYS.NVP_PREFERRED_LOCALE, {initialValue: CONST.LOCALES.DEFAULT});
+    const [preferredSkinTone] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {initialValue: CONST.EMOJI_DEFAULT_SKIN_TONE});
+    const [emojiReactions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${reportActionID}`, {initialValue: {}});
 
     return (
         <View style={styles.quickReactionsContainer}>
@@ -54,14 +55,4 @@ function BaseQuickEmojiReactions({
 
 BaseQuickEmojiReactions.displayName = 'BaseQuickEmojiReactions';
 
-export default withOnyx<BaseQuickEmojiReactionsProps, BaseQuickEmojiReactionsOnyxProps>({
-    preferredSkinTone: {
-        key: ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE,
-    },
-    emojiReactions: {
-        key: ({reportActionID}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${reportActionID}`,
-    },
-    preferredLocale: {
-        key: ONYXKEYS.NVP_PREFERRED_LOCALE,
-    },
-})(BaseQuickEmojiReactions);
+export default BaseQuickEmojiReactions;

From 7eead5820bbd29bdf38c1412b92f3693b6b8cccd Mon Sep 17 00:00:00 2001
From: Ishpaul Singh <ishpaul207@gmail.com>
Date: Thu, 30 Jan 2025 02:11:11 +0530
Subject: [PATCH 14/14] fix type error

---
 .../Reactions/QuickEmojiReactions/types.ts      | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/components/Reactions/QuickEmojiReactions/types.ts b/src/components/Reactions/QuickEmojiReactions/types.ts
index 0021f33ce2c0..447c13c70818 100644
--- a/src/components/Reactions/QuickEmojiReactions/types.ts
+++ b/src/components/Reactions/QuickEmojiReactions/types.ts
@@ -3,7 +3,7 @@ import type {TextInput, View} from 'react-native';
 import type {OnyxEntry} from 'react-native-onyx';
 import type {Emoji} from '@assets/emojis/types';
 import type {AnchorOrigin} from '@userActions/EmojiPickerAction';
-import type {Locale, ReportAction, ReportActionReactions} from '@src/types/onyx';
+import type {ReportAction, ReportActionReactions} from '@src/types/onyx';
 
 type PickerRefElement = RefObject<TextInput | View>;
 
@@ -37,18 +37,7 @@ type BaseReactionsProps = {
     setIsEmojiPickerActive?: (state: boolean) => void;
 };
 
-type BaseQuickEmojiReactionsOnyxProps = {
-    /** All the emoji reactions for the report action. */
-    emojiReactions: OnyxEntry<ReportActionReactions>;
-
-    /** The user's preferred locale. */
-    preferredLocale: OnyxEntry<Locale>;
-
-    /** The user's preferred skin tone. */
-    preferredSkinTone: OnyxEntry<string | number>;
-};
-
-type BaseQuickEmojiReactionsProps = BaseReactionsProps & BaseQuickEmojiReactionsOnyxProps;
+type BaseQuickEmojiReactionsProps = BaseReactionsProps;
 
 type QuickEmojiReactionsProps = BaseReactionsProps & {
     /**
@@ -60,4 +49,4 @@ type QuickEmojiReactionsProps = BaseReactionsProps & {
     setIsEmojiPickerActive?: (state: boolean) => void;
 };
 
-export type {BaseQuickEmojiReactionsProps, BaseQuickEmojiReactionsOnyxProps, QuickEmojiReactionsProps, OpenPickerCallback, CloseContextMenuCallback, PickerRefElement};
+export type {BaseQuickEmojiReactionsProps, QuickEmojiReactionsProps, OpenPickerCallback, CloseContextMenuCallback, PickerRefElement};
