React router #343
|
@ -1,12 +1,173 @@
|
|||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
import React from 'react';
|
||||
|
||||
const AssetTitle = ({claimId}) => {
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
return (
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<p>Show asset info here</p>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<p>claimId: {claimId}</p>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
);
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
class AssetInfo extends React.Component {
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
constructor (props) {
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
super(props);
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
this.toggleSection = this.toggleSection.bind(this);
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
this.copyToClipboard = this.copyToClipboard.bind(this);
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
toggleSection (event) {
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
var dataSet = event.target.dataset;
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
var status = dataSet.status;
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
var toggle = document.getElementById('show-details-toggle');
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
var details = document.getElementById('show-details');
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
if (status === 'closed') {
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
details.hidden = false;
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
toggle.innerText = '[less]';
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
toggle.dataset.status = 'open';
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
} else {
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
details.hidden = true;
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
toggle.innerText = '[more]';
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
toggle.dataset.status = 'closed';
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
copyToClipboard (event) {
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
var elementToCopy = event.target.dataset.elementtocopy;
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
var element = document.getElementById(elementToCopy);
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
element.select();
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
try {
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
document.execCommand('copy');
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
} catch (err) {
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
this.setState({error: 'Oops, unable to copy'});
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
render () {
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
return (
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{this.props.channelName &&
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="row row--padded row--wide row--no-top">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--2 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<span className="text">Channel:</span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--8 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<span className="text"><a href={`/${this.props.channelName}:${this.props.certificateId}`}>{this.props.channelName}</a></span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{this.props.description &&
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="row row--padded row--wide row--no-top">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<span className="text">{this.props.description}</span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="row row--padded row--wide row--no-top">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div id="show-short-link">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--2 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<a className="link--primary" href={`/${this.props.shortId}/${this.props.name}.${this.props.fileExt}`}><span
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
className="text">Link:</span></a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--8 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="row row--short row--wide">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--7">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="input-error" id="input-error-copy-short-link" hidden="true">error here</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<input type="text" id="short-link" className="input-disabled input-text--full-width" readOnly
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
spellCheck="false"
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
value={`${this.props.host}/${this.props.shortId}/${this.props.name}.${this.props.fileExt}`}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
onClick={this.select}/>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--1"> </div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--2">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<button className="button--primary" data-elementtocopy="short-link"
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
onClick={this.copyToClipboard}>copy
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</button>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div id="show-embed-code">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--2 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<span className="text">Embed:</span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--8 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="row row--short row--wide">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--7">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="input-error" id="input-error-copy-embed-text" hidden="true">error here</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{(this.props.contentType === 'video/mp4') ? (
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<input type="text" id="embed-text" className="input-disabled input-text--full-width" readOnly
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
onClick={this.select} spellCheck="false"
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
value={`<video width="100%" controls poster="${this.props.thumbnail}" src="${this.props.host}/{claimInfo.claimId}/${this.props.name}.${this.props.fileExt}"/></video>`}/>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
) : (
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<input type="text" id="embed-text" className="input-disabled input-text--full-width" readOnly
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
onClick={this.select} spellCheck="false"
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
value={`<img src="${this.props.host}/${this.props.claimId}/${this.props.name}.${this.props.fileExt}"/>`}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
/>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
)}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--1"> </div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--2">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<button className="button--primary" data-elementtocopy="embed-text"
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
onClick={this.copyToClipboard}>copy
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</button>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div id="show-share-buttons">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="row row--padded row--wide row--no-top">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--2 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<span className="text">Share:</span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--7 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
className="row row--short row--wide flex-container--row flex-container--space-between-bottom flex-container--wrap">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<a className="link--primary" target="_blank"
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
href={`https://twitter.com/intent/tweet?text=${this.props.host}/${this.props.shortId}/${this.props.name}`}>twitter</a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<a className="link--primary" target="_blank"
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
href={`https://www.facebook.com/sharer/sharer.php?u=${this.props.host}/${this.props.shortId}/${this.props.name}`}>facebook</a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<a className="link--primary" target="_blank"
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
href={`http://tumblr.com/widgets/share/tool?canonicalUrl=${this.props.host}/${this.props.shortId}/${this.props.name}`}>tumblr</a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<a className="link--primary" target="_blank"
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
href={`https://www.reddit.com/submit?url=${this.props.host}/${this.props.shortId}/${this.props.name}&title=${this.props.name}`}>reddit</a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div id="show-details" className="row--padded row--wide row--no-top" hidden="true">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div id="show-claim-name">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--2 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<span className="text">Claim Name:</span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--8 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{this.props.name}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div id="show-claim-id">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--2 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<span className="text">Claim Id:</span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--8 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{this.props.claimId}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div id="show-claim-id">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--2 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<span className="text">File Type:</span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--8 column--med-10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{this.props.contentType ? `${this.props.contentType}` : 'unknown'}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div id="show-claim-id">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="column column--10">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<a target="_blank" href="https://lbry.io/dmca">Report</a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<div className="row row--wide">
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<a className="text link--primary" id="show-details-toggle" href="#" onClick={this.toggleSection}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
data-status="closed">[more]</a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
);
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
};
|
||||
|
||||
export default AssetTitle;
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
// required props
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
// {channelName, certificateId, description, shortId, name, fileExt, claimId, contentType, thumbnail, host}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
export default AssetInfo;
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
|
|
|||
This should be a This should be a `button` if it isn't linking anywhere.
This should be a This should be a `button` if it isn't linking anywhere.
|
|
@ -1,5 +1,4 @@
|
|||
import React from 'react';
|
||||
import NavBar from 'containers/NavBar';
|
||||
import AssetPreview from 'components/AssetPreview';
|
||||
import request from 'utils/request';
|
||||
|
||||
|
|
This should be a
button
if it isn't linking anywhere.