-
-
Save joaquin-viera/8aa3989b31e180aa08ac54808b68993a to your computer and use it in GitHub Desktop.
Concurrent Mode - Image List
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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