Created
July 1, 2016 22:33
-
-
Save vojtatranta/1ddc8d8cbd04f6ce072c42ddc789a689 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
var FlickrImage = React.createClass({ | |
render: function() { | |
// Figure out how long ago this photo was taken. | |
var fromNow = moment(this.props.image.lastUpdated).fromNow(); | |
// Render away! | |
return ( | |
<div className="flickr-image"> | |
<h1>{this.props.image.title}</h1> | |
<div className="flickr-image-container"> | |
<img src={this.props.image.imgUrl} /> | |
</div> | |
<h2>{this.props.image.ownerName} - {this.props.image.license}</h2> | |
<h3>Last updated: {fromNow}</h3> | |
<a href={this.props.image.flickrUrl}>{this.props.image.flickrUrl}</a> | |
</div> | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment