Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created January 3, 2018 13:21
Show Gist options
  • Save amandeepmittal/188ccf181fe5c61fd9d357ca96c6edf1 to your computer and use it in GitHub Desktop.
Save amandeepmittal/188ccf181fe5c61fd9d357ca96c6edf1 to your computer and use it in GitHub Desktop.
import React from "react";
import PropTypes from "prop-types";
import Link from "gatsby-link";
import Helmet from "react-helmet";
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
title="My First Gatsby Site"
meta={[
{ name: "author", content: "amanhimself" },
{ name: "keywords", content: "sample, something" }
]}
/>
<Header />
<div
style={{
margin: "0 auto",
maxWidth: 960,
padding: "0px 1.0875rem 1.45rem",
paddingTop: 0
}}
>
{children()}
</div>
</div>
);
TemplateWrapper.propTypes = {
children: PropTypes.func
};
export default TemplateWrapper;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment