From 29da6297c64ebdb68ca1b4c4f8168b9aef3fcbe9 Mon Sep 17 00:00:00 2001 From: shubham-eaton Date: Fri, 20 Dec 2024 22:10:58 +0530 Subject: [PATCH] Fixed react warning --- .../AccountDetailsScreenBase.tsx | 9 ++++----- .../ContactScreen/ContactSupportScreenBase.tsx | 9 ++++----- .../CreateAccountScreenBase.tsx | 9 ++++----- .../CreatePasswordScreenBase.tsx | 17 ++++++++++------- .../src/screens/EulaScreen/EulaScreenBase.tsx | 8 ++++---- .../ForgotPasswordScreenBase.tsx | 9 ++++----- .../ResetPasswordScreenBase.tsx | 16 +++++++++++----- .../screens/SuccessScreen/SuccessScreenBase.tsx | 17 +++++++++++------ .../VerifyCodeScreen/VerifyCodeScreenBase.tsx | 9 ++++----- 9 files changed, 56 insertions(+), 47 deletions(-) diff --git a/login-workflow/src/screens/AccountDetailsScreen/AccountDetailsScreenBase.tsx b/login-workflow/src/screens/AccountDetailsScreen/AccountDetailsScreenBase.tsx index 95abc2f7..1165473a 100644 --- a/login-workflow/src/screens/AccountDetailsScreen/AccountDetailsScreenBase.tsx +++ b/login-workflow/src/screens/AccountDetailsScreen/AccountDetailsScreenBase.tsx @@ -30,14 +30,13 @@ export const AccountDetailsScreenBase: React.FC = (pr lastNameValidator = (): void => {}, lastNameTextFieldProps, errorDisplayConfig, + WorkflowCardBaseProps: cardBaseProps = {}, + WorkflowCardInstructionProps: instructionsProps = {}, + WorkflowCardActionsProps: actionsProps = {}, + WorkflowCardHeaderProps: headerProps = {}, ...otherProps } = props; - const cardBaseProps = props.WorkflowCardBaseProps || {}; - const headerProps = props.WorkflowCardHeaderProps || {}; - const instructionsProps = props.WorkflowCardInstructionProps || {}; - const actionsProps = props.WorkflowCardActionsProps || {}; - const firstNameRef = useRef(null); const lastNameRef = useRef(null); diff --git a/login-workflow/src/screens/ContactScreen/ContactSupportScreenBase.tsx b/login-workflow/src/screens/ContactScreen/ContactSupportScreenBase.tsx index ba56a063..d0fcda3c 100644 --- a/login-workflow/src/screens/ContactScreen/ContactSupportScreenBase.tsx +++ b/login-workflow/src/screens/ContactScreen/ContactSupportScreenBase.tsx @@ -50,16 +50,15 @@ export const ContactSupportScreenBase: React.FC = (pr contactPhone, dismissButtonLabel, onDismiss, + WorkflowCardBaseProps: cardBaseProps = {}, + WorkflowCardInstructionProps: instructionsProps = {}, + WorkflowCardActionsProps: actionsProps = {}, + WorkflowCardHeaderProps: headerProps = {}, ...otherProps } = props; const defaultClasses = useUtilityClasses(props); - const cardBaseProps = props.WorkflowCardBaseProps || {}; - const headerProps = props.WorkflowCardHeaderProps || {}; - const instructionsProps = props.WorkflowCardInstructionProps || {}; - const actionsProps = props.WorkflowCardActionsProps || {}; - return ( > = (props) => { - const cardBaseProps = props.WorkflowCardBaseProps || {}; - const headerProps = props.WorkflowCardHeaderProps || {}; - const instructionsProps = props.WorkflowCardInstructionProps || {}; - const actionsProps = props.WorkflowCardActionsProps || {}; - const passwordProps = props.PasswordProps || { onPasswordChange: () => ({}) }; - const { errorDisplayConfig, ...otherProps } = props; - + const { + errorDisplayConfig, + WorkflowCardBaseProps: cardBaseProps = {}, + WorkflowCardInstructionProps: instructionsProps = {}, + WorkflowCardActionsProps: actionsProps = {}, + WorkflowCardHeaderProps: headerProps = {}, + PasswordProps: passwordProps = { onPasswordChange: () => ({}) }, + ...otherProps + } = props; + return ( diff --git a/login-workflow/src/screens/EulaScreen/EulaScreenBase.tsx b/login-workflow/src/screens/EulaScreen/EulaScreenBase.tsx index 836f917f..b9c9ca81 100644 --- a/login-workflow/src/screens/EulaScreen/EulaScreenBase.tsx +++ b/login-workflow/src/screens/EulaScreen/EulaScreenBase.tsx @@ -34,14 +34,14 @@ export const EulaScreenBase: React.FC = (props) => { checkboxProps, errorDisplayConfig, refreshConfig, + WorkflowCardBaseProps: cardBaseProps = {}, + WorkflowCardInstructionProps: instructionsProps = {}, + WorkflowCardActionsProps: actionsProps = {}, + WorkflowCardHeaderProps: headerProps = {}, ...otherProps } = props; const { t } = useTranslation(); - const cardBaseProps = props.WorkflowCardBaseProps || {}; - const headerProps = props.WorkflowCardHeaderProps || {}; - const instructionsProps = props.WorkflowCardInstructionProps || {}; - const actionsProps = props.WorkflowCardActionsProps || {}; const [eulaAccepted, setEulaAccepted] = useState(initialCheckboxValue ?? false); diff --git a/login-workflow/src/screens/ForgotPasswordScreen/ForgotPasswordScreenBase.tsx b/login-workflow/src/screens/ForgotPasswordScreen/ForgotPasswordScreenBase.tsx index 1f9b713a..73b96ea4 100644 --- a/login-workflow/src/screens/ForgotPasswordScreen/ForgotPasswordScreenBase.tsx +++ b/login-workflow/src/screens/ForgotPasswordScreen/ForgotPasswordScreenBase.tsx @@ -32,14 +32,13 @@ export const ForgotPasswordScreenBase: React.FC typeof emailValidator(initialEmailValue) !== 'string'; const [isEmailValid, setIsEmailValid] = useState(validateEmail); diff --git a/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreenBase.tsx b/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreenBase.tsx index f47dcf07..871846b8 100644 --- a/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreenBase.tsx +++ b/login-workflow/src/screens/ResetPasswordScreen/ResetPasswordScreenBase.tsx @@ -22,12 +22,18 @@ import { SuccessScreenBase, SuccessScreenProps } from '../SuccessScreen'; */ export const ResetPasswordScreenBase: React.FC> = (props) => { - const cardBaseProps = props.WorkflowCardBaseProps || {}; - const headerProps = props.WorkflowCardHeaderProps || {}; - const instructionsProps = props.WorkflowCardInstructionProps || {}; - const actionsProps = props.WorkflowCardActionsProps || {}; const passwordProps = props.PasswordProps || { onPasswordChange: () => ({}) }; - const { showSuccessScreen, slots, slotProps = {}, errorDisplayConfig, ...otherProps } = props; + const { + showSuccessScreen, + slots, + slotProps = {}, + errorDisplayConfig, + WorkflowCardBaseProps: cardBaseProps = {}, + WorkflowCardInstructionProps: instructionsProps = {}, + WorkflowCardActionsProps: actionsProps = {}, + WorkflowCardHeaderProps: headerProps = {}, + ...otherProps + } = props; const getSuccessScreen = ( _props?: SuccessScreenProps, diff --git a/login-workflow/src/screens/SuccessScreen/SuccessScreenBase.tsx b/login-workflow/src/screens/SuccessScreen/SuccessScreenBase.tsx index 22df11b4..2fa9a057 100644 --- a/login-workflow/src/screens/SuccessScreen/SuccessScreenBase.tsx +++ b/login-workflow/src/screens/SuccessScreen/SuccessScreenBase.tsx @@ -19,12 +19,17 @@ import Box from '@mui/material/Box'; */ export const SuccessScreenBase: React.FC = (props) => { - const { EmptyStateProps, dismissButtonLabel = '', canDismiss, onDismiss, ...otherProps } = props; - - const cardBaseProps = props.WorkflowCardBaseProps || {}; - const headerProps = props.WorkflowCardHeaderProps || {}; - const instructionsProps = props.WorkflowCardInstructionProps || {}; - const actionsProps = props.WorkflowCardActionsProps || {}; + const { + EmptyStateProps, + dismissButtonLabel = '', + canDismiss, + onDismiss, + WorkflowCardBaseProps: cardBaseProps = {}, + WorkflowCardInstructionProps: instructionsProps = {}, + WorkflowCardActionsProps: actionsProps = {}, + WorkflowCardHeaderProps: headerProps = {}, + ...otherProps + } = props; return ( diff --git a/login-workflow/src/screens/VerifyCodeScreen/VerifyCodeScreenBase.tsx b/login-workflow/src/screens/VerifyCodeScreen/VerifyCodeScreenBase.tsx index d04a1301..22e77862 100644 --- a/login-workflow/src/screens/VerifyCodeScreen/VerifyCodeScreenBase.tsx +++ b/login-workflow/src/screens/VerifyCodeScreen/VerifyCodeScreenBase.tsx @@ -29,14 +29,13 @@ export const VerifyCodeScreenBase: React.FC