From ee8c5fb67ae57d298631c6187b6dcd2458264ca8 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sat, 23 Jun 2018 17:19:45 +0200 Subject: [PATCH] simplify layout --- gatsby-config.js | 2 +- src/components/Layout.jsx | 61 +++------------------ src/components/Layout.module.scss | 9 --- src/components/organisms/Footer.jsx | 50 ++++++++++++----- src/components/organisms/Footer.module.scss | 2 +- src/styles/base.scss | 2 +- 6 files changed, 46 insertions(+), 80 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index be175ab..735d80c 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -14,7 +14,7 @@ module.exports = { 'gatsby-transformer-sharp', 'gatsby-plugin-sharp', 'gatsby-plugin-sitemap', - 'gatsby-plugin-offline', + // 'gatsby-plugin-offline', { resolve: 'gatsby-transformer-json', options: { diff --git a/src/components/Layout.jsx b/src/components/Layout.jsx index 65b4b14..0156536 100644 --- a/src/components/Layout.jsx +++ b/src/components/Layout.jsx @@ -1,28 +1,12 @@ -import React, { Component, Fragment } from 'react' +import React, { Fragment } from 'react' import PropTypes from 'prop-types' -import withRouter from 'react-router-dom/withRouter' -import TransitionGroup from 'react-transition-group/TransitionGroup' import { StaticQuery, graphql } from 'gatsby' import Head from './atoms/Head' import Header from './organisms/Header' import Footer from './organisms/Footer' -import { FadeIn } from './atoms/Animations' import styles from './Layout.module.scss' -class TransitionHandler extends Component { - shouldComponentUpdate() { - return this.props.location.pathname === window.location.pathname - } - - render() { - const { children } = this.props - return
{children}
- } -} - -const Main = ({ children }) =>
{children}
- -const TemplateWrapper = ({ children, location }) => { +const Layout = ({ children, location }) => { const isHomepage = location.pathname === '/' return ( @@ -66,41 +50,21 @@ const TemplateWrapper = ({ children, location }) => { gpg addressbook } - - # the package.json file - portfolioJson { - name - homepage - repository - bugs - } } `} render={data => { const meta = data.dataYaml - const pkg = data.portfolioJson return (
- - - - {children} - - - +
+ {children} +
-