diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index cc1e8bada747..d0049dfe5865 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -3,7 +3,7 @@ import {Str} from 'expensify-common'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; -import {useOnyx, withOnyx} from 'react-native-onyx'; +import {useOnyx} from 'react-native-onyx'; import type {ValueOf} from 'type-fest'; import AvatarWithImagePicker from '@components/AvatarWithImagePicker'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; @@ -64,14 +64,7 @@ type ReportDetailsPageMenuItem = { shouldShowRightIcon?: boolean; }; -type ReportDetailsPageOnyxProps = { - /** Personal details of all the users */ - personalDetails: OnyxEntry; - - /** Session info for the currently logged in user. */ - session: OnyxEntry; -}; -type ReportDetailsPageProps = ReportDetailsPageOnyxProps & WithReportOrNotFoundProps & StackScreenProps; +type ReportDetailsPageProps = WithReportOrNotFoundProps & StackScreenProps; const CASES = { DEFAULT: 'default', @@ -81,7 +74,7 @@ const CASES = { type CaseID = ValueOf; -function ReportDetailsPage({policies, report, session, personalDetails}: ReportDetailsPageProps) { +function ReportDetailsPage({policies, report}: ReportDetailsPageProps) { const {translate} = useLocalize(); const {isOffline} = useNetwork(); const styles = useThemeStyles(); @@ -101,6 +94,8 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD const [transactionThreadReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`); const [isDebugModeEnabled] = useOnyx(ONYXKEYS.USER, {selector: (user) => !!user?.isDebugModeEnabled}); + const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); + const [session] = useOnyx(ONYXKEYS.SESSION); const [isLastMemberLeavingGroupModalVisible, setIsLastMemberLeavingGroupModalVisible] = useState(false); const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false); @@ -861,13 +856,4 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD ReportDetailsPage.displayName = 'ReportDetailsPage'; -export default withReportOrNotFound()( - withOnyx({ - personalDetails: { - key: ONYXKEYS.PERSONAL_DETAILS_LIST, - }, - session: { - key: ONYXKEYS.SESSION, - }, - })(ReportDetailsPage), -); +export default withReportOrNotFound()(ReportDetailsPage);