Skip to content

Instantly share code, notes, and snippets.

@joaquin-viera
Last active Sep 24, 2020
Embed
What would you like to do?
Concurrent Mode - Image List
import React from 'react';
const ImageList = (props) => {
const { resource, pending } = props;
const images = resource.read();
let listContainerStyles = {
background: pending ? '#ccc' : 'transparent',
display: 'flex',
flexDirection: 'row',
flexWrap: "wrap",
justifyContent: "center",
marginTop: "2em"
}
return (
<div style={listContainerStyles}>
{images.map((photo) => (
<div key={photo.id} style={{ marginRight: "1em", marginBottom: "1em" }}>
<h2>{photo.id}</h2>
<img src={photo.thumbnailUrl} />
</div>
))}
</div>
);
};
export default ImageList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment