-
-
Save jeremeylduvall/dc7b30d426fa286b09e543621d28db5f to your computer and use it in GitHub Desktop.
Photo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// External | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import Img from 'gatsby-image'; | |
import Link from 'gatsby-link'; | |
const Photo = ( props ) => { | |
return ( | |
<div | |
style={ { | |
width: 'calc( 100% / 3 )', | |
padding: '0.2em', | |
} } | |
> | |
<Link to={ props.link } > | |
<Img | |
src={ props.src } | |
sizes={ props.sizes } | |
style={ { | |
width: 'auto', | |
height: 'auto', | |
} } | |
/> | |
</Link> | |
</div> | |
) | |
} | |
Photo.PropTypes = { | |
src: PropTypes.string, | |
sizes: PropTypes.object, | |
link: PropTypes.string, | |
} | |
export default Photo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment