From 95af3374d440550b2ba5618da1b7985bb353aeff Mon Sep 17 00:00:00 2001 From: stephen grider Date: Sun, 5 Jul 2015 16:32:43 -0700 Subject: [PATCH] Flux - 31 - Rendering an Image Detail --- imgur-client/src/components/image-detail.jsx | 26 +++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/imgur-client/src/components/image-detail.jsx b/imgur-client/src/components/image-detail.jsx index 0812530..27d9e99 100644 --- a/imgur-client/src/components/image-detail.jsx +++ b/imgur-client/src/components/image-detail.jsx @@ -17,9 +17,33 @@ module.exports = React.createClass({ }, render: function() { return
- {this.state.image} + {this.state.image ? this.renderContent() : null}
}, + renderContent: function() { + return
+
+
+

{this.state.image.title}

+
+
+ {this.renderImage()} +
+
+
{this.state.image.description}
+
+
+
+ }, + renderImage: function() { + if(this.state.image.animated) { + return + } else { + return + } + }, onChange: function() { this.setState({ image: ImageStore.find(this.props.params.id)