diff --git a/app/soapbox/components/ui/input/input.tsx b/app/soapbox/components/ui/input/input.tsx index 14bbeb60d..cab86e10e 100644 --- a/app/soapbox/components/ui/input/input.tsx +++ b/app/soapbox/components/ui/input/input.tsx @@ -11,7 +11,7 @@ const messages = defineMessages({ hidePassword: { id: 'input.password.hide_password', defaultMessage: 'Hide password' }, }); -interface IInput extends Pick, 'maxLength' | 'onChange' | 'type' | 'autoComplete' | 'autoCorrect' | 'autoCapitalize' | 'required' | 'disabled'> { +interface IInput extends Pick, 'maxLength' | 'onChange' | 'type' | 'autoComplete' | 'autoCorrect' | 'autoCapitalize' | 'required' | 'disabled' | 'onClick' | 'readOnly'> { /** Put the cursor into the input on mount. */ autoFocus?: boolean, /** The initial text in the input. */ diff --git a/app/soapbox/features/ui/components/embed_modal.js b/app/soapbox/features/ui/components/embed_modal.js deleted file mode 100644 index 42a1bbd94..000000000 --- a/app/soapbox/features/ui/components/embed_modal.js +++ /dev/null @@ -1,97 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { FormattedMessage, injectIntl } from 'react-intl'; -import { connect } from 'react-redux'; - -import api from 'soapbox/api'; -import { Modal, Stack, Text, Input } from 'soapbox/components/ui'; - -export default @connect() -@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, - }; - - fetchEmbed = () => { - const { dispatch, url } = this.props; - - return dispatch((dispatch, getState) => { - return api(getState).get('/api/oembed', { params: { url } }); - }); - } - - componentDidMount() { - this.setState({ loading: true }); - - this.fetchEmbed().then(res => { - this.setState({ loading: false, oembed: res.data }); - - const iframeDocument = this.iframe.contentWindow.document; - - iframeDocument.open(); - iframeDocument.write(res.data.html); - iframeDocument.close(); - - const innerFrame = iframeDocument.querySelector('iframe'); - - iframeDocument.body.style.margin = 0; - - if (innerFrame) { - innerFrame.width = '100%'; - } - }).catch(error => { - this.props.onError(error); - }); - } - - setIframeRef = c => { - this.iframe = c; - } - - handleTextareaClick = (e) => { - e.target.select(); - } - - render() { - const { oembed } = this.state; - - return ( - }> - - - - - - - - - -