@@ -12,8 +12,7 @@ import QRShareWithDownload from '@components/QRShare/QRShareWithDownload';
12
12
import type QRShareWithDownloadHandle from '@components/QRShare/QRShareWithDownload/types' ;
13
13
import ScreenWrapper from '@components/ScreenWrapper' ;
14
14
import Section from '@components/Section' ;
15
- import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails' ;
16
- import type { WithCurrentUserPersonalDetailsProps } from '@components/withCurrentUserPersonalDetails' ;
15
+ import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails' ;
17
16
import useEnvironment from '@hooks/useEnvironment' ;
18
17
import useLocalize from '@hooks/useLocalize' ;
19
18
import useThemeStyles from '@hooks/useThemeStyles' ;
@@ -28,22 +27,23 @@ import CONST from '@src/CONST';
28
27
import ROUTES from '@src/ROUTES' ;
29
28
import type { Report , Session } from '@src/types/onyx' ;
30
29
31
- type ShareCodePageOnyxProps = WithCurrentUserPersonalDetailsProps & {
30
+ type ShareCodePageOnyxProps = {
32
31
/** Session info for the currently logged in user. */
33
- session : OnyxEntry < Session > ;
32
+ session ? : OnyxEntry < Session > ;
34
33
35
34
/** The report currently being looked at */
36
35
report ?: OnyxEntry < Report > ;
37
36
} ;
38
37
39
38
type ShareCodePageProps = ShareCodePageOnyxProps ;
40
39
41
- function ShareCodePage ( { report, session, currentUserPersonalDetails } : ShareCodePageProps ) {
40
+ function ShareCodePage ( { report, session} : ShareCodePageProps ) {
42
41
const themeStyles = useThemeStyles ( ) ;
43
42
const { translate} = useLocalize ( ) ;
44
43
const { environmentURL} = useEnvironment ( ) ;
45
44
const qrCodeRef = useRef < QRShareWithDownloadHandle > ( null ) ;
46
45
const { isSmallScreenWidth} = useWindowDimensions ( ) ;
46
+ const currentUserPersonalDetails = useCurrentUserPersonalDetails ( ) ;
47
47
48
48
const isReport = ! ! report ?. reportID ;
49
49
@@ -145,4 +145,4 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP
145
145
146
146
ShareCodePage . displayName = 'ShareCodePage' ;
147
147
148
- export default withCurrentUserPersonalDetails ( ShareCodePage ) ;
148
+ export default ShareCodePage ;
0 commit comments