diff --git a/src/components/InstallButton.js b/src/components/InstallButton.js index a8ce03d4e..1f21336a6 100644 --- a/src/components/InstallButton.js +++ b/src/components/InstallButton.js @@ -2,6 +2,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Button, Dropdown, Link } from '@newrelic/gatsby-theme-newrelic'; import { css } from '@emotion/react'; +import getPackNr1Url from '../utils/get-pack-nr1-url'; +import { NR1_LOGIN_URL } from '../data/constants'; const sampleItems = new Array(10).fill().map((_, i) => i + 1); @@ -10,8 +12,14 @@ const createMenuItems = (items, index) => {item} )); -const createInstallLink = () => { - return `https://one.newrelic.com/launcher/nr1-core.explorer`; +const createInstallLink = (packId) => { + const platformUrl = getPackNr1Url(packId, true); // FIXME: remove `true` when deployed + const url = new URL( + `?return_to=${encodeURIComponent(platformUrl)}`, + NR1_LOGIN_URL + ); + + return url.href; }; const InstallButton = ({ title, ...props }) => {