diff --git a/src/components/atoms/Typekit.jsx b/src/components/atoms/Typekit.jsx index a5899d5..802f190 100644 --- a/src/components/atoms/Typekit.jsx +++ b/src/components/atoms/Typekit.jsx @@ -34,7 +34,6 @@ const Typekit = () => ( return ( typekitID && ( - {TypekitScript(typekitID)} diff --git a/src/components/molecules/LogoUnit.module.scss b/src/components/molecules/LogoUnit.module.scss index 275e144..5cb3b80 100644 --- a/src/components/molecules/LogoUnit.module.scss +++ b/src/components/molecules/LogoUnit.module.scss @@ -51,7 +51,6 @@ transform-origin: top center; transform-box: border-box; - // stylelint-disable no-descending-specificity .logounit__title, .logounit__description { color: $text-color-light; @@ -60,7 +59,6 @@ color: $text-color-light--dark; } } - // stylelint-enable no-descending-specificity .logounit__logo { margin-bottom: $spacer / 3; diff --git a/src/components/molecules/Networks.jsx b/src/components/molecules/Networks.jsx index f40bc42..4d98076 100644 --- a/src/components/molecules/Networks.jsx +++ b/src/components/molecules/Networks.jsx @@ -27,20 +27,22 @@ const query = graphql` } ` -const NetworkIcon = props => { - switch (props.title) { - case 'Email': - return - case 'Blog': - return - case 'Twitter': - return - case 'GitHub': - return - case 'Dribbble': - return - default: - return null +class NetworkIcon extends PureComponent { + render() { + switch (this.props.title) { + case 'Email': + return + case 'Blog': + return + case 'Twitter': + return + case 'GitHub': + return + case 'Dribbble': + return + default: + return null + } } } diff --git a/src/components/molecules/ProjectLinks.jsx b/src/components/molecules/ProjectLinks.jsx index 83e4540..02e878e 100644 --- a/src/components/molecules/ProjectLinks.jsx +++ b/src/components/molecules/ProjectLinks.jsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import Button from '../atoms/Button' @@ -50,31 +50,33 @@ const LinkIcon = ({ title, type, ...props }) => { } } -const ProjectLinks = ({ links }) => ( -
-

- Links Learn more on the interwebz. -

+export default class ProjectLinks extends PureComponent { + static propTypes = { + links: PropTypes.array + } -
    - {links.map(link => { - const { title, url, type } = link + render() { + return ( +
    +

    + Links Learn more on the interwebz. +

    - return ( -
  • - -
  • - ) - })} -
-
-) +
    + {this.props.links.map(link => { + const { title, url, type } = link -ProjectLinks.propTypes = { - links: PropTypes.array + return ( +
  • + +
  • + ) + })} +
+ + ) + } } - -export default ProjectLinks diff --git a/src/components/molecules/ProjectNav.jsx b/src/components/molecules/ProjectNav.jsx index 2e92afb..bab4131 100644 --- a/src/components/molecules/ProjectNav.jsx +++ b/src/components/molecules/ProjectNav.jsx @@ -1,4 +1,4 @@ -import React, { Component } from 'react' +import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { Link, graphql, StaticQuery } from 'gatsby' import Img from 'gatsby-image' @@ -24,18 +24,24 @@ const query = graphql` } ` -const ProjectLink = ({ node }) => ( - - {node.title} -

{node.title}

- -) +class ProjectLink extends PureComponent { + render() { + const { node } = this.props -export default class ProjectNav extends Component { + return ( + + {node.title} +

{node.title}

+ + ) + } +} + +export default class ProjectNav extends PureComponent { state = { scrolledToCurrent: false } diff --git a/src/components/organisms/Footer.jsx b/src/components/organisms/Footer.jsx index c895f8a..106b28f 100644 --- a/src/components/organisms/Footer.jsx +++ b/src/components/organisms/Footer.jsx @@ -1,6 +1,5 @@ import React, { PureComponent } from 'react' -import PropTypes from 'prop-types' -import { StaticQuery, graphql } from 'gatsby' +import { Link, StaticQuery, graphql } from 'gatsby' import Vcard from '../atoms/Vcard' import LogoUnit from '../molecules/LogoUnit' import Networks from '../molecules/Networks' @@ -23,33 +22,30 @@ const query = graphql` } ` -const FooterMarkup = ({ meta, pkg, year }) => ( - -) - -FooterMarkup.propTypes = { - meta: PropTypes.object, - pkg: PropTypes.object, - year: PropTypes.number -} - export default class Footer extends PureComponent { state = { year: new Date().getFullYear() } + FooterMarkup = ({ meta, pkg, year }) => ( + + ) + render() { return ( + return ( + + ) }} /> ) diff --git a/src/components/organisms/Header.jsx b/src/components/organisms/Header.jsx index dbf8158..e3659fa 100644 --- a/src/components/organisms/Header.jsx +++ b/src/components/organisms/Header.jsx @@ -18,6 +18,10 @@ const query = graphql` ` export default class Header extends PureComponent { + static propTypes = { + minimal: PropTypes.bool + } + state = { isMinimal: this.props.minimal } checkMinimal = () => { @@ -61,7 +65,3 @@ export default class Header extends PureComponent { ) } } - -Header.propTypes = { - minimal: PropTypes.bool -} diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 5d44fdd..28ead55 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { Link, graphql } from 'gatsby' import SEO from '../components/atoms/SEO' @@ -6,7 +6,7 @@ import ProjectImage from '../components/molecules/ProjectImage' import { ReactComponent as Images } from '../images/images.svg' import styles from './index.module.scss' -const getImageCount = (images, slug) => { +function getImageCount(images, slug) { let array = [] let slugWithoutSlashes = slug.replace(/\//g, '') @@ -17,49 +17,50 @@ const getImageCount = (images, slug) => { return array.length } -const Home = ({ data }) => { - const projects = data.allProjectsYaml.edges - const images = data.projectImageFiles.edges +export default class Home extends PureComponent { + static propTypes = { + data: PropTypes.object, + location: PropTypes.object + } - return ( - <> - + render() { + const { data } = this.props + const projects = data.allProjectsYaml.edges + const images = data.projectImageFiles.edges -
- {projects.map(({ node }) => { - const { slug, title, img } = node - const imageCount = getImageCount(images, slug) + return ( + <> + - return ( -
- -

{title}

- +
+ {projects.map(({ node }) => { + const { slug, title, img } = node + const imageCount = getImageCount(images, slug) - {imageCount > 1 && ( - - {imageCount} - - )} - -
- ) - })} -
- - ) + return ( +
+ +

{title}

+ + + {imageCount > 1 && ( + + {imageCount} + + )} + +
+ ) + })} + + + ) + } } -Home.propTypes = { - data: PropTypes.object, - location: PropTypes.object -} - -export default Home - export const IndexQuery = graphql` query { allProjectsYaml { diff --git a/src/templates/Project.jsx b/src/templates/Project.jsx index 6fc41a6..0bdbc70 100644 --- a/src/templates/Project.jsx +++ b/src/templates/Project.jsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { graphql } from 'gatsby' import FullWidth from '../components/atoms/FullWidth' @@ -9,12 +9,23 @@ import ProjectNav from '../components/molecules/ProjectNav' import SEO from '../components/atoms/SEO' import styles from './Project.module.scss' -const ProjectMeta = ({ links, techstack }) => ( -
- {!!links && } - {!!techstack && } -
-) +class ProjectMeta extends PureComponent { + static propTypes = { + links: PropTypes.array, + techstack: PropTypes.array + } + + render() { + const { links, techstack } = this.props + + return ( +
+ {!!links && } + {!!techstack && } +
+ ) + } +} const ProjectImages = ({ projectImages, title }) => ( @@ -26,50 +37,44 @@ const ProjectImages = ({ projectImages, title }) => ( ) -const Project = ({ data }) => { - const project = data.projectsYaml - const projectImages = data.projectImages.edges - const { title, links, techstack } = project - const description = data.projectsYaml.description - const descriptionWithLineBreaks = description.split('\n').join('\n\n') - - return ( - <> - - -
-
-

{title}

-
-
- - -
- - - - ) -} - -ProjectMeta.propTypes = { - links: PropTypes.array, - techstack: PropTypes.array -} - ProjectImages.propTypes = { projectImages: PropTypes.array, title: PropTypes.string } -Project.propTypes = { - data: PropTypes.object.isRequired, - location: PropTypes.object.isRequired -} +export default class Project extends PureComponent { + static propTypes = { + data: PropTypes.object.isRequired, + location: PropTypes.object.isRequired + } -export default Project + render() { + const project = this.props.data.projectsYaml + const projectImages = this.props.data.projectImages.edges + const descriptionHtml = this.props.data.projectsYaml.fields.descriptionHtml + const { title, links, techstack } = project + + return ( + <> + + +
+
+

{title}

+
+
+ + +
+ + + + ) + } +} export const projectAndProjectsQuery = graphql` query($slug: String!) { @@ -77,6 +82,9 @@ export const projectAndProjectsQuery = graphql` title slug description + fields { + descriptionHtml + } links { title url