Skip to content

Instantly share code, notes, and snippets.

@joaquin-viera
Last active September 24, 2020 06:55
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 joaquin-viera/8aa3989b31e180aa08ac54808b68993a to your computer and use it in GitHub Desktop.
Save joaquin-viera/8aa3989b31e180aa08ac54808b68993a to your computer and use it in GitHub Desktop.
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