From 146c063312808804aa93efa3f131a1acc0db0cd9 Mon Sep 17 00:00:00 2001 From: jpuri Date: Tue, 14 Jan 2025 16:25:39 +0530 Subject: [PATCH 1/3] Adding remote feature flag for signature redesign --- .../confirmations/hooks/useConfirmationRedesignEnabled.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts b/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts index 2a1b63132f3..cf1cf8353e1 100644 --- a/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts +++ b/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts @@ -1,10 +1,13 @@ import { useMemo } from 'react'; +import { useSelector } from 'react-redux'; import { ApprovalTypes } from '../../../../core/RPCMethods/RPCMethodMiddleware'; +import { selectRemoteFeatureFlags } from '../../../../selectors/featureFlagController'; import useApprovalRequest from './useApprovalRequest'; const useConfirmationRedesignEnabled = () => { const { approvalRequest } = useApprovalRequest(); + const { confirmation_redesign } = useSelector(selectRemoteFeatureFlags); const { type: approvalRequestType } = approvalRequest ?? { requestData: {}, @@ -12,12 +15,12 @@ const useConfirmationRedesignEnabled = () => { const isRedesignedEnabled = useMemo( () => + (confirmation_redesign as Record)?.signatures && approvalRequestType && - process.env.REDESIGNED_SIGNATURE_REQUEST === 'true' && [ApprovalTypes.PERSONAL_SIGN, ApprovalTypes.ETH_SIGN_TYPED_DATA].includes( approvalRequestType as ApprovalTypes, ), - [approvalRequestType], + [approvalRequestType, confirmation_redesign], ); return { isRedesignedEnabled }; From 3192904b8a8f1306c518cd7682bbb26ad10be346 Mon Sep 17 00:00:00 2001 From: jpuri Date: Tue, 14 Jan 2025 17:09:43 +0530 Subject: [PATCH 2/3] Adding remote feature flag for signature redesign --- app/util/test/confirm-data-helpers.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/util/test/confirm-data-helpers.ts b/app/util/test/confirm-data-helpers.ts index ec6d4f1f319..408f70b8788 100644 --- a/app/util/test/confirm-data-helpers.ts +++ b/app/util/test/confirm-data-helpers.ts @@ -32,6 +32,13 @@ export const personalSignatureConfirmationState = { pendingApprovalCount: 1, approvalFlows: [], }, + RemoteFeatureFlagController: { + remoteFeatureFlags: { + confirmation_redesign: { + signatures: true, + }, + }, + }, }, }, }; @@ -95,6 +102,13 @@ export const typedSignV1ConfirmationState = { }, }, }, + RemoteFeatureFlagController: { + remoteFeatureFlags: { + confirmation_redesign: { + signatures: true, + }, + }, + }, }, }, }; @@ -184,6 +198,13 @@ export const typedSignV3ConfirmationState = { }, }, }, + RemoteFeatureFlagController: { + remoteFeatureFlags: { + confirmation_redesign: { + signatures: true, + }, + }, + }, }, }, }; From 5d8f6a9c027e24119bfe09737418dc981ce7bd89 Mon Sep 17 00:00:00 2001 From: jpuri Date: Tue, 14 Jan 2025 17:16:07 +0530 Subject: [PATCH 3/3] Adding remote feature flag for signature redesign --- .../Views/confirmations/hooks/useConfirmationRedesignEnabled.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts b/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts index cf1cf8353e1..8d3ff6f05b6 100644 --- a/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts +++ b/app/components/Views/confirmations/hooks/useConfirmationRedesignEnabled.ts @@ -16,6 +16,7 @@ const useConfirmationRedesignEnabled = () => { const isRedesignedEnabled = useMemo( () => (confirmation_redesign as Record)?.signatures && + process.env.REDESIGNED_SIGNATURE_REQUEST === 'true' && approvalRequestType && [ApprovalTypes.PERSONAL_SIGN, ApprovalTypes.ETH_SIGN_TYPED_DATA].includes( approvalRequestType as ApprovalTypes,