1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 17:23:22 +01:00

add location prop to pages

This commit is contained in:
Matthias Kretschmann 2018-06-23 00:54:45 +02:00
parent 3b4500173f
commit fdd6428bb8
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 13 additions and 6 deletions

View File

@ -1,4 +1,5 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Link } from 'gatsby'
import giphyAPI from 'giphy-js-sdk-core'
import Layout from '../components/Layout'
@ -41,7 +42,7 @@ class NotFound extends Component {
render() {
return (
<Layout>
<Layout location={this.props.location}>
<Content className="content content--404">
<h1>Shenanigans, page not found.</h1>
<p>
@ -63,4 +64,8 @@ class NotFound extends Component {
}
}
NotFound.propTypes = {
location: PropTypes.object
}
export default NotFound

View File

@ -6,11 +6,11 @@ import ProjectImage from '../components/atoms/ProjectImage'
import FullWidth from '../components/atoms/FullWidth'
import styles from './index.module.scss'
const Home = ({ data }) => {
const Home = ({ data, location }) => {
const projects = data.allProjectsYaml.edges
return (
<Layout>
<Layout location={location}>
<FullWidth className="projects">
{projects.map(({ node }) => {
const { slug, title, img } = node
@ -30,7 +30,8 @@ const Home = ({ data }) => {
}
Home.propTypes = {
data: PropTypes.object
data: PropTypes.object,
location: PropTypes.object
}
export default Home

View File

@ -50,7 +50,7 @@ class Project extends Component {
const { title, links, techstack } = project
return (
<Layout>
<Layout location={this.props.location}>
<Helmet title={title} />
<SEO project={project} meta={meta} />
@ -84,7 +84,8 @@ ProjectImages.propTypes = {
}
Project.propTypes = {
data: PropTypes.object.isRequired
data: PropTypes.object.isRequired,
location: PropTypes.object.isRequired
}
export default Project