diff --git a/src/components/RelatedContentModules/Contribute.js b/src/components/RelatedContentModules/Contribute.js index 3bb6234fa..1cb70653c 100644 --- a/src/components/RelatedContentModules/Contribute.js +++ b/src/components/RelatedContentModules/Contribute.js @@ -3,6 +3,9 @@ import PropTypes from 'prop-types'; import { css } from '@emotion/core'; import { Button, ExternalLink, Icon } from '@newrelic/gatsby-theme-newrelic'; import { graphql, useStaticQuery } from 'gatsby'; +import useTreatment from '../../hooks/useTreatment'; +import { useTrack } from '@splitsoftware/splitio-react'; +import { SPLITS } from '../../data/constants'; import Section from './Section'; const Contribute = ({ pageContext }) => { @@ -16,6 +19,9 @@ const Contribute = ({ pageContext }) => { } `); + const { treatment, config } = useTreatment(SPLITS.CONTRIBUTE_BUTTONS); + const track = useTrack(); + const { fileRelativePath } = pageContext; const { @@ -35,8 +41,14 @@ const Contribute = ({ pageContext }) => { css={css` margin-right: 0.5rem; `} - variant={Button.VARIANT.PRIMARY} + disabled={treatment === 'control'} + variant={config?.issues || Button.VARIANT.NORMAL} size={Button.SIZE.SMALL} + onClick={() => + track('related_content.contribute_action_clicked', null, { + button: 'issues', + }) + } > {