From eb3a377763b508c142b7645d0851dc9274a8f469 Mon Sep 17 00:00:00 2001 From: Lachlan Kermode Date: Wed, 26 Dec 2018 10:47:38 +0100 Subject: [PATCH] basic support for sources complete --- src/components/SourceOverlay.jsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/SourceOverlay.jsx b/src/components/SourceOverlay.jsx index 70713c3..fbf55d4 100644 --- a/src/components/SourceOverlay.jsx +++ b/src/components/SourceOverlay.jsx @@ -9,12 +9,8 @@ class SourceOverlay extends React.Component { super(props) this.renderVideo = this.renderVideo.bind(this) this.renderPhoto = this.renderPhoto.bind(this) - } - - renderPlaceholder() { - return ( - - ) + this.renderPhotobook = this.renderPhotobook.bind(this) + this.renderTestimony = this.renderTestimony.bind(this) } renderVideo() { @@ -40,6 +36,10 @@ class SourceOverlay extends React.Component { ) } + renderPhotobook() { + return this.renderError() + } + renderError() { return ( @@ -48,7 +48,9 @@ class SourceOverlay extends React.Component { renderTestimony() { return ( -
Eyewitness
+
+ Download Testimony +
) } @@ -59,6 +61,8 @@ class SourceOverlay extends React.Component { return this.renderVideo() case 'Photo': return this.renderPhoto() + case 'Photobook': + return this.renderPhotobook() case 'Eyewitness Testimony': return this.renderTestimony() default: @@ -68,7 +72,7 @@ class SourceOverlay extends React.Component { render() { if (typeof(this.props.source) !== 'object') { - return this.renderPlaceholder(); + return this.renderError() } const {id, url, title, date, type, affil_1, affil_2} = this.props.source return (