diff --git a/src/components/embed-modal.css b/src/components/embed-modal.css new file mode 100644 index 00000000..878bad57 --- /dev/null +++ b/src/components/embed-modal.css @@ -0,0 +1,27 @@ +.embed-modal-container { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + pointer-events: none; + + .top-controls { + padding: 16px; + display: flex; + gap: 8px; + justify-content: space-between; + pointer-events: auto; + } + + .embed-content { + flex-grow: 1; + display: flex; + align-items: center; + justify-content: center; + + iframe { + pointer-events: auto; + max-width: 100%; + } + } +} diff --git a/src/components/embed-modal.jsx b/src/components/embed-modal.jsx new file mode 100644 index 00000000..2fe764f8 --- /dev/null +++ b/src/components/embed-modal.jsx @@ -0,0 +1,28 @@ +import './embed-modal.css'; + +import Icon from './icon'; + +function EmbedModal({ html, url, onClose = () => {} }) { + return ( +
+
+ + {url && ( + + Open link + + )} +
+
+
+ ); +} + +export default EmbedModal; diff --git a/src/components/modals.jsx b/src/components/modals.jsx index c4ae37c8..7b277490 100644 --- a/src/components/modals.jsx +++ b/src/components/modals.jsx @@ -10,6 +10,7 @@ import states from '../utils/states'; import AccountSheet from './account-sheet'; import Compose from './compose'; import Drafts from './drafts'; +import EmbedModal from './embed-modal'; import GenericAccounts from './generic-accounts'; import MediaAltModal from './media-alt-modal'; import MediaModal from './media-modal'; @@ -200,6 +201,21 @@ export default function Modals() { /> )} + {!!snapStates.showEmbedModal && ( + { + states.showEmbedModal = false; + }} + > + { + states.showEmbedModal = false; + }} + /> + + )} ); } diff --git a/src/components/status.jsx b/src/components/status.jsx index 36baccda..9c4fd9cc 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -1984,6 +1984,20 @@ function Card({ card, selfReferential, instance }) { if (snapStates.unfurledLinks[url]) return null; + const hasIframeHTML = /