Skip to content

Commit

Permalink
Feature: Clean up code base (gatsbyjs#40)
Browse files Browse the repository at this point in the history
* fix auto fixable ESLint warnings

* use .jsx file extension

* move Header into it's own component

* use .js insteda of .jsx file extension

* format code using prettier
  • Loading branch information
marcobiedermann authored and KyleAMathews committed Jan 10, 2018
1 parent ae0335f commit 249121e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 33 deletions.
6 changes: 3 additions & 3 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
siteMetadata: {
title: `Gatsby Default Starter`,
title: 'Gatsby Default Starter',
},
plugins: [`gatsby-plugin-react-helmet`],
}
plugins: ['gatsby-plugin-react-helmet'],
};
33 changes: 33 additions & 0 deletions src/components/Header/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react'
import Link from 'gatsby-link'

const Header = () => (
<div
style={{
background: 'rebeccapurple',
marginBottom: '1.45rem',
}}
>
<div
style={{
margin: '0 auto',
maxWidth: 960,
padding: '1.45rem 1.0875rem',
}}
>
<h1 style={{ margin: 0 }}>
<Link
to="/"
style={{
color: 'white',
textDecoration: 'none',
}}
>
Gatsby
</Link>
</h1>
</div>
</div>
)

export default Header
31 changes: 1 addition & 30 deletions src/layouts/index.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,10 @@
import React from 'react'
import PropTypes from 'prop-types'
import Link from 'gatsby-link'
import Helmet from 'react-helmet'

import Header from '../components/Header'
import './index.css'

const Header = () => (
<div
style={{
background: 'rebeccapurple',
marginBottom: '1.45rem',
}}
>
<div
style={{
margin: '0 auto',
maxWidth: 960,
padding: '1.45rem 1.0875rem',
}}
>
<h1 style={{ margin: 0 }}>
<Link
to="/"
style={{
color: 'white',
textDecoration: 'none',
}}
>
Gatsby
</Link>
</h1>
</div>
</div>
)

const TemplateWrapper = ({ children }) => (
<div>
<Helmet
Expand Down

0 comments on commit 249121e

Please sign in to comment.