mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-09 20:28:29 +03:00
html viewer
This commit is contained in:
parent
d659efe760
commit
d8375db3e9
@ -53,6 +53,14 @@ const STYLES_IMAGE = css`
|
||||
max-height: 100%;
|
||||
`;
|
||||
|
||||
const STYLES_IFRAME = (theme) => css`
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// NOTE(Amine): lightbackground as fallback when html file doesn't have any
|
||||
background-color: ${theme.system.wallLight};
|
||||
`;
|
||||
|
||||
const typeMap = {
|
||||
"video/quicktime": "video/mp4",
|
||||
};
|
||||
@ -142,6 +150,10 @@ export default class SlateMediaObject extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (type.startsWith("text/html")) {
|
||||
return <iframe src={url} css={STYLES_IFRAME} />;
|
||||
}
|
||||
|
||||
if (this.props.data.name.endsWith(".ttf")) {
|
||||
return (
|
||||
<FontFrame
|
||||
|
Loading…
Reference in New Issue
Block a user