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

revert refactoring, gatsby doesn't like splitting up StaticQuery

This commit is contained in:
Matthias Kretschmann 2018-06-22 19:37:14 +02:00
parent 4e06ef5b83
commit 9ecd43d0e3
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 32 additions and 52 deletions

View File

@ -4,23 +4,6 @@ import { StaticQuery, graphql } from 'gatsby'
import { MoveIn } from '../atoms/Animations'
import styles from './Availability.module.scss'
const AvailabilityElementQuery = ({ render }) => (
<StaticQuery
query={graphql`
query AvailabilityQuery {
dataYaml {
availability {
status
available
unavailable
}
}
}
`}
render={render}
/>
)
class Availability extends PureComponent {
constructor(props) {
super(props)
@ -28,7 +11,18 @@ class Availability extends PureComponent {
render() {
return (
<AvailabilityElementQuery
<StaticQuery
query={graphql`
query AvailabilityQuery {
dataYaml {
availability {
status
available
unavailable
}
}
}
`}
render={data => {
const { availability } = data.dataYaml
const { status, available, unavailable } = availability
@ -64,8 +58,4 @@ Availability.propTypes = {
hide: PropTypes.bool
}
AvailabilityElementQuery.propTypes = {
render: PropTypes.func
}
export default Availability

View File

@ -15,31 +15,6 @@ const ProjectLink = ({ node }) => (
</Link>
)
const ProjectNavQuery = ({ render }) => (
<StaticQuery
query={graphql`
query ProjectsNavQuery {
allProjectsYaml {
edges {
node {
title
slug
img {
childImageSharp {
fluid(maxWidth: 500, quality: 85) {
...GatsbyImageSharpFluid_noBase64
}
}
}
}
}
}
}
`}
render={render}
/>
)
class ProjectNav extends Component {
constructor(props) {
super(props)
@ -68,7 +43,26 @@ class ProjectNav extends Component {
const { slug } = this.props
return (
<ProjectNavQuery
<StaticQuery
query={graphql`
query ProjectsNavQuery {
allProjectsYaml {
edges {
node {
title
slug
img {
childImageSharp {
fluid(maxWidth: 500, quality: 85) {
...GatsbyImageSharpFluid_noBase64
}
}
}
}
}
}
}
`}
render={data => {
const projects = data.allProjectsYaml.edges
@ -110,8 +104,4 @@ ProjectNav.propTypes = {
slug: PropTypes.string
}
ProjectNavQuery.propTypes = {
render: PropTypes.func
}
export default ProjectNav