diff --git a/app/javascript/gabsocial/components/display_name.js b/app/javascript/gabsocial/components/display_name.js index 9e8328d2..3841ea85 100644 --- a/app/javascript/gabsocial/components/display_name.js +++ b/app/javascript/gabsocial/components/display_name.js @@ -3,7 +3,6 @@ import ImmutablePureComponent from 'react-immutable-pure-component' import { debounce } from 'lodash' import classNames from 'classnames/bind' import { openPopover, closePopover } from '../actions/popover' -import Badge from './badge' import Icon from './icon' const cx = classNames.bind(_s) diff --git a/app/javascript/gabsocial/components/input.js b/app/javascript/gabsocial/components/input.js index 2dd0a039..65d7d456 100644 --- a/app/javascript/gabsocial/components/input.js +++ b/app/javascript/gabsocial/components/input.js @@ -18,6 +18,7 @@ export default class Input extends PureComponent { onClear: PropTypes.func, title: PropTypes.string, small: PropTypes.bool, + readOnly: PropTypes.string, } render() { @@ -32,7 +33,8 @@ export default class Input extends PureComponent { onBlur, onClear, title, - small + small, + readOnly } = this.props const inputClasses = cx({ @@ -42,9 +44,12 @@ export default class Input extends PureComponent { lineHeight125: 1, displayBlock: 1, py10: 1, - backgroundTransparent: 1, + backgroundTransparent: !readOnly, + backgroundSubtle2: readOnly, + colorSecondary: readOnly, fontSize15PX: 1, flexGrow1: 1, + circle: 1, px5: !!prependIcon, pl15: !prependIcon, pr15: !hasClear, @@ -75,6 +80,7 @@ export default class Input extends PureComponent { onKeyUp={onKeyUp} onFocus={onFocus} onBlur={onBlur} + readOnly={readOnly} /> { diff --git a/app/javascript/gabsocial/components/modal/actions_modal/actions_modal.scss b/app/javascript/gabsocial/components/modal/actions_modal/actions_modal.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/app/javascript/gabsocial/components/modal/boost_modal/boost_modal.scss b/app/javascript/gabsocial/components/modal/boost_modal/boost_modal.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/app/javascript/gabsocial/components/modal/compose_modal.js b/app/javascript/gabsocial/components/modal/compose_modal.js index aa5d1f7f..72db8453 100644 --- a/app/javascript/gabsocial/components/modal/compose_modal.js +++ b/app/javascript/gabsocial/components/modal/compose_modal.js @@ -51,7 +51,8 @@ class ComposeModal extends ImmutablePureComponent { return ( diff --git a/app/javascript/gabsocial/components/modal/compose_modal/compose_modal.scss b/app/javascript/gabsocial/components/modal/compose_modal/compose_modal.scss deleted file mode 100644 index f4c6f54d..00000000 --- a/app/javascript/gabsocial/components/modal/compose_modal/compose_modal.scss +++ /dev/null @@ -1,18 +0,0 @@ -.compose-modal { - width: 600px; - - &__content { - .timeline-compose-block { - background: transparent !important; - width: 100%; - padding: 10px 5px; - margin-bottom: 0; - - .compose-form { - display: flex; - flex-direction: column; - max-height: 100%; - } - } - } -} \ No newline at end of file diff --git a/app/javascript/gabsocial/components/modal/confirmation_modal/confirmation_modal.scss b/app/javascript/gabsocial/components/modal/confirmation_modal/confirmation_modal.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/app/javascript/gabsocial/components/modal/embed_modal.js b/app/javascript/gabsocial/components/modal/embed_modal.js index 3cc75c34..e4d2f727 100644 --- a/app/javascript/gabsocial/components/modal/embed_modal.js +++ b/app/javascript/gabsocial/components/modal/embed_modal.js @@ -1,12 +1,17 @@ -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { defineMessages, injectIntl } from 'react-intl'; +import ImmutablePureComponent from 'react-immutable-pure-component' +import { defineMessages, injectIntl } from 'react-intl' import api from '../../api' +import ModalLayout from './modal_layout' +import Divider from '../divider' +import Icon from '../icon' +import Input from '../input' +import Text from '../text' const messages = defineMessages({ embed: { id: 'status.embed', defaultMessage: 'Embed' }, instructions: { id: 'embed.instructions', defaultMessage: 'Embed this status on your website by copying the code below.' }, preview: { id: 'embed.preview', defaultMessage: 'Here is what it will look like:' }, -}); +}) export default @injectIntl @@ -22,72 +27,82 @@ class EmbedModal extends ImmutablePureComponent { 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; + 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(); + e.target.select() } - render () { - const { oembed, intl } = this.state; + render() { + const { intl } = this.props + const { oembed } = this.state return ( -
-

{intl.formatMessage(messages.embed)}

- -
-

+ +

+ {intl.formatMessage(messages.instructions)} -

+
- +
+ +
-

+ + + {intl.formatMessage(messages.preview)} -

+ + +
+