lbry-desktop/ui/component/viewers/htmlViewer.jsx
Thomas Zarebczan 722c0b978c feat: additional file types on lbry.tv
Should support markdown, PDF, and anything in the code viewer. Tested that it's working on web and app.
2019-12-02 23:25:37 -05:00

26 lines
636 B
JavaScript

// @flow
import React from 'react';
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;