added default note for channels with zero claims

This commit is contained in:
bill bittner 2018-02-12 19:08:17 -08:00
parent b1fb65b1ec
commit 4672a72d02
2 changed files with 20 additions and 18 deletions

View file

@ -25,25 +25,27 @@ class ChannelClaimsDisplay extends React.Component {
const { channel: { claimsData: { claims, currentPage, totalPages } } } = this.props;
return (
<div className="row row--tall">
{claims &&
<div>
{claims.map((claim, index) => <AssetPreview
name={claim.name}
claimId={claim.claimId}
fileExt={claim.fileExt}
contentType={claim.contentType}
key={`${claim.name}-${index}`}
/>)}
{(claims.length > 0) ? (
<div>
{(currentPage > 1) &&
<button className={'button--secondary'} onClick={this.showPreviousResultsPage}>Previous Page</button>
}
{(currentPage < totalPages) &&
<button className={'button--secondary'} onClick={this.showNextResultsPage}>Next Page</button>
}
{claims.map((claim, index) => <AssetPreview
name={claim.name}
claimId={claim.claimId}
fileExt={claim.fileExt}
contentType={claim.contentType}
key={`${claim.name}-${index}`}
/>)}
<div>
{(currentPage > 1) &&
<button className={'button--secondary'} onClick={this.showPreviousResultsPage}>Previous Page</button>
}
{(currentPage < totalPages) &&
<button className={'button--secondary'} onClick={this.showNextResultsPage}>Next Page</button>
}
</div>
</div>
</div>
}
) : (
<p>There are no claims in this channel</p>
)}
</div>
);
}

View file

@ -11,7 +11,7 @@ const mapStateToProps = ({ show }) => {
const requestExtension = show.request.data.extension;
// select request
const previousRequest = show.assetRequests[show.request.id] || null;
// select asset infogit
// select asset info
let asset;
if (previousRequest) {
const assetKey = `a#${previousRequest.name}#${previousRequest.claimId}`; // note: just store this in the request