add additional app driver on paid embeds
This commit is contained in:
parent
66468174c2
commit
1210a03c3f
2 changed files with 12 additions and 2 deletions
|
@ -3,6 +3,8 @@ import React, { useEffect } from 'react';
|
||||||
import FileRender from 'component/fileRender';
|
import FileRender from 'component/fileRender';
|
||||||
import FileViewerEmbeddedTitle from 'component/fileViewerEmbeddedTitle';
|
import FileViewerEmbeddedTitle from 'component/fileViewerEmbeddedTitle';
|
||||||
import Spinner from 'component/spinner';
|
import Spinner from 'component/spinner';
|
||||||
|
import Button from 'component/button';
|
||||||
|
import { formatLbryUrlForWeb } from 'util/url';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
uri: string,
|
uri: string,
|
||||||
|
@ -23,6 +25,7 @@ const EmbedWrapperPage = (props: Props) => {
|
||||||
const loading = !claim && isResolvingUri;
|
const loading = !claim && isResolvingUri;
|
||||||
const noContentFound = !claim && !isResolvingUri;
|
const noContentFound = !claim && !isResolvingUri;
|
||||||
const isPaidContent = costInfo && costInfo.cost > 0;
|
const isPaidContent = costInfo && costInfo.cost > 0;
|
||||||
|
const contentLink = formatLbryUrlForWeb(uri);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (resolveUri && uri && !haveClaim) {
|
if (resolveUri && uri && !haveClaim) {
|
||||||
|
@ -51,7 +54,14 @@ const EmbedWrapperPage = (props: Props) => {
|
||||||
<div className="embed__loading-text">
|
<div className="embed__loading-text">
|
||||||
{loading && <Spinner delayed light />}
|
{loading && <Spinner delayed light />}
|
||||||
{noContentFound && <h1>{__('No content found.')}</h1>}
|
{noContentFound && <h1>{__('No content found.')}</h1>}
|
||||||
{isPaidContent && <h1>{__('Paid content cannot be embedded.')}</h1>}
|
{isPaidContent && (
|
||||||
|
<div>
|
||||||
|
<h1>{__('Paid content cannot be embedded.')}</h1>
|
||||||
|
<div className="section__actions--centered">
|
||||||
|
<Button label={__('View on lbry.tv')} button="primary" href={contentLink} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -39,6 +39,6 @@
|
||||||
color: var(--color-white);
|
color: var(--color-white);
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: var(--font-title);
|
font-size: var(--font-large);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue