From faac2deffa238d1f8d9ebbb351ca011f4c8552b8 Mon Sep 17 00:00:00 2001 From: RiccardoMolinari95 Date: Wed, 15 Jan 2025 15:06:53 +0100 Subject: [PATCH] refactor: iPatente cta selector --- .../common/store/selectors/remoteConfig.ts | 2 +- .../components/ItwPresentationDetailsFooter.tsx | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ts/features/itwallet/common/store/selectors/remoteConfig.ts b/ts/features/itwallet/common/store/selectors/remoteConfig.ts index e16929350b7..e580126c83c 100644 --- a/ts/features/itwallet/common/store/selectors/remoteConfig.ts +++ b/ts/features/itwallet/common/store/selectors/remoteConfig.ts @@ -110,7 +110,7 @@ export const itwDeferredIssuanceScreenContentSelector = createSelector( /** * Return the remote config about iPatente CTA inside the MDL credential details screen. */ -export const itwIPatenteCtaSelector = createSelector( +export const itwIPatenteCtaConfigSelector = createSelector( itwRemoteConfigSelector, itwConfig => pipe( diff --git a/ts/features/itwallet/presentation/components/ItwPresentationDetailsFooter.tsx b/ts/features/itwallet/presentation/components/ItwPresentationDetailsFooter.tsx index 629b44e158f..09e791b0c3a 100644 --- a/ts/features/itwallet/presentation/components/ItwPresentationDetailsFooter.tsx +++ b/ts/features/itwallet/presentation/components/ItwPresentationDetailsFooter.tsx @@ -17,7 +17,7 @@ import { trackItwCredentialDelete, trackWalletCredentialSupport } from "../../analytics"; -import { itwIPatenteCtaSelector } from "../../common/store/selectors/remoteConfig"; +import { itwIPatenteCtaConfigSelector } from "../../common/store/selectors/remoteConfig"; import { StoredCredential } from "../../common/utils/itwTypesUtils"; import { itwCredentialsRemove } from "../../credentials/store/actions"; import { trackAuthenticationStart } from "../../../fims/common/analytics"; @@ -133,9 +133,9 @@ const getCredentialActions = (credentialType: string): React.ReactNode => * Renders the IPatente service action item */ const IPatenteListItemAction = () => { - const iPatenteCtaSelector = useIOSelector(itwIPatenteCtaSelector); + const ctaConfig = useIOSelector(itwIPatenteCtaConfigSelector); - if (!iPatenteCtaSelector?.visibility) { + if (!ctaConfig?.visibility) { return null; } @@ -145,10 +145,10 @@ const IPatenteListItemAction = () => { const trackIPatenteAuthenticationStart = (label: string) => trackAuthenticationStart( - iPatenteCtaSelector.service_id as ServiceId, - iPatenteCtaSelector.service_name, - iPatenteCtaSelector.service_organization_name, - iPatenteCtaSelector.service_organization_fiscal_code, + ctaConfig.service_id as ServiceId, + ctaConfig.service_name, + ctaConfig.service_organization_name, + ctaConfig.service_organization_fiscal_code, label, //TODO Change with a new source "message_detail" @@ -166,7 +166,7 @@ const IPatenteListItemAction = () => { screen: FIMS_ROUTES.CONSENTS, params: { ctaText: label, - ctaUrl: iPatenteCtaSelector.url + ctaUrl: ctaConfig.url } }); }}