lbry-desktop/ui/component/viewers/htmlViewer.jsx

26 lines
636 B
React
Raw Normal View History

// @flow
import React from 'react';
2018-11-21 22:20:55 +01:00
import { stopContextMenu } from 'util/context-menu';
type Props = {
source: string,
};
class HtmlViewer extends React.PureComponent<Props> {
render() {
const { source } = this.props;
return (
<div className="file-render__viewer" onContextMenu={stopContextMenu}>
{/* @if TARGET='app' */}
<iframe sandbox="" title={__('File preview')} src={`file://${source}`} />
{/* @endif */}
{/* @if TARGET='web' */}
<iframe sandbox="" title={__('File preview')} src={source} />
{/* @endif */}
</div>
);
}
}
export default HtmlViewer;