2015-05-27 17:34:15 +02:00
|
|
|
import React from 'react';
|
|
|
|
import InjectInHeadMixin from '../../mixins/inject_in_head_mixin';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the component that implements display-specific functionality.
|
|
|
|
*
|
|
|
|
* ResourceViewer handles the following mimetypes:
|
|
|
|
* - image
|
|
|
|
* - video
|
|
|
|
* - audio
|
|
|
|
* - pdf
|
|
|
|
* - other
|
|
|
|
*/
|
|
|
|
|
|
|
|
let resourceMap = {
|
|
|
|
'image': 1
|
|
|
|
}
|
|
|
|
|
|
|
|
let ResourceViewer = React.createClass({
|
|
|
|
propTypes: {
|
|
|
|
thumbnail: React.PropTypes.string.isRequired,
|
|
|
|
mimetype: React.PropTypes.oneOf(['image', 'video', 'audio', 'pdf', 'other']).isRequired
|
|
|
|
},
|
|
|
|
|
|
|
|
mixins: [InjectInHeadMixin],
|
|
|
|
|
|
|
|
componentDidMount() {
|
2015-06-04 11:41:56 +02:00
|
|
|
//this.inject('http://antani.com');
|
2015-05-27 17:34:15 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
resourceviewer {this.props.thumbnail} {this.props.mimetype}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default ResourceViewer;
|