2018-02-14 20:39:24 +01:00
|
|
|
import React from 'react';
|
2018-02-23 03:05:00 +01:00
|
|
|
import Helmet from 'react-helmet';
|
2018-02-14 20:39:24 +01:00
|
|
|
import NavBar from 'containers/NavBar';
|
|
|
|
import ErrorPage from 'components/ErrorPage';
|
|
|
|
import AssetTitle from 'components/AssetTitle';
|
|
|
|
import AssetDisplay from 'components/AssetDisplay';
|
|
|
|
import AssetInfo from 'components/AssetInfo';
|
|
|
|
|
2018-02-23 03:05:00 +01:00
|
|
|
const { site: { title, host } } = require('../../../config/speechConfig.js');
|
|
|
|
|
2018-02-14 20:39:24 +01:00
|
|
|
class ShowAssetDetails extends React.Component {
|
|
|
|
render () {
|
|
|
|
const { asset } = this.props;
|
2018-02-23 03:05:00 +01:00
|
|
|
let channelName, certificateId, name, claimId;
|
|
|
|
if (asset.claimData) {
|
|
|
|
({ channelName, certificateId, name, claimId } = asset.claimData);
|
|
|
|
};
|
2018-02-14 20:39:24 +01:00
|
|
|
if (asset) {
|
|
|
|
return (
|
|
|
|
<div>
|
2018-02-23 03:05:00 +01:00
|
|
|
<Helmet>
|
|
|
|
<title>{title} - {name} - details</title>
|
|
|
|
{channelName ? (
|
|
|
|
<link rel='canonical' href={`${host}/${channelName}:${certificateId}/${name}`} />
|
|
|
|
) : (
|
|
|
|
<link rel='canonical' href={`${host}/${claimId}/${name}`} />
|
|
|
|
)}
|
|
|
|
</Helmet>
|
|
|
|
<NavBar />
|
|
|
|
<div className='row row--tall row--padded'>
|
|
|
|
<div className='column column--10'>
|
2018-02-14 20:39:24 +01:00
|
|
|
<AssetTitle />
|
|
|
|
</div>
|
2018-02-23 03:05:00 +01:00
|
|
|
<div className='column column--5 column--sml-10 align-content-top'>
|
|
|
|
<div className='row row--padded'>
|
2018-02-14 20:39:24 +01:00
|
|
|
<AssetDisplay />
|
|
|
|
</div>
|
2018-02-23 03:05:00 +01:00
|
|
|
</div><div className='column column--5 column--sml-10 align-content-top'>
|
|
|
|
<div className='row row--padded'>
|
|
|
|
<AssetInfo />
|
|
|
|
</div>
|
2018-02-14 20:39:24 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
return (
|
2018-02-23 03:05:00 +01:00
|
|
|
<ErrorPage error={'loading asset data...'} />
|
2018-02-14 20:39:24 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ShowAssetDetails;
|