just hide thumbnail for disabled content

This commit is contained in:
Sean Yesmunt 2019-09-12 16:21:13 -04:00
parent 0202dc21fb
commit 22648b9117
2 changed files with 4 additions and 43 deletions

View file

@ -86,50 +86,16 @@ export default function FileViewer(props: Props) {
}
}, [autoplay, viewFile, isStreamable, hasCostInfo, cost]);
// @if TARGET='web'
if (costInfo && costInfo.cost > 0) {
return (
<div
disabled={!hasCostInfo}
style={!obscurePreview && thumbnail ? { backgroundImage: `url("${thumbnail}")` } : {}}
onClick={supported && viewFile}
className={classnames({
content__cover: supported,
'content__cover--disabled': !supported,
'card__media--nsfw': obscurePreview,
'card__media--disabled': !fileInfo && insufficientCredits,
})}
>
{!supported && (
<Yrbl
type="happy"
title={__('Paid Content')}
subtitle={
<Fragment>
<p>{__(`We're not ready to keep track of your paid content on LBRY.TV yet.`)}</p>
<p>
{__('Good news, though! You can')}{' '}
<Button button="link" label={__('Download the desktop app')} href="https://lbry.com/get" />{' '}
{'and have access to paid content.'}
</p>
</Fragment>
}
/>
)}
</div>
);
}
// @endif
return (
<div
disabled={!hasCostInfo}
style={!obscurePreview && thumbnail ? { backgroundImage: `url("${thumbnail}")` } : {}}
style={!obscurePreview && supported && thumbnail ? { backgroundImage: `url("${thumbnail}")` } : {}}
onClick={supported && viewFile}
className={classnames({
content__cover: supported,
'content__cover--disabled': !supported,
'card__media--nsfw': obscurePreview,
'card__media--disabled': !fileInfo && insufficientCredits,
'card__media--disabled': supported && !fileInfo && insufficientCredits,
})}
>
{!supported && (
@ -140,8 +106,8 @@ export default function FileViewer(props: Props) {
<Fragment>
<p>
{__('Good news, though! You can')}{' '}
<Button button="link" label={__('Download the desktop app')} href="https://lbry.com/get" />{' '}
{'and have access to all file types.'}
<Button button="link" label={__('Download the app')} href="https://lbry.com/get" />{' '}
{__('and gain access to everything.')}
</p>
</Fragment>
}

View file

@ -5,11 +5,6 @@
vertical-align: middle;
text-align: left;
margin-bottom: var(--spacing-xlarge);
background-color: rgba($lbry-white, 0.8);
[data-mode='dark'] & {
background-color: rgba($lbry-black, 0.8);
}
padding: 5px;
}
.yrbl {