1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-06-10 11:25:24 +02:00
portfolio/src/components/atoms/ProjectImage.jsx

32 lines
728 B
React
Raw Normal View History

import React, { PureComponent } from 'react'
2018-04-21 20:01:50 +02:00
import PropTypes from 'prop-types'
2018-06-21 21:06:53 +02:00
import { graphql } from 'gatsby'
2018-04-21 20:01:50 +02:00
import Img from 'gatsby-image'
2018-06-23 15:50:02 +02:00
import styles from './ProjectImage.module.scss'
2018-04-20 19:59:27 +02:00
export default class ProjectImage extends PureComponent {
static propTypes = {
fluid: PropTypes.object.isRequired,
alt: PropTypes.string
}
2018-04-21 20:01:50 +02:00
render() {
return (
<Img
className={styles.projectImage}
2019-11-07 23:24:50 +01:00
backgroundColor="transparent"
fluid={this.props.fluid}
alt={this.props.alt}
/>
)
}
2018-04-21 20:01:50 +02:00
}
2018-04-20 19:59:27 +02:00
2018-05-04 14:00:21 +02:00
export const projectImage = graphql`
2018-06-19 22:48:33 +02:00
fragment ProjectImageFluid on ImageSharp {
fluid(maxWidth: 1200, quality: 85) {
2018-09-19 20:46:32 +02:00
...GatsbyImageSharpFluid_withWebp_noBase64
2018-05-04 14:00:21 +02:00
}
}
`