From eef8fb4003f55bcb6b6f10bc464d84ed24166f71 Mon Sep 17 00:00:00 2001 From: CanRau Date: Wed, 11 Dec 2019 20:08:29 -0500 Subject: [PATCH] feat: add cta option to --- src/components/Link.js | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/components/Link.js b/src/components/Link.js index 5816edd..3444d0f 100644 --- a/src/components/Link.js +++ b/src/components/Link.js @@ -1,5 +1,6 @@ /* global window */ -import React from 'react' +/** @jsx jsx */ +import { jsx } from 'theme-ui' import PropTypes from 'prop-types' import * as QS from '@gaiama/query-string' import { Link as GatsbyLink } from 'gatsby' @@ -13,6 +14,29 @@ if (typeof window !== `undefined`) { window.__navigatingToLink = false } +const Cta = props => ( +
+) + const Link = ({ children, to, @@ -21,6 +45,7 @@ const Link = ({ ext, blank, persistQuery, + cta, ...props }) => { if (persistQuery) { @@ -56,7 +81,9 @@ const Link = ({ ) - return isExt ? externalLink : internalLink + const link = isExt ? externalLink : internalLink + + return !cta ? link : {link} } Link.propTypes = { @@ -66,6 +93,7 @@ Link.propTypes = { ext: PropTypes.bool, blank: PropTypes.bool, persistQuery: PropTypes.bool, + cta: PropTypes.bool, } Link.defaultProps = {