Skip to content

Instantly share code, notes, and snippets.

@siisee11
Created January 3, 2020 03:41
Show Gist options
  • Save siisee11/063d959e8d3e2cadf7641fef4e010e55 to your computer and use it in GitHub Desktop.
Save siisee11/063d959e8d3e2cadf7641fef4e010e55 to your computer and use it in GitHub Desktop.
With navigation
import React from "react"
import { Link } from "gatsby"
const ListLink = props => (
<li style={{ display: `inline-block`, marginRight: `1rem` }}>
<Link to={props.to}>{props.children}</Link>
</li>
)
export default ({ children }) => (
<div style={{ margin: `3rem auto`, maxWidth: 650, padding: `0 1rem` }}>
<header style={{ marginBottom: `1.5rem` }}>
<Link to="/" style={{ textShadow: `none`, backgroundImage: `none` }}>
<h3 style={{ display: `inline` }}>MySweetSite</h3>
</Link>
<ul style={{ listStyle: `none`, float: `right` }}>
<ListLink to="/">Home</ListLink>
<ListLink to="/about/">About</ListLink>
<ListLink to="/contact/">Contact</ListLink>
</ul>
</header>
{children}
</div>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment