From e023acfd00352da37c556ca1472ba0e2a249c0bb Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 16 Nov 2023 17:57:13 +0100 Subject: [PATCH 1/2] Remove unnecessary proptype discrepancy --- .../glitch/features/compose/components/compose_form.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx b/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx index e3ed207043..72fc4c4ab8 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.jsx @@ -41,7 +41,7 @@ const messages = defineMessages({ class ComposeForm extends ImmutablePureComponent { static propTypes = { intl: PropTypes.object.isRequired, - text: PropTypes.string, + text: PropTypes.string.isRequired, suggestions: ImmutablePropTypes.list, spoiler: PropTypes.bool, privacy: PropTypes.string, From d3ae5b21d2b26be7a35f635361d83969156a2aee Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 16 Nov 2023 18:02:01 +0100 Subject: [PATCH 2/2] Reduce code and markup discrepancies on reply indicator --- .../compose/components/reply_indicator.jsx | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx index 941a789328..661dff3d54 100644 --- a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx @@ -6,8 +6,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import AttachmentList from 'flavours/glitch/components/attachment_list'; -import { IconButton } from 'flavours/glitch/components/icon_button'; -import AccountContainer from 'flavours/glitch/containers/account_container'; + +import { IconButton } from '../../../components/icon_button'; +import AccountContainer from '../../../containers/account_container'; const messages = defineMessages({ cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' }, @@ -17,8 +18,8 @@ class ReplyIndicator extends ImmutablePureComponent { static propTypes = { status: ImmutablePropTypes.map, - intl: PropTypes.object.isRequired, onCancel: PropTypes.func, + intl: PropTypes.object.isRequired, }; handleClick = () => { @@ -35,38 +36,32 @@ class ReplyIndicator extends ImmutablePureComponent { return null; } + const content = { __html: status.get('contentHtml') }; + const account = status.get('account'); - const content = status.get('content'); - const attachments = status.get('media_attachments'); return ( -
-
- +
+
+
+ {account && ( )} -
-
- {attachments.size > 0 && ( +
+ +
+ + {status.get('media_attachments').size > 0 && ( )} -
+ ); }