Skip to content

Commit

Permalink
add learn more link
Browse files Browse the repository at this point in the history
fix links
  • Loading branch information
vraja-pro committed Nov 13, 2024
1 parent 6061d8f commit 3513a8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/js/src/components/SEMrushRelatedKeyphrasesModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class SEMrushRelatedKeyphrasesModal extends Component {
* @returns {wp.Element} The RelatedKeyPhrasesModal modal component.
*/
render() {
const { keyphrase, location, whichModalOpen, isLoggedIn, onClose, countryCode, isRtl } = this.props;
const { keyphrase, location, whichModalOpen, isLoggedIn, onClose, countryCode, isRtl, learnMoreLink } = this.props;

const insightsLink = "https://www.semrush.com/analytics/keywordoverview/?q=" + encodeURIComponent( keyphrase ) +
"&db=" + encodeURIComponent( countryCode );
Expand All @@ -174,7 +174,7 @@ class SEMrushRelatedKeyphrasesModal extends Component {
isOpen={ Boolean( keyphrase ) && whichModalOpen === location }
onClose={ onClose }
insightsLink={ insightsLink }
learnMoreLink={ "https://learnmore.semrush.com/" }
learnMoreLink={ learnMoreLink }
>

<Slot name="YoastRelatedKeyphrases" />
Expand Down Expand Up @@ -218,6 +218,7 @@ SEMrushRelatedKeyphrasesModal.propTypes = {
onClose: PropTypes.func.isRequired,
onAuthentication: PropTypes.func.isRequired,
countryCode: PropTypes.string,
learnMoreLink: PropTypes.string,
isRtl: PropTypes.bool,
};

Expand All @@ -227,6 +228,7 @@ SEMrushRelatedKeyphrasesModal.defaultProps = {
whichModalOpen: "none",
isLoggedIn: false,
countryCode: "en_US",
learnMoreLink: "",
isRtl: false,
};

Expand Down
3 changes: 3 additions & 0 deletions packages/js/src/containers/SEMrushRelatedKeyphrasesModal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { withDispatch, withSelect } from "@wordpress/data";
import { addQueryArgs } from "@wordpress/url";
import { compose } from "@wordpress/compose";
import SEMrushRelatedKeyphrasesModal from "../components/SEMrushRelatedKeyphrasesModal";

Expand All @@ -9,13 +10,15 @@ export default compose( [
getSEMrushLoginStatus,
getSEMrushSelectedCountry,
getPreference,
selectLinkParams,
} = select( "yoast-seo/editor" );

return {
whichModalOpen: getSEMrushModalOpen(),
isLoggedIn: getSEMrushLoginStatus(),
countryCode: getSEMrushSelectedCountry(),
isRtl: getPreference( "isRtl", false ),
learnMoreLink: addQueryArgs( "https://yoa.st/3-v", selectLinkParams() ),
};
} ),
withDispatch( ( dispatch ) => {
Expand Down

0 comments on commit 3513a8e

Please sign in to comment.