Skip to content

Instantly share code, notes, and snippets.

@jeremeylduvall
Created December 14, 2017 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremeylduvall/2c30fde21334e4e12d317461f56dc1c7 to your computer and use it in GitHub Desktop.
Save jeremeylduvall/2c30fde21334e4e12d317461f56dc1c7 to your computer and use it in GitHub Desktop.
Row.js
// External
import React from 'react';
import PropTypes from 'prop-types';
// Internal
import Photo from './photo';
const PhotoRow = ( props ) => {
return (
<div
style={ {
display: 'flex',
flexDirection: 'row',
width: '100%',
} }
>
{
props.photos.map( photo => {
return (
<Photo
src={ photo.node.featured_media.localFile.childImageSharp.sizes.src }
sizes={ photo.node.featured_media.localFile.childImageSharp.sizes }
key={ photo.node.id }
link={ photo.node.date + photo.node.slug }
/>
)
} )
}
</div>
)
}
PhotoRow.PropTypes = {
photos: PropTypes.array,
}
export default PhotoRow;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment