2018-01-30 18:00:02 +01:00
|
|
|
import React from 'react';
|
2018-02-05 01:40:28 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2018-01-30 18:00:02 +01:00
|
|
|
import NavBar from 'containers/NavBar';
|
|
|
|
import AssetTitle from 'components/AssetTitle';
|
|
|
|
import AssetDisplay from 'components/AssetDisplay';
|
|
|
|
import AssetInfo from 'components/AssetInfo';
|
|
|
|
|
2018-02-02 20:10:58 +01:00
|
|
|
class ShowAssetDetails extends React.Component {
|
2018-01-30 18:00:02 +01:00
|
|
|
componentDidMount () {
|
2018-02-02 20:10:58 +01:00
|
|
|
console.log('ShowAssetDetails props', this.props);
|
2018-01-30 18:00:02 +01:00
|
|
|
}
|
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<NavBar/>
|
2018-01-31 02:15:23 +01:00
|
|
|
{this.props.error &&
|
2018-02-01 04:12:54 +01:00
|
|
|
<div className="row row--padded">
|
|
|
|
<p>{this.props.error}</p>
|
|
|
|
</div>
|
2018-01-31 02:15:23 +01:00
|
|
|
}
|
|
|
|
{this.props.claimData &&
|
|
|
|
<div className="row row--tall row--padded">
|
|
|
|
<div className="column column--10">
|
|
|
|
<AssetTitle title={this.props.claimData.title}/>
|
|
|
|
</div>
|
|
|
|
<div className="column column--5 column--sml-10 align-content-top">
|
|
|
|
<div className="row row--padded">
|
|
|
|
<AssetDisplay
|
2018-02-01 04:12:54 +01:00
|
|
|
name={this.props.claimData.name}
|
2018-01-31 02:15:23 +01:00
|
|
|
claimId={this.props.claimData.claimId}
|
2018-02-02 04:36:08 +01:00
|
|
|
src={`/${this.props.claimData.claimId}/${this.props.claimData.name}.${this.props.claimData.fileExt}`}
|
2018-02-01 06:08:28 +01:00
|
|
|
contentType={this.props.claimData.contentType}
|
|
|
|
fileExt={this.props.claimData.fileExt}
|
2018-02-01 23:29:33 +01:00
|
|
|
thumbnail={this.props.claimData.thumbnail}
|
2018-01-31 02:15:23 +01:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div><div className="column column--5 column--sml-10 align-content-top">
|
|
|
|
<div className="row row--padded">
|
2018-02-01 04:12:54 +01:00
|
|
|
<AssetInfo
|
|
|
|
channelName={this.props.claimData.channelName}
|
|
|
|
certificateId={this.props.claimData.certificateId}
|
|
|
|
description={this.props.claimData.description}
|
|
|
|
name={this.props.claimData.name}
|
|
|
|
claimId={this.props.claimData.claimId}
|
2018-02-05 01:40:28 +01:00
|
|
|
fileExt={this.props.claimData.fileExt}
|
2018-02-01 04:12:54 +01:00
|
|
|
contentType={this.props.claimData.contentType}
|
|
|
|
thumbnail={this.props.claimData.thumbnail}
|
|
|
|
host={this.props.claimData.host}
|
2018-02-07 00:09:12 +01:00
|
|
|
shortId={this.props.shortId}
|
2018-02-01 04:12:54 +01:00
|
|
|
/>
|
2018-01-31 02:15:23 +01:00
|
|
|
</div>
|
2018-01-30 18:00:02 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-01-31 02:15:23 +01:00
|
|
|
}
|
2018-01-30 18:00:02 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-02-05 01:40:28 +01:00
|
|
|
ShowAssetDetails.propTypes = {
|
|
|
|
error : PropTypes.string,
|
|
|
|
claimData: PropTypes.object.isRequired,
|
2018-02-05 02:43:02 +01:00
|
|
|
shortId : PropTypes.string.isRequired,
|
2018-02-05 01:40:28 +01:00
|
|
|
};
|
2018-01-30 20:46:22 +01:00
|
|
|
|
2018-02-02 20:10:58 +01:00
|
|
|
export default ShowAssetDetails;
|