From 0dede17feb37f6ab4385fdd2b41e6a5885ae8109 Mon Sep 17 00:00:00 2001 From: Elinorre Date: Sat, 8 Feb 2020 16:47:15 +0300 Subject: [PATCH] navbar and title changes --- src/components/header.js | 30 +++++++++++--------- src/components/layout.js | 14 +++++++--- src/components/seo.js | 60 ++++++++++++++++++++++++++++++++++++++++ src/styles/header.css | 16 +++++++---- 4 files changed, 97 insertions(+), 23 deletions(-) create mode 100644 src/components/seo.js diff --git a/src/components/header.js b/src/components/header.js index 8845f84..3d885d2 100644 --- a/src/components/header.js +++ b/src/components/header.js @@ -1,20 +1,25 @@ import React from "react" -import { Link } from "gatsby" import logo from "../images/index/logo_white.png" import "bootstrap/dist/css/bootstrap.css" import "../styles/header.css" import {Navbar, Nav} from "react-bootstrap" -import { globalHistory as history } from '@reach/router' +import { Link } from '@reach/router' -const Header = ( ) => { - let curActive = [' ', ' ', ' ']; - const { location } = history; - if (location.pathname=== '/about'){curActive[0] = 'active';} - if (location.pathname=== '/projects/physics' || location.pathname === '/projects/education' || location.pathname === '/projects/math' || location.pathname === '/projects/software'){curActive[1] = 'active';} - if (location.pathname=== '/partners'){curActive[2] = 'active';} +const NavLink = props => ( + { + return { + style: { + color: isCurrent ? "white" : "rgb(230, 221, 221)" + } + }; + }} + /> +); - return( +const Header = ( ) => (
@@ -22,15 +27,14 @@ const Header = ( ) => {
) -} export default Header diff --git a/src/components/layout.js b/src/components/layout.js index 0aec647..583e46f 100644 --- a/src/components/layout.js +++ b/src/components/layout.js @@ -1,25 +1,31 @@ import React from "react" import PropTypes from "prop-types" +import favicon from "../images/icon.png" +import Helmet from "react-helmet" + import Header from "./header" import Footer from "./footer" +import SEO from "./seo" import "../styles/layout.css" import "../styles/bootstrap.min.css" import "../styles/main.css" import "katex/dist/katex.min.css" -const Layout = ({ children }) => { - return ( +const Layout = ({ children }) => ( <> + + + +
{children}