Skip to content

Instantly share code, notes, and snippets.

@vojtatranta
Last active July 2, 2016 00:28
Show Gist options
  • Save vojtatranta/97cf7dc4b63dd3e14a38154ca9af5037 to your computer and use it in GitHub Desktop.
Save vojtatranta/97cf7dc4b63dd3e14a38154ca9af5037 to your computer and use it in GitHub Desktop.
var FlickrImageTime = React.createClass({
render: function() {
return (
<h3>Last updated: {moment(this.props.lastUpdate * 1000).fromNow()}</h3>
)
}
})
var FlickrImage = React.createClass({
render: function() {
// 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.license}</h2>
<FlickrImageTime lastUpdate={this.props.image.lastUpdate} />
<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