From 81ef21a0c802f1d905f37a2a818544a8b400793c Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Sat, 25 Feb 2023 14:34:32 +0100 Subject: [Glitch] Rename JSX files with proper `.jsx` extension Port 44a7d87cb1f5df953b6c14c16c59e2e4ead1bcb9 to glitch-soc Signed-off-by: Claire --- .../glitch/features/ui/components/embed_modal.js | 97 ---------------------- 1 file changed, 97 deletions(-) delete mode 100644 app/javascript/flavours/glitch/features/ui/components/embed_modal.js (limited to 'app/javascript/flavours/glitch/features/ui/components/embed_modal.js') diff --git a/app/javascript/flavours/glitch/features/ui/components/embed_modal.js b/app/javascript/flavours/glitch/features/ui/components/embed_modal.js deleted file mode 100644 index 92bfa79c4..000000000 --- a/app/javascript/flavours/glitch/features/ui/components/embed_modal.js +++ /dev/null @@ -1,97 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; -import api from 'flavours/glitch/api'; -import IconButton from 'flavours/glitch/components/icon_button'; - -const messages = defineMessages({ - close: { id: 'lightbox.close', defaultMessage: 'Close' }, -}); - -export default @injectIntl -class EmbedModal extends ImmutablePureComponent { - - static propTypes = { - url: PropTypes.string.isRequired, - onClose: PropTypes.func.isRequired, - onError: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - }; - - state = { - loading: false, - oembed: null, - }; - - componentDidMount () { - const { url } = this.props; - - this.setState({ loading: true }); - - api().post('/api/web/embed', { url }).then(res => { - this.setState({ loading: false, oembed: res.data }); - - const iframeDocument = this.iframe.contentWindow.document; - - iframeDocument.open(); - iframeDocument.write(res.data.html); - iframeDocument.close(); - - iframeDocument.body.style.margin = 0; - this.iframe.width = iframeDocument.body.scrollWidth; - this.iframe.height = iframeDocument.body.scrollHeight; - }).catch(error => { - this.props.onError(error); - }); - } - - setIframeRef = c => { - this.iframe = c; - }; - - handleTextareaClick = (e) => { - e.target.select(); - }; - - render () { - const { intl, onClose } = this.props; - const { oembed } = this.state; - - return ( -
-
- - -
- -
-

- -

- - - -

- -

- -