Skip to content

Commit

Permalink
use selectLink instead
Browse files Browse the repository at this point in the history
  • Loading branch information
vraja-pro committed Jan 22, 2025
1 parent 5cecae5 commit f638163
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/js/src/initializers/settings-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { get } from "lodash";
import * as controls from "../redux/controls/dismissedAlerts";

const { currentPromotions, dismissedAlerts, isPremium, linkParams } = reducers;
const { isAlertDismissed, getIsPremium, isPromotionActive, selectLinkParams } = selectors;
const { isAlertDismissed, getIsPremium, isPromotionActive, selectLinkParams, selectLink } = selectors;
const { dismissAlert, setCurrentPromotions, setDismissedAlerts, setLinkParams, setIsPremium } = actions;

/**
Expand Down Expand Up @@ -39,6 +39,7 @@ export default function initSettingsStore() {
getIsPremium,
isPromotionActive,
selectLinkParams,
selectLink,
},
actions: {
dismissAlert,
Expand Down
6 changes: 2 additions & 4 deletions packages/js/src/integrations-page/simple-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { PropTypes } from "prop-types";
import { LockOpenIcon } from "@heroicons/react/outline";
import { getIsFreeIntegrationOrPremiumAvailable } from "./helper";
import { useSelect } from "@wordpress/data";
import { addQueryArgs } from "@wordpress/url";

/* eslint-disable complexity */
/**
Expand All @@ -21,9 +20,8 @@ import { addQueryArgs } from "@wordpress/url";
export const SimpleIntegration = ( { integration, isActive, children } ) => {
const IntegrationLogo = integration.logo;

const linkParams = useSelect( select => select( "yoast-seo/settings" ).selectLinkParams(), [] );
const learnMoreLink = addQueryArgs( integration.learnMoreLink, linkParams );
const logoLink = addQueryArgs( integration.logoLink, linkParams );
const learnMoreLink = useSelect( select => select( "yoast-seo/settings" ).selectLink( integration.learnMoreLink ), [] );
const logoLink = useSelect( select => select( "yoast-seo/settings" ).selectLink( integration.logoLink ), [] );

return (
<Card>
Expand Down

0 comments on commit f638163

Please sign in to comment.