mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-09 20:28:29 +03:00
support for multipe font extensions
This commit is contained in:
parent
d8375db3e9
commit
00d37868e9
@ -22,3 +22,5 @@ export const getPublicAndPrivateFiles = ({ viewer }) => {
|
||||
}
|
||||
return { publicFiles, privateFiles };
|
||||
};
|
||||
|
||||
export const endsWithAny = (options, string) => options.some((option) => string.endsWith(option));
|
||||
|
@ -6,6 +6,7 @@ import * as Events from "~/common/custom-events";
|
||||
import UnityFrame from "~/components/core/UnityFrame";
|
||||
import FontFrame from "~/components/core/FontFrame";
|
||||
import MarkdownFrame from "~/components/core/MarkdownFrame";
|
||||
import { endsWithAny } from "~/common/utilities";
|
||||
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
@ -154,7 +155,7 @@ export default class SlateMediaObject extends React.Component {
|
||||
return <iframe src={url} css={STYLES_IFRAME} />;
|
||||
}
|
||||
|
||||
if (this.props.data.name.endsWith(".ttf")) {
|
||||
if (endsWithAny([".ttf", ".otf", ".woff", ".woff2"], this.props.data.name)) {
|
||||
return (
|
||||
<FontFrame
|
||||
name={this.props.data.file || this.props.data.name}
|
||||
|
Loading…
Reference in New Issue
Block a user