2018-07-17 23:33:55 +02:00
|
|
|
import React from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import { graphql } from 'gatsby'
|
|
|
|
import Img from 'gatsby-image'
|
|
|
|
import styles from './Image.module.scss'
|
|
|
|
|
2018-08-31 00:15:42 +02:00
|
|
|
const Image = ({ fluid, fixed, alt }) => (
|
2018-07-17 23:33:55 +02:00
|
|
|
<Img
|
|
|
|
className={styles.image}
|
|
|
|
outerWrapperClassName={styles.imageWrap}
|
|
|
|
backgroundColor="#6b7f88"
|
2018-08-31 00:15:42 +02:00
|
|
|
fluid={fluid ? fluid : null}
|
|
|
|
fixed={fixed ? fixed : null}
|
|
|
|
alt={alt}
|
2018-07-17 23:33:55 +02:00
|
|
|
/>
|
|
|
|
)
|
|
|
|
|
|
|
|
Image.propTypes = {
|
2018-08-31 00:15:42 +02:00
|
|
|
fluid: PropTypes.object,
|
|
|
|
fixed: PropTypes.object,
|
2018-07-17 23:33:55 +02:00
|
|
|
alt: PropTypes.string
|
|
|
|
}
|
|
|
|
|
|
|
|
export const projectImage = graphql`
|
|
|
|
fragment ImageFluid on ImageSharp {
|
|
|
|
fluid(maxWidth: 940, quality: 85) {
|
2018-09-06 22:28:28 +02:00
|
|
|
...GatsbyImageSharpFluid_withWebp_noBase64
|
2018-07-17 23:33:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`
|
|
|
|
|
|
|
|
export default Image
|