Skip to content

Instantly share code, notes, and snippets.

@jeremeylduvall
Created Dec 14, 2017
Embed
What would you like to do?
Photo.js
// 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