From ea97c12d21a342d1dbf614740807f86ce13ce5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20M=C3=B3rawski?= Date: Tue, 13 Feb 2024 17:29:54 +0100 Subject: [PATCH] typecheck fixes --- src/pages/ShareCodePage.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/ShareCodePage.tsx b/src/pages/ShareCodePage.tsx index 138aa729fcc2..e4e2a90c4157 100644 --- a/src/pages/ShareCodePage.tsx +++ b/src/pages/ShareCodePage.tsx @@ -12,8 +12,7 @@ import QRShareWithDownload from '@components/QRShare/QRShareWithDownload'; import type QRShareWithDownloadHandle from '@components/QRShare/QRShareWithDownload/types'; import ScreenWrapper from '@components/ScreenWrapper'; import Section from '@components/Section'; -import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; -import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; +import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; import useEnvironment from '@hooks/useEnvironment'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -28,9 +27,9 @@ import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; import type {Report, Session} from '@src/types/onyx'; -type ShareCodePageOnyxProps = WithCurrentUserPersonalDetailsProps & { +type ShareCodePageOnyxProps = { /** Session info for the currently logged in user. */ - session: OnyxEntry; + session?: OnyxEntry; /** The report currently being looked at */ report?: OnyxEntry; @@ -38,12 +37,13 @@ type ShareCodePageOnyxProps = WithCurrentUserPersonalDetailsProps & { type ShareCodePageProps = ShareCodePageOnyxProps; -function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodePageProps) { +function ShareCodePage({report, session}: ShareCodePageProps) { const themeStyles = useThemeStyles(); const {translate} = useLocalize(); const {environmentURL} = useEnvironment(); const qrCodeRef = useRef(null); const {isSmallScreenWidth} = useWindowDimensions(); + const currentUserPersonalDetails = useCurrentUserPersonalDetails(); const isReport = !!report?.reportID; @@ -145,4 +145,4 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP ShareCodePage.displayName = 'ShareCodePage'; -export default withCurrentUserPersonalDetails(ShareCodePage); +export default ShareCodePage;