Cut staging from master #810
7 changed files with 48 additions and 12 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
.asset-preview {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.asset-preview__image {
|
.asset-preview__image {
|
||||||
width : 100%;
|
width : 100%;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
12
client/scss/_claim-pending.scss
Normal file
12
client/scss/_claim-pending.scss
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
.claim-pending {
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
left: 10px;
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 2px solid red;
|
||||||
|
color: red;
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: white;
|
||||||
|
}
|
|
@ -18,6 +18,7 @@
|
||||||
@import '~scss/_button';
|
@import '~scss/_button';
|
||||||
@import '~scss/_button-primary';
|
@import '~scss/_button-primary';
|
||||||
@import '~scss/_button-secondary';
|
@import '~scss/_button-secondary';
|
||||||
|
@import '~scss/_claim-pending';
|
||||||
@import '~scss/_click-to-copy';
|
@import '~scss/_click-to-copy';
|
||||||
@import '~scss/_form-feedback';
|
@import '~scss/_form-feedback';
|
||||||
@import '~scss/_horizontal-split';
|
@import '~scss/_horizontal-split';
|
||||||
|
|
|
@ -2,8 +2,14 @@ import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import createCanonicalLink from '../../../../utils/createCanonicalLink';
|
import createCanonicalLink from '../../../../utils/createCanonicalLink';
|
||||||
|
|
||||||
|
const ClaimPending = () => {
|
||||||
|
return (
|
||||||
|
<div className='claim-pending'>PENDING</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const AssetPreview = ({ defaultThumbnail, claimData }) => {
|
const AssetPreview = ({ defaultThumbnail, claimData }) => {
|
||||||
const {name, fileExt, contentType, thumbnail, title} = claimData;
|
const {name, fileExt, contentType, thumbnail, title, pending} = claimData;
|
||||||
const showUrl = createCanonicalLink({asset: {...claimData}});
|
const showUrl = createCanonicalLink({asset: {...claimData}});
|
||||||
const embedUrl = `${showUrl}.${fileExt}`;
|
const embedUrl = `${showUrl}.${fileExt}`;
|
||||||
switch (contentType) {
|
switch (contentType) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ class AssetDisplay extends React.Component {
|
||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
const { status, error, asset } = this.props;
|
const { status, error, asset } = this.props;
|
||||||
const { name, claimData: { claimId, contentType, thumbnail, outpoint } } = asset;
|
const { name, claimData: { claimId, contentType, thumbnail, outpoint, pending } } = asset;
|
||||||
// the outpoint is added to force the browser to re-download the asset after an update
|
// the outpoint is added to force the browser to re-download the asset after an update
|
||||||
// issue: https://github.com/lbryio/spee.ch/issues/607
|
// issue: https://github.com/lbryio/spee.ch/issues/607
|
||||||
let fileExt;
|
let fileExt;
|
||||||
|
@ -68,16 +68,22 @@ class AssetDisplay extends React.Component {
|
||||||
<p>Curious what magic is happening here? <a className='link--primary' target='blank' href='https://lbry.io/faq/what-is-lbry'>Learn more.</a></p>
|
<p>Curious what magic is happening here? <a className='link--primary' target='blank' href='https://lbry.io/faq/what-is-lbry'>Learn more.</a></p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{(status === ERROR) &&
|
{(status === ERROR) && (
|
||||||
<div>
|
pending ? (
|
||||||
<Row>
|
<div>
|
||||||
<p>Unfortunately, we couldn't download your asset from LBRY. You can help us out by sharing the following error message in the <a className='link--primary' href='https://chat.lbry.io' target='_blank'>LBRY discord</a>.</p>
|
<p>This content is pending confirmation on the LBRY blockchain. It should be available in the next few minutes, please check back or refresh.</p>
|
||||||
</Row>
|
</div>
|
||||||
<Row>
|
) : (
|
||||||
<p id='error-message'><i>{error}</i></p>
|
<div>
|
||||||
</Row>
|
<Row>
|
||||||
</div>
|
<p>Unfortunately, we couldn't download your asset from LBRY. You can help us out by sharing the following error message in the <a className='link--primary' href='https://chat.lbry.io' target='_blank'>LBRY discord</a>.</p>
|
||||||
}
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<p id='error-message'><i>{error}</i></p>
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
)}
|
||||||
{(status === AVAILABLE) &&
|
{(status === AVAILABLE) &&
|
||||||
<AvailableContent
|
<AvailableContent
|
||||||
contentType={contentType}
|
contentType={contentType}
|
||||||
|
|
|
@ -17,6 +17,12 @@ const getChannelClaims = async (channelName, channelShortId, page) => {
|
||||||
channelClaims = await chainquery.claim.queries.getAllChannelClaims(channelId, params);
|
channelClaims = await chainquery.claim.queries.getAllChannelClaims(channelId, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const split = channelClaims.reduce(
|
||||||
|
(acc, val) => val.dataValues.height === 0 ? { ...acc, zero: acc.zero.concat(val) } : { ...acc, nonzero: acc.nonzero.concat(val) },
|
||||||
|
{ zero: [], nonzero: [] }
|
||||||
|
);
|
||||||
|
channelClaims = split.zero.concat(split.nonzero);
|
||||||
|
|
||||||
const processingChannelClaims = channelClaims ? channelClaims.map((claim) => getClaimData(claim)) : [];
|
const processingChannelClaims = channelClaims ? channelClaims.map((claim) => getClaimData(claim)) : [];
|
||||||
const processedChannelClaims = await Promise.all(processingChannelClaims);
|
const processedChannelClaims = await Promise.all(processingChannelClaims);
|
||||||
|
|
||||||
|
|
|
@ -28,5 +28,6 @@ module.exports = async (data) => {
|
||||||
thumbnail : data.generated_thumbnail || data.thumbnail_url || data.thumbnail,
|
thumbnail : data.generated_thumbnail || data.thumbnail_url || data.thumbnail,
|
||||||
outpoint : data.transaction_hash_id || data.outpoint,
|
outpoint : data.transaction_hash_id || data.outpoint,
|
||||||
host,
|
host,
|
||||||
|
pending: Boolean(data.height === 0),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue