From 27ca23222dd60d677a52ed52fa77b6206a483c43 Mon Sep 17 00:00:00 2001 From: Ruidy Nemausat Date: Thu, 16 Jul 2020 11:07:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=84=F0=9F=8F=BE=E2=80=8D=E2=99=80?= =?UTF-8?q?=EF=B8=8F=20refactor:=20extract=20buttonCTA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/buttonCTA.jsx | 29 +++++++++++++++++++++++++++++ src/components/header.jsx | 16 +++++++--------- 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 src/components/buttonCTA.jsx diff --git a/src/components/buttonCTA.jsx b/src/components/buttonCTA.jsx new file mode 100644 index 0000000..64cfb35 --- /dev/null +++ b/src/components/buttonCTA.jsx @@ -0,0 +1,29 @@ +import React from "react" +import PropTypes from "prop-types" +import { Link } from "gatsby" + +import * as ROUTES from "../global/routes" + +const ButtonCTA = ({ text, variant }) => { + let className = "get-started-btn" + if (variant === "secondary") { + className = "btn-get-started" + } + return ( + + {text} + + ) +} + +export default ButtonCTA + +ButtonCTA.propTypes = { + text: PropTypes.string, + variant: PropTypes.string, +} + +ButtonCTA.defaultProps = { + text: "Inscription", + variant: "primary", +} diff --git a/src/components/header.jsx b/src/components/header.jsx index 551cf94..9501974 100644 --- a/src/components/header.jsx +++ b/src/components/header.jsx @@ -2,16 +2,17 @@ import React from "react" import { Link } from "gatsby" import PropTypes from "prop-types" +import ButtonCTA from "./buttonCTA" + import * as ROUTES from "../global/routes" const Header = ({ siteTitle }) => ( -