mirror of
https://github.com/rjNemo/lekol-plus
synced 2026-06-06 05:26:40 +00:00
🏄🏾♀️ refactor: extract buttonCTA
This commit is contained in:
parent
3923ecb365
commit
27ca23222d
2 changed files with 36 additions and 9 deletions
29
src/components/buttonCTA.jsx
Normal file
29
src/components/buttonCTA.jsx
Normal file
|
|
@ -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 (
|
||||
<Link to={ROUTES.CALENDAR} className={className}>
|
||||
{text}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
export default ButtonCTA
|
||||
|
||||
ButtonCTA.propTypes = {
|
||||
text: PropTypes.string,
|
||||
variant: PropTypes.string,
|
||||
}
|
||||
|
||||
ButtonCTA.defaultProps = {
|
||||
text: "Inscription",
|
||||
variant: "primary",
|
||||
}
|
||||
|
|
@ -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 }) => (
|
||||
<header id="header" class="fixed-top">
|
||||
<div class="container d-flex align-items-center">
|
||||
<h1 class="logo mr-auto">
|
||||
<header id="header" className="fixed-top">
|
||||
<div className="container d-flex align-items-center">
|
||||
<h1 className="logo mr-auto">
|
||||
<Link to={ROUTES.HOME}>{siteTitle}</Link>
|
||||
</h1>
|
||||
|
||||
<nav class="nav-menu d-none d-lg-block">
|
||||
<nav className="nav-menu d-none d-lg-block">
|
||||
<ul>
|
||||
<li>
|
||||
<Link to={ROUTES.COURSES}>Cours</Link>
|
||||
|
|
@ -24,10 +25,7 @@ const Header = ({ siteTitle }) => (
|
|||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<Link to={ROUTES.CALENDAR} class="get-started-btn">
|
||||
Inscription
|
||||
</Link>
|
||||
<ButtonCTA />
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue