lbry-desktop/ui/component/viewers/appViewer/view.jsx

75 lines
2.2 KiB
React
Raw Permalink Normal View History

2019-08-06 05:25:33 +02:00
// @flow
2020-03-10 17:57:29 +01:00
import React from 'react';
import Yrbl from 'component/yrbl';
// import LoadingScreen from 'component/common/loading-screen';
2019-08-06 05:25:33 +02:00
type Props = {
source: string,
claim: StreamClaim,
contentType: string,
};
2020-03-10 17:57:29 +01:00
// const SANDBOX_TYPES = ['application/x-lbry', 'application/x-ext-lbry'];
2019-08-06 05:25:33 +02:00
// This server exists in src/platforms/electron/startSandBox.js
2020-03-10 17:57:29 +01:00
// const SANDBOX_SET_BASE_URL = 'http://localhost:5278/set/';
// const SANDBOX_CONTENT_BASE_URL = 'http://localhost:5278';
2019-08-06 05:25:33 +02:00
function AppViewer(props: Props) {
2020-03-10 17:57:29 +01:00
// const { claim, contentType } = props;
// const [loading, setLoading] = useState(true);
// const [appUrl, setAppUrl] = useState(false);
2019-08-06 05:25:33 +02:00
2020-03-10 17:57:29 +01:00
// const outpoint = `${claim.txid}:${claim.nout}`;
// useEffect(() => {
// if (SANDBOX_TYPES.indexOf(contentType) > -1) {
// fetch(`${SANDBOX_SET_BASE_URL}${outpoint}`)
// .then(res => res.text())
// .then(url => {
// const appUrl = `${SANDBOX_CONTENT_BASE_URL}${url}`;
// setAppUrl(appUrl);
// setLoading(false);
// })
// .catch(err => {
// setLoading(false);
// });
// } else {
// setLoading(false);
// }
// }, [outpoint, contentType, setAppUrl, setLoading]);
2019-08-06 05:25:33 +02:00
return (
<div className="content__cover--none">
2020-03-10 17:57:29 +01:00
<Yrbl
title={__('Sorry')}
subtitle={__('Games and apps are currently disabled due to potential security concerns.')}
/>
2019-08-06 05:25:33 +02:00
</div>
);
2020-03-10 17:57:29 +01:00
// return (
2020-04-14 01:48:11 +02:00
// <div className="file-viewer">
2020-03-10 17:57:29 +01:00
// {!appUrl && (
// <LoadingScreen
// status={loading ? __('Almost there') : __('Unable to view this file in the app')}
// spinner={loading}
// />
// )}
// {appUrl && (
// <webview
// title=""
// sandbox="allow-scripts allow-forms allow-pointer-lock"
// src={appUrl}
// autosize="on"
// style={{ border: 0, width: '100%', height: '100%' }}
// useragent="Mozilla/5.0 AppleWebKit/537 Chrome/60 Safari/537"
// enableremotemodule="false"
// webpreferences="sandbox=true,contextIsolation=true,webviewTag=false,enableRemoteModule=false,devTools=false"
// />
// )}
// </div>
// );
2019-08-06 05:25:33 +02:00
}
export default AppViewer;