Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save caviles/53839781df97e8ada8004901997603e6 to your computer and use it in GitHub Desktop.
Save caviles/53839781df97e8ada8004901997603e6 to your computer and use it in GitHub Desktop.
const Card = (props) => {
return (
<div style={{margin:'1em'}}>
<img width="175" src={props.avatar_url} />
<div style={{display:"inline-block", marginLeft:"10px"}}>
{props.name}
<div>{props.company}</div>
</div>
</div>
);};
let data = [
{
"avatar_url": "https://avatars2.githubusercontent.com/u/3967042?v=3",
"name": "Cesar",
"company": "@rapidlegal",
"blog": null,
},
{
"id": 62734,
"avatar_url": "https://avatars2.githubusercontent.com/u/62734?v=3",
"name": "dsd",
"company": "dsd",
}
]
const CardList = (props) => {
return (
<div>
{props.cards.map(card => <Card {...card} />)}
</div>
);};
ReactDOM.render(<CardList cards={data} />, mountNode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment