From a1c4e2f62e9cc146204dba0445e09815d0d14a1e Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sat, 5 May 2018 17:52:23 +0200 Subject: [PATCH] animation tweaks --- src/components/molecules/Social.jsx | 36 ++++++++++---------- src/components/molecules/Social.scss | 3 +- src/components/organisms/Header.jsx | 51 +++++++++++++++++----------- src/layouts/index.jsx | 28 ++++++++------- 4 files changed, 66 insertions(+), 52 deletions(-) diff --git a/src/components/molecules/Social.jsx b/src/components/molecules/Social.jsx index 553149e..eb9410b 100644 --- a/src/components/molecules/Social.jsx +++ b/src/components/molecules/Social.jsx @@ -1,4 +1,4 @@ -import React, { Fragment } from 'react' +import React from 'react' import PropTypes from 'prop-types' import { OutboundLink } from 'gatsby-plugin-google-analytics' import { FadeIn } from '../atoms/Animations' @@ -34,24 +34,22 @@ const Social = ({ meta, minimal, hide }) => { const classes = minimal ? 'social social--minimal' : 'social' return ( - - {!hide && ( - - - - )} - + !hide && ( + + + + ) ) } diff --git a/src/components/molecules/Social.scss b/src/components/molecules/Social.scss index 5539b6f..55fe4dd 100644 --- a/src/components/molecules/Social.scss +++ b/src/components/molecules/Social.scss @@ -2,9 +2,9 @@ .social { margin-top: $spacer * 2; + width: 100%; display: flex; justify-content: center; - width: 100%; } .social__link { @@ -16,7 +16,6 @@ align-items: center; justify-content: center; border-radius: .25rem; - transition-property: transform, background, box-shadow; @media (min-width: 30rem) { margin-left: $spacer / 2; diff --git a/src/components/organisms/Header.jsx b/src/components/organisms/Header.jsx index 97f6fb0..c8800a9 100644 --- a/src/components/organisms/Header.jsx +++ b/src/components/organisms/Header.jsx @@ -1,31 +1,44 @@ -import React from 'react' +import React, { Component } from 'react' import Link from 'gatsby-link' import PropTypes from 'prop-types' +import { FadeIn } from '../atoms/Animations' import Social from '../molecules/Social' import Availability from '../molecules/Availability' import { ReactComponent as Logo } from '../../images/logo.svg' import './Header.scss' -const Header = ({ meta, isHomepage }) => { - const classes = isHomepage ? 'header' : 'header header--minimal' +class Header extends Component { + render() { + const isHomepage = this.props.isHomepage + const meta = this.props.meta - return ( -
- - -

{meta.title.toLowerCase()}

-

- {'{ '} {meta.tagline.toLowerCase()} {' }'} -

- + let classes = 'header' + if (!isHomepage) { + classes += ' header--minimal' + } - - -
- ) + return ( +
+ + + +

{meta.title.toLowerCase()}

+

+ {'{ '} {meta.tagline.toLowerCase()}{' '} + {' }'} +

+ +
+ + + + +
+ ) + } } Header.propTypes = { diff --git a/src/layouts/index.jsx b/src/layouts/index.jsx index 246331f..6851df5 100644 --- a/src/layouts/index.jsx +++ b/src/layouts/index.jsx @@ -19,6 +19,8 @@ class TransitionHandler extends Component { } } +const Main = ({ children }) =>
{children}
+ const TemplateWrapper = ({ data, location, children }) => { const meta = data.dataYaml const isHomepage = location.pathname === '/' @@ -28,18 +30,16 @@ const TemplateWrapper = ({ data, location, children }) => {
-
- - - - {children()} - - - -
+ + + + {children()} + + +