diff --git a/src/assets/placeholder-image.jpg b/src/assets/placeholder-image.jpg new file mode 100644 index 0000000..e08c840 Binary files /dev/null and b/src/assets/placeholder-image.jpg differ diff --git a/src/components/Dashboard.jsx b/src/components/Dashboard.jsx index 43a1257..d734de0 100644 --- a/src/components/Dashboard.jsx +++ b/src/components/Dashboard.jsx @@ -4,7 +4,7 @@ import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as actions from '../actions'; -import MediaOverlay from './MediaOverlay.jsx'; +import SourceOverlay from './SourceOverlay.jsx'; import LoadingOverlay from './presentational/LoadingOverlay'; import Map from './Map.jsx'; import Toolbar from './Toolbar.jsx'; @@ -132,7 +132,8 @@ class Dashboard extends React.Component { onToggle={this.props.actions.markNotificationsRead} /> {this.props.app.source ? ( - { this.props.actions.updateSource(null)} } diff --git a/src/components/MediaOverlay.jsx b/src/components/MediaOverlay.jsx deleted file mode 100644 index d73717f..0000000 --- a/src/components/MediaOverlay.jsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react' - -class MediaOverlay extends React.Component { - render() { - return ( -
-
-
- -
- {/*
*/} - {/* ciao ciao */} - {/*
*/} -
-
- ) - } -} - -export default MediaOverlay diff --git a/src/components/SourceOverlay.jsx b/src/components/SourceOverlay.jsx new file mode 100644 index 0000000..3cd75c9 --- /dev/null +++ b/src/components/SourceOverlay.jsx @@ -0,0 +1,54 @@ +import React from 'react' + +class SourceOverlay extends React.Component { + + + renderVideo() { + + } + + renderImage() { + console.log(this.props.source) + return ( +
This is the image
+ ) + } + + renderError() { + return ( +
ERROR: no support for this sourcee
+ ) + } + + _renderSwitch() { + switch(this.props.source.type) { + case 'Video': + return this.renderVideo() + case 'Photo': + return this.renderImage() + default: + return this.renderError() + } + } + + render() { + return ( +
+
+
+ {this._renderSwitch()} +
+
+
+ ) + } +} + +export default SourceOverlay