React router #343
|
@ -427,6 +427,20 @@ button {
|
|||
background-color: white;
|
||||
}
|
||||
|
||||
.button--secondary {
|
||||
border: 0px;
|
||||
border-bottom: 1px solid black;
|
||||
padding: 0.5em;
|
||||
margin: 0.5em 0.3em 0.5em 0.3em;
|
||||
color: black;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.button--secondary:hover {
|
||||
border-bottom: 1px solid #9b9b9b;
|
||||
color: #4156C5;
|
||||
}
|
||||
|
||||
.button--large{
|
||||
margin: 0px;
|
||||
width: calc(100% - 2px);
|
||||
|
|
|
@ -28,29 +28,30 @@ class AssetInfo extends React.Component {
|
|||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
}
|
||||
}
|
||||
render () {
|
||||
const { channelName, certificateId, description, name, claimId, fileExt, contentType, thumbnail, host, shortId } = this.props;
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
return (
|
||||
<div>
|
||||
{this.props.channelName &&
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{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">
|
||||
<div className="column column--2 column--med-10">
|
||||
<span className="text">Channel:</span>
|
||||
</div>
|
||||
<div className="column column--8 column--med-10">
|
||||
<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.
|
||||
<span className="text"><a href={`/${channelName}:${certificateId}`}>{channelName}</a></span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
{this.props.description &&
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{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">
|
||||
<span className="text">{this.props.description}</span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<span className="text">{description}</span>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
}
|
||||
|
||||
<div className="row row--padded row--wide row--no-top">
|
||||
<div id="show-short-link">
|
||||
<div className="column column--2 column--med-10">
|
||||
<Link className="link--primary" to={`/${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.
|
||||
<Link className="link--primary" to={`/${shortId}/${name}.${fileExt}`}><span
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
className="text">Link:</span></Link>
|
||||
</div>
|
||||
<div className="column column--8 column--med-10">
|
||||
|
@ -59,7 +60,7 @@ class AssetInfo extends React.Component {
|
|||
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="input-error" id="input-error-copy-short-link" hidden="true">error here</div>
|
||||
<input type="text" id="short-link" className="input-disabled input-text--full-width" readOnly
|
||||
spellCheck="false"
|
||||
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.
|
||||
value={`${host}/${shortId}/${name}.${fileExt}`}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
onClick={this.select}/>
|
||||
</div>
|
||||
<div className="column column--1"> </div>
|
||||
|
@ -79,14 +80,14 @@ class AssetInfo extends React.Component {
|
|||
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--short row--wide">
|
||||
<div className="column column--7">
|
||||
<div className="input-error" id="input-error-copy-embed-text" hidden="true">error here</div>
|
||||
{(this.props.contentType === 'video/mp4') ? (
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{(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
|
||||
onClick={this.select} spellCheck="false"
|
||||
value={`<video width="100%" controls poster="${this.props.thumbnail}" src="${this.props.host}/${this.props.claimId}/${this.props.name}.${this.props.fileExt}"/></video>`}/>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
value={`<video width="100%" controls poster="${thumbnail}" src="${host}/${claimId}/${name}.${fileExt}"/></video>`}/>
|
||||
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
|
||||
onClick={this.select} spellCheck="false"
|
||||
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.
|
||||
value={`<img src="${host}/${claimId}/${name}.${fileExt}"/>`}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
@ -110,13 +111,13 @@ class AssetInfo extends React.Component {
|
|||
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--short row--wide flex-container--row flex-container--space-between-bottom flex-container--wrap">
|
||||
<a className="link--primary" target="_blank"
|
||||
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.
|
||||
href={`https://twitter.com/intent/tweet?text=${host}/${shortId}/${name}`}>twitter</a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<a className="link--primary" target="_blank"
|
||||
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.
|
||||
href={`https://www.facebook.com/sharer/sharer.php?u=${host}/${shortId}/${name}`}>facebook</a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<a className="link--primary" target="_blank"
|
||||
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.
|
||||
href={`http://tumblr.com/widgets/share/tool?canonicalUrl=${host}/${shortId}/${name}`}>tumblr</a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<a className="link--primary" target="_blank"
|
||||
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.
|
||||
href={`https://www.reddit.com/submit?url=${host}/${shortId}/${name}&title=${name}`}>reddit</a>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -129,21 +130,21 @@ class AssetInfo extends React.Component {
|
|||
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="column column--2 column--med-10">
|
||||
<span className="text">Claim Name:</span>
|
||||
</div><div className="column column--8 column--med-10">
|
||||
{this.props.name}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{name}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="column column--2 column--med-10">
|
||||
<span className="text">Claim Id:</span>
|
||||
</div><div className="column column--8 column--med-10">
|
||||
{this.props.claimId}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{claimId}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="column column--2 column--med-10">
|
||||
<span className="text">File Type:</span>
|
||||
</div><div className="column column--8 column--med-10">
|
||||
{this.props.contentType ? `${this.props.contentType}` : 'unknown'}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
{contentType ? `${contentType}` : 'unknown'}
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -155,7 +156,7 @@ class AssetInfo extends React.Component {
|
|||
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>
|
||||
}
|
||||
<div className="row row--wide">
|
||||
<button className="button--primary" onClick={this.toggleDetails}>{this.state.showDetails ? '[less]' : '[more]'}</button>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
<button className="button--secondary" onClick={this.toggleDetails}>{this.state.showDetails ? 'less' : 'more'}</button>
|
||||
This should be a This should be a `button` if it isn't linking anywhere.
|
||||
</div>
|
||||
</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.
|
|
@ -3,11 +3,12 @@ import NavBar from 'containers/NavBar';
|
|||
|
||||
class ErrorPage extends React.Component {
|
||||
render () {
|
||||
const { error } = this.props;
|
||||
return (
|
||||
<div>
|
||||
<NavBar/>
|
||||
<div className="row row--padded">
|
||||
<p>{this.props.error}</p>
|
||||
<p>{error}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -6,22 +6,20 @@ import AssetDisplay from 'containers/AssetDisplay';
|
|||
import AssetInfo from 'components/AssetInfo';
|
||||
|
||||
class ShowAssetDetails extends React.Component {
|
||||
componentDidMount () {
|
||||
console.log('ShowAssetDetails props', this.props);
|
||||
}
|
||||
render () {
|
||||
const { error, claimData: { title, channelName, certificateId, description, name, claimId, fileExt, contentType, thumbnail, host }, shortId } = this.props;
|
||||
return (
|
||||
<div>
|
||||
<NavBar/>
|
||||
{this.props.error &&
|
||||
{error &&
|
||||
<div className="row row--padded">
|
||||
<p>{this.props.error}</p>
|
||||
<p>{error}</p>
|
||||
</div>
|
||||
}
|
||||
{this.props.claimData &&
|
||||
<div className="row row--tall row--padded">
|
||||
<div className="column column--10">
|
||||
<AssetTitle title={this.props.claimData.title}/>
|
||||
<AssetTitle title={title}/>
|
||||
</div>
|
||||
<div className="column column--5 column--sml-10 align-content-top">
|
||||
<div className="row row--padded">
|
||||
|
@ -30,16 +28,16 @@ class ShowAssetDetails extends React.Component {
|
|||
</div><div className="column column--5 column--sml-10 align-content-top">
|
||||
<div className="row row--padded">
|
||||
<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}
|
||||
fileExt={this.props.claimData.fileExt}
|
||||
contentType={this.props.claimData.contentType}
|
||||
thumbnail={this.props.claimData.thumbnail}
|
||||
host={this.props.claimData.host}
|
||||
shortId={this.props.shortId}
|
||||
channelName={channelName}
|
||||
certificateId={certificateId}
|
||||
description={description}
|
||||
name={name}
|
||||
claimId={claimId}
|
||||
fileExt={fileExt}
|
||||
contentType={contentType}
|
||||
thumbnail={thumbnail}
|
||||
host={host}
|
||||
shortId={shortId}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,22 +5,16 @@ import AssetDisplay from 'containers/AssetDisplay';
|
|||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
|
||||
class ShowLite extends React.Component {
|
||||
render () {
|
||||
const { error, claimData: { name, claimId } } = this.props;
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
return (
|
||||
<div className="row row--tall flex-container--column flex-container--center-center">
|
||||
{this.props.error &&
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
<p>{this.props.error}</p>
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
{error &&
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
<p>{error}</p>
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
}
|
||||
{this.props.claimData &&
|
||||
<div>
|
||||
<AssetDisplay
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
name={this.props.claimData.name}
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
claimId={this.props.claimData.claimId}
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
src={`/${this.props.claimData.claimId}/${this.props.claimData.name}.${this.props.claimData.fileExt}`}
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
contentType={this.props.claimData.contentType}
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
fileExt={this.props.claimData.fileExt}
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
thumbnail={this.props.claimData.thumbnail}
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
/>
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
<Link id="asset-boilerpate" className="link--primary fine-print" to={`/${this.props.claimData.claimId}/${this.props.claimData.name}`}>hosted via Spee.ch</Link>
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
<AssetDisplay />
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
<Link id="asset-boilerpate" className="link--primary fine-print" to={`/${claimId}/${name}`}>hosted via Spee.ch</Link>
|
||||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
|
|||
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
You can use destructuring twice to avoid all the repeated
Then you can just use You can use destructuring twice to avoid all the repeated `this.props.claimData`
`const { claimData: { name, claimId... } } = this.props`
Then you can just use `name={name}`
|
|
@ -69,10 +69,10 @@ class ChannelClaimsDisplay extends React.Component {
|
|||
This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch `updateClaimsData` action which makes the call, then updates the redux state accordingly. I think making an effort to keep all data logic inside of redux files can simplify a lot of components (for the most part)
This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch `updateClaimsData` action which makes the call, then updates the redux state accordingly. I think making an effort to keep all data logic inside of redux files can simplify a lot of components (for the most part)
|
||||
/>)}
|
||||
<div>
|
||||
{(this.props.currentPage > 1) &&
|
||||
<button className={'button--primary'} onClick={this.showPreviousResultsPage}>Previous Page</button>
|
||||
This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch `updateClaimsData` action which makes the call, then updates the redux state accordingly. I think making an effort to keep all data logic inside of redux files can simplify a lot of components (for the most part)
|
||||
<button className={'button--secondary'} onClick={this.showPreviousResultsPage}>Previous Page</button>
|
||||
This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch `updateClaimsData` action which makes the call, then updates the redux state accordingly. I think making an effort to keep all data logic inside of redux files can simplify a lot of components (for the most part)
|
||||
}
|
||||
{(this.props.currentPage < this.props.totalPages) &&
|
||||
<button className={'button--primary'} onClick={this.showNextResultsPage}>Next Page</button>
|
||||
This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch `updateClaimsData` action which makes the call, then updates the redux state accordingly. I think making an effort to keep all data logic inside of redux files can simplify a lot of components (for the most part)
|
||||
<button className={'button--secondary'} onClick={this.showNextResultsPage}>Next Page</button>
|
||||
This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch `updateClaimsData` action which makes the call, then updates the redux state accordingly. I think making an effort to keep all data logic inside of redux files can simplify a lot of components (for the most part)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|||
This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch `updateClaimsData` action which makes the call, then updates the redux state accordingly. I think making an effort to keep all data logic inside of redux files can simplify a lot of components (for the most part)
This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch This might be what you were thinking of doing, but instead of doing the request here, then calling an action to update the data or set an error, just dispatch `updateClaimsData` action which makes the call, then updates the redux state accordingly. I think making an effort to keep all data logic inside of redux files can simplify a lot of components (for the most part)
|
|
@ -65,7 +65,7 @@ class PublishMetadataInputs extends React.Component {
|
|||
</div>
|
||||
</div>
|
||||
)}
|
||||
<a className="label link--primary" id="publish-details-toggle" href="#" onClick={this.toggleShowInputs}>{this.props.showMetadataInputs ? '[less]' : '[more]'}</a>
|
||||
<button className="button--secondary" onClick={this.toggleShowInputs}>{this.props.showMetadataInputs ? 'less' : 'more'}</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
This should be a
button
if it isn't linking anywhere.