From 9ca4f59a4e1a97b8dcc2991a8156d6ddc5bae980 Mon Sep 17 00:00:00 2001 From: truph01 Date: Tue, 17 Dec 2024 11:21:35 +0700 Subject: [PATCH] fix: remove withOnyx --- src/pages/signin/EmailDeliveryFailurePage.tsx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/pages/signin/EmailDeliveryFailurePage.tsx b/src/pages/signin/EmailDeliveryFailurePage.tsx index 1d50717b629b..272e4f78aeba 100644 --- a/src/pages/signin/EmailDeliveryFailurePage.tsx +++ b/src/pages/signin/EmailDeliveryFailurePage.tsx @@ -1,8 +1,7 @@ import {Str} from 'expensify-common'; import React, {useEffect, useMemo} from 'react'; import {Keyboard, View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; -import type {OnyxEntry} from 'react-native-onyx'; +import {useOnyx} from 'react-native-onyx'; import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; import Text from '@components/Text'; import TextLink from '@components/TextLink'; @@ -12,16 +11,9 @@ import useThemeStyles from '@hooks/useThemeStyles'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import type {Credentials} from '@src/types/onyx'; -type EmailDeliveryFailurePageOnyxProps = { - /** The credentials of the logged in person */ - credentials: OnyxEntry; -}; - -type EmailDeliveryFailurePageProps = EmailDeliveryFailurePageOnyxProps; - -function EmailDeliveryFailurePage({credentials}: EmailDeliveryFailurePageProps) { +function EmailDeliveryFailurePage() { + const [credentials] = useOnyx(ONYXKEYS.CREDENTIALS); const styles = useThemeStyles(); const {isKeyboardShown} = useKeyboardState(); const {translate} = useLocalize(); @@ -90,6 +82,4 @@ function EmailDeliveryFailurePage({credentials}: EmailDeliveryFailurePageProps) EmailDeliveryFailurePage.displayName = 'EmailDeliveryFailurePage'; -export default withOnyx({ - credentials: {key: ONYXKEYS.CREDENTIALS}, -})(EmailDeliveryFailurePage); +export default EmailDeliveryFailurePage;