mirror of
https://github.com/rjNemo/lekol-plus
synced 2026-06-12 18:06:39 +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 { Link } from "gatsby"
|
||||||
import PropTypes from "prop-types"
|
import PropTypes from "prop-types"
|
||||||
|
|
||||||
|
import ButtonCTA from "./buttonCTA"
|
||||||
|
|
||||||
import * as ROUTES from "../global/routes"
|
import * as ROUTES from "../global/routes"
|
||||||
|
|
||||||
const Header = ({ siteTitle }) => (
|
const Header = ({ siteTitle }) => (
|
||||||
<header id="header" class="fixed-top">
|
<header id="header" className="fixed-top">
|
||||||
<div class="container d-flex align-items-center">
|
<div className="container d-flex align-items-center">
|
||||||
<h1 class="logo mr-auto">
|
<h1 className="logo mr-auto">
|
||||||
<Link to={ROUTES.HOME}>{siteTitle}</Link>
|
<Link to={ROUTES.HOME}>{siteTitle}</Link>
|
||||||
</h1>
|
</h1>
|
||||||
|
<nav className="nav-menu d-none d-lg-block">
|
||||||
<nav class="nav-menu d-none d-lg-block">
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<Link to={ROUTES.COURSES}>Cours</Link>
|
<Link to={ROUTES.COURSES}>Cours</Link>
|
||||||
|
|
@ -24,10 +25,7 @@ const Header = ({ siteTitle }) => (
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
<ButtonCTA />
|
||||||
<Link to={ROUTES.CALENDAR} class="get-started-btn">
|
|
||||||
Inscription
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue