Close main menu on click and stylistic changes

This commit is contained in:
Moris Zen
2018-07-10 22:34:52 +02:00
parent 666125499d
commit 5a0d23a0ed
3 changed files with 29 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import Link from 'gatsby-link'
import Link, { withPrefix } from 'gatsby-link'
import LogoSaburly from '../images/logo-saburly-colorful.svg'
import Button from './Button'
@@ -10,6 +10,7 @@ let menuClasses =
class Header extends Component {
render() {
const isHome = location.pathname === withPrefix('/')
return (
<header className="bg-saburly-light">
<nav className="container mx-auto flex items-center justify-between lg:p-6 p-4">
@@ -29,6 +30,11 @@ class Header extends Component {
<div className="hidden lg:visible w-full block flex-grow lg:flex lg:items-right lg:w-auto justify-end lg:flex-grow">
<ul className="list-reset text-sm">
{!isHome && (
<Link to="/">
<li className={menuClasses}>Home</li>
</Link>
)}
<Link to="/services">
<li className={menuClasses}>Services</li>
</Link>