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:
parent
3b4500173f
commit
fdd6428bb8
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user