diff --git a/src/components/InstallButton.js b/src/components/InstallButton.js index e70122405..5c052fd5b 100644 --- a/src/components/InstallButton.js +++ b/src/components/InstallButton.js @@ -106,6 +106,18 @@ const InstallButton = ({ quickstart, location, ...props }) => { quickstart.installPlans.length === 1 && quickstart.installPlans[0].id.includes('guided-install'); + const [installUrl, setInstallUrl] = useState(SIGNUP_LINK); + useEffect(() => { + setInstallUrl(url); + + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + // If there is nothing to install AND no documentation, don't show this button. + if (!hasInstallableComponent && !hasComponent(quickstart, 'documentation')) { + return null; + } + let nerdletId = hasGuidedInstall ? NR1_GUIDED_INSTALL_NERDLET : NR1_PACK_DETAILS_NERDLET; @@ -127,18 +139,6 @@ const InstallButton = ({ quickstart, location, ...props }) => { ) : quickstart.documentation[0].url; - const [installUrl, setInstallUrl] = useState(SIGNUP_LINK); - useEffect(() => { - setInstallUrl(url); - - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - // If there is nothing to install AND no documentation, don't show this button. - if (!hasInstallableComponent && !hasComponent(quickstart, 'documentation')) { - return null; - } - const writeCookie = () => { const currentEnvironment = process.env.ENV || process.env.NODE_ENV || 'development';