import * as React from "react"; import * as Constants from "~/common/constants"; import * as Validations from "~/common/validations"; import * as Events from "~/common/custom-events"; import * as Strings from "~/common/strings"; import * as Actions from "~/common/actions"; import * as Styles from "~/common/styles"; import * as SVG from "~/common/svg"; import UnityFrame from "~/components/core/UnityFrame"; import FontFrame from "~/components/core/FontFrame/index.js"; import MarkdownFrame from "~/components/core/MarkdownFrame"; import LinkLoading from "~/components/core/Link/LinkLoading"; import LinkCard from "~/components/core/Link/LinkCard"; import { css } from "@emotion/react"; import { LoaderSpinner } from "~/components/system/components/Loaders"; 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.grayLight5Light}; `; export default class SlateLinkObject extends React.Component { state = { loaded: false, }; render() { const isMobile = this.props.isMobile; const { url, linkHtml, linkIFrameAllowed } = this.props.file; const isNFTLink = Validations.isNFTLink(this.props.file); if (linkHtml) { return (
); } else if (linkIFrameAllowed && !isMobile && !isNFTLink) { return (
{ e.stopPropagation(); }} >