Created
April 8, 2017 16:21
-
-
Save caviles/53839781df97e8ada8004901997603e6 to your computer and use it in GitHub Desktop.
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
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