Extracting to reusable components

This commit is contained in:
Moris Zen
2018-06-30 14:56:04 +02:00
parent fe306ab517
commit 05e9635c7c
5 changed files with 33 additions and 21 deletions

10
src/components/Button.js Normal file
View File

@@ -0,0 +1,10 @@
import React from 'react'
import Link from 'gatsby-link'
const Button = ({ text, url, classes}) => (
<div>
<Link to={url} className={`no-underline inline-block text-sm px-4 py-2 leading-none border rounded text-grey-lightest hover:border-transparent hover:text-white hover:bg-white mt-4 lg:mt-0 uppercase bg-grey-darkest hover:bg-teal ${classes}`}>{text}</Link>
</div>
)
export default Button

View File

@@ -7,7 +7,7 @@ import "./Header.css"
const Header = () => (
<header>
<nav className="flex items-center justify-between flex-wrap lg:p-6">
<div class="flex items-center flex-no-shrink text-white mr-6">
<div className="flex items-center flex-no-shrink text-white mr-6">
<Link to="/">
<img src={SaburlyLogo} alt='Saburly Logo' style={{ maxWidth: '300px' }} />
</Link>

View File

@@ -0,0 +1,17 @@
import React from 'react'
import Link from 'gatsby-link'
import Button from './Button'
const IntroDefault = ({ intro, headline, text }) => (
<section className="lg:flex items-center p-3">
<div className="max-w-xs">
<h3>{intro}</h3>
<h1>{headline}</h1>
<p>{text}</p>
<Button text="Let's Get In Touch" url="/proposal" classes="rounded-full" />
</div>
</section >
)
export default IntroDefault

View File

@@ -1,18 +0,0 @@
import React from 'react'
import Link from 'gatsby-link'
import ImgBuildSite from '../images/programming-company.svg'
const MainIntro = () => (
<section className="lg:flex items-center p-3">
<div className="max-w-xs">
<h3>Welcome To Saburly</h3>
<h1>We build the right software for your needs</h1>
<p>We are a team of creative, open minded, skilled and passionate engineers that ship success every day.</p>
<Link to="/proposal" className="no-underline inline-block text-sm px-4 py-2 leading-none border rounded text-grey-lightest border-grey-darkest hover:border-transparent hover:text-white hover:bg-white mt-4 lg:mt-0 uppercase bg-grey-darkest hover:bg-teal rounded-full ">Let's Get In Touch</Link>
</div>
<img src={ImgBuildSite} className="overflow-hidden" />
</section>
)
export default MainIntro