diff --git a/package.json b/package.json index a6668c1..8714969 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "new": "babel-node ./scripts/new.js" }, "dependencies": { + "classnames": "^2.2.6", "file-saver": "^2.0.0", "gatsby": "^2.0.80", "gatsby-image": "^2.0.25", diff --git a/src/components/Layout.jsx b/src/components/Layout.jsx index 2cb3553..86f8f3f 100644 --- a/src/components/Layout.jsx +++ b/src/components/Layout.jsx @@ -14,6 +14,7 @@ import styles from './Layout.module.scss' // } const timeout = 250 +const RoutesContainer = posed.div(fadeIn) export default class Layout extends PureComponent { static propTypes = { @@ -25,8 +26,6 @@ export default class Layout extends PureComponent { const { children, location } = this.props const isHomepage = location.pathname === '/' - const RoutesContainer = posed.div(fadeIn) - return ( <> diff --git a/src/components/molecules/LogoUnit.jsx b/src/components/molecules/LogoUnit.jsx index cfae39b..41b3100 100644 --- a/src/components/molecules/LogoUnit.jsx +++ b/src/components/molecules/LogoUnit.jsx @@ -2,6 +2,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { StaticQuery, graphql } from 'gatsby' import posed from 'react-pose' +import classNames from 'classnames' import { moveInBottom } from '../atoms/Transitions' import { ReactComponent as Logo } from '../../images/logo.svg' import styles from './LogoUnit.module.scss' @@ -15,33 +16,36 @@ const query = graphql` } ` -const Animation = posed.div(moveInBottom) - export default class LogoUnit extends PureComponent { static propTypes = { minimal: PropTypes.bool } + Animation = posed.div(moveInBottom) + nameClasses = classNames('p-name', [styles.title]) + descriptionClasses = classNames('p-job-title', [styles.description]) + render() { + let wrapClasses = classNames([styles.logounit], { + [styles.minimal]: this.props.minimal + }) + return ( { const { title, tagline } = data.dataYaml - const { minimal } = this.props return ( - -
- -

- {title.toLowerCase()} -

-

+

+ + +

{title.toLowerCase()}

+

{tagline.toLowerCase()}

-
- + +
) }} /> diff --git a/src/components/molecules/LogoUnit.module.scss b/src/components/molecules/LogoUnit.module.scss index 5cb3b80..5bfebcc 100644 --- a/src/components/molecules/LogoUnit.module.scss +++ b/src/components/molecules/LogoUnit.module.scss @@ -4,7 +4,7 @@ display: block; } -.logounit__logo { +.logo { display: block; width: 1.5rem; height: 1.5rem; @@ -14,20 +14,20 @@ margin-right: auto; } -.logounit__title, -.logounit__description { +.title, +.description { display: inline-block; margin-bottom: 0; } -.logounit__title { +.title { font-size: $font-size-h3; margin-right: $spacer / 4; color: $brand-main; line-height: $line-height; } -.logounit__description { +.description { font-size: $font-size-h4; color: $brand-grey-light; @@ -46,13 +46,12 @@ } .minimal { - composes: logounit; transform: scale(.7); transform-origin: top center; transform-box: border-box; - .logounit__title, - .logounit__description { + .title, + .description { color: $text-color-light; :global(.dark) & { @@ -60,7 +59,7 @@ } } - .logounit__logo { + .logo { margin-bottom: $spacer / 3; opacity: .5; } diff --git a/src/components/molecules/Networks.jsx b/src/components/molecules/Networks.jsx index 7bc2f0e..c8ea962 100644 --- a/src/components/molecules/Networks.jsx +++ b/src/components/molecules/Networks.jsx @@ -2,6 +2,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { StaticQuery, graphql } from 'gatsby' import posed from 'react-pose' +import classNames from 'classnames' import { moveInTop } from '../atoms/Transitions' import { ReactComponent as Email } from '../../images/email.svg' @@ -50,33 +51,24 @@ class NetworkIcon extends PureComponent { } } -const Animation = posed.aside(moveInTop) - export default class Networks extends PureComponent { - state = { - classes: styles.networks - } - static propTypes = { minimal: PropTypes.bool, hide: PropTypes.bool } - componentDidMount() { - this.toggleClasses() - } + Animation = posed.aside(moveInTop) - componentDidUpdate() { - this.toggleClasses() - } + linkClasses = key => + classNames({ + 'u-url': key !== 'Email', + 'u-email': key === 'Email', + [styles.link]: true + }) - toggleClasses = () => { - if (this.props.minimal) { - this.setState({ classes: `${styles.networks} ${styles.minimal}` }) - } else { - this.setState({ classes: styles.networks }) - } - } + wrapClasses = classNames([styles.networks], { + [styles.minimal]: this.props.minimal + }) render() { return ( @@ -87,14 +79,18 @@ export default class Networks extends PureComponent { return ( !this.props.hide && ( - + {Object.keys(meta.social).map((key, i) => ( - + {key} ))} - + ) ) }} diff --git a/src/components/organisms/Footer.jsx b/src/components/organisms/Footer.jsx index 106b28f..6866dd8 100644 --- a/src/components/organisms/Footer.jsx +++ b/src/components/organisms/Footer.jsx @@ -1,5 +1,6 @@ import React, { PureComponent } from 'react' import { Link, StaticQuery, graphql } from 'gatsby' +import classNames from 'classnames' import Vcard from '../atoms/Vcard' import LogoUnit from '../molecules/LogoUnit' import Networks from '../molecules/Networks' @@ -17,30 +18,39 @@ const query = graphql` dataYaml { title + url gpg } } ` +let classes = classNames('h-card', [styles.footer]) + export default class Footer extends PureComponent { state = { year: new Date().getFullYear() } FooterMarkup = ({ meta, pkg, year }) => ( -