Skip to content

Instantly share code, notes, and snippets.

@vojtatranta
Created July 1, 2016 22:33
Show Gist options
  • Save vojtatranta/1ddc8d8cbd04f6ce072c42ddc789a689 to your computer and use it in GitHub Desktop.
Save vojtatranta/1ddc8d8cbd04f6ce072c42ddc789a689 to your computer and use it in GitHub Desktop.
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