Skip to content

Instantly share code, notes, and snippets.

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