spee.ch/react/components/ShowAssetDetails/index.js

58 lines
1.8 KiB
JavaScript
Raw Normal View History

import React from 'react';
2018-02-05 01:40:28 +01:00
import PropTypes from 'prop-types';
import NavBar from 'containers/NavBar';
import AssetTitle from 'components/AssetTitle';
2018-02-07 04:00:52 +01:00
import AssetDisplay from 'containers/AssetDisplay';
import AssetInfo from 'components/AssetInfo';
class ShowAssetDetails extends React.Component {
render () {
2018-02-07 07:54:06 +01:00
const { error, claimData: { title, channelName, certificateId, description, name, claimId, fileExt, contentType, thumbnail, host }, shortId } = this.props;
return (
<div>
<NavBar/>
2018-02-07 07:54:06 +01:00
{error &&
<div className="row row--padded">
2018-02-07 07:54:06 +01:00
<p>{error}</p>
</div>
}
{this.props.claimData &&
<div className="row row--tall row--padded">
<div className="column column--10">
2018-02-07 07:54:06 +01:00
<AssetTitle title={title}/>
</div>
<div className="column column--5 column--sml-10 align-content-top">
<div className="row row--padded">
2018-02-07 04:00:52 +01:00
<AssetDisplay />
</div>
</div><div className="column column--5 column--sml-10 align-content-top">
<div className="row row--padded">
<AssetInfo
2018-02-07 07:54:06 +01:00
channelName={channelName}
certificateId={certificateId}
description={description}
name={name}
claimId={claimId}
fileExt={fileExt}
contentType={contentType}
thumbnail={thumbnail}
host={host}
shortId={shortId}
/>
</div>
</div>
</div>
}
</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
};
export default ShowAssetDetails;