From e995f70ed3741620a5629ac75e5ac812968d4bed Mon Sep 17 00:00:00 2001 From: Jeremy Kescher Date: Fri, 16 Feb 2024 15:12:22 +0100 Subject: [PATCH] Fix certain jsx files being in an old state in relation to the emoji reactions PR --- .../glitch/components/status_action_bar.jsx | 2 +- .../glitch/components/status_prepend.jsx | 2 +- .../notifications/components/filter_bar.jsx | 2 +- .../features/status/components/action_bar.jsx | 4 +- .../mastodon/actions/interactions.js | 96 ---------- .../mastodon/actions/notifications.js | 1 - .../mastodon/components/status_reactions.jsx | 170 ------------------ .../mastodon/containers/status_container.jsx | 10 -- .../components/emoji_picker_dropdown.jsx | 3 +- .../components/column_settings.jsx | 11 -- .../mastodon/features/status/index.jsx | 19 -- app/javascript/mastodon/reducers/settings.js | 3 - 12 files changed, 6 insertions(+), 317 deletions(-) delete mode 100644 app/javascript/mastodon/components/status_reactions.jsx diff --git a/app/javascript/flavours/glitch/components/status_action_bar.jsx b/app/javascript/flavours/glitch/components/status_action_bar.jsx index 150316038f..d3b1e34a09 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.jsx +++ b/app/javascript/flavours/glitch/components/status_action_bar.jsx @@ -338,7 +338,7 @@ class StatusActionBar extends ImmutablePureComponent { onClick={this.handleNoOp} // EmojiPickerDropdown handles that title={intl.formatMessage(messages.react)} disabled={!canReact} - icon='add-reaction' + icon='add_reaction' iconComponent={AddReactionIcon} /> ); diff --git a/app/javascript/flavours/glitch/components/status_prepend.jsx b/app/javascript/flavours/glitch/components/status_prepend.jsx index b9017f8491..7cb1599ac2 100644 --- a/app/javascript/flavours/glitch/components/status_prepend.jsx +++ b/app/javascript/flavours/glitch/components/status_prepend.jsx @@ -131,7 +131,7 @@ export default class StatusPrepend extends PureComponent { iconComponent = StarIcon; break; case 'reaction': - iconId = 'add-reaction'; + iconId = 'add_reaction'; iconComponent = AddReactionIcon; break; case 'featured': diff --git a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx index ee645b1ba1..13aba0d0ef 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx +++ b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx @@ -89,7 +89,7 @@ class FilterBar extends PureComponent { onClick={this.onClick('reaction')} title={intl.formatMessage(tooltips.reactions)} > - + - ); - } - -} - -class Emoji extends React.PureComponent { - - static propTypes = { - emoji: PropTypes.string.isRequired, - hovered: PropTypes.bool.isRequired, - url: PropTypes.string, - staticUrl: PropTypes.string, - }; - - render() { - const { emoji, hovered, url, staticUrl } = this.props; - - if (unicodeMapping[emoji]) { - const { filename, shortCode } = unicodeMapping[this.props.emoji]; - const title = shortCode ? `:${shortCode}:` : ''; - - return ( - {emoji} - ); - } else { - const filename = (autoPlayGif || hovered) ? url : staticUrl; - const shortCode = `:${emoji}:`; - - return ( - {shortCode} - ); - } - } - -} diff --git a/app/javascript/mastodon/containers/status_container.jsx b/app/javascript/mastodon/containers/status_container.jsx index 722a35568d..7a7cd9880f 100644 --- a/app/javascript/mastodon/containers/status_container.jsx +++ b/app/javascript/mastodon/containers/status_container.jsx @@ -30,8 +30,6 @@ import { unbookmark, pin, unpin, - addReaction, - removeReaction, } from '../actions/interactions'; import { openModal } from '../actions/modal'; import { initMuteModal } from '../actions/mutes'; @@ -137,14 +135,6 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({ } }, - onReactionAdd (statusId, name, url) { - dispatch(addReaction(statusId, name, url)); - }, - - onReactionRemove (statusId, name) { - dispatch(removeReaction(statusId, name)); - }, - onEmbed (status) { dispatch(openModal({ modalType: 'EMBED', diff --git a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx index 51d3979024..4a590bccd7 100644 --- a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx +++ b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx @@ -322,7 +322,6 @@ class EmojiPickerDropdown extends PureComponent { onSkinTone: PropTypes.func.isRequired, skinTone: PropTypes.number.isRequired, button: PropTypes.node, - disabled: PropTypes.bool, }; state = { @@ -356,7 +355,7 @@ class EmojiPickerDropdown extends PureComponent { }; onToggle = (e) => { - if (!this.state.disabled && !this.state.loading && (!e.key || e.key === 'Enter')) { + if (!this.state.loading && (!e.key || e.key === 'Enter')) { if (this.state.active) { this.onHideDropdown(); } else { diff --git a/app/javascript/mastodon/features/notifications/components/column_settings.jsx b/app/javascript/mastodon/features/notifications/components/column_settings.jsx index a08fa6c948..09154f257a 100644 --- a/app/javascript/mastodon/features/notifications/components/column_settings.jsx +++ b/app/javascript/mastodon/features/notifications/components/column_settings.jsx @@ -119,17 +119,6 @@ export default class ColumnSettings extends PureComponent { -
- - -
- - {showPushSettings && } - - -
-
-
diff --git a/app/javascript/mastodon/features/status/index.jsx b/app/javascript/mastodon/features/status/index.jsx index 837c8a49d5..a3034bb570 100644 --- a/app/javascript/mastodon/features/status/index.jsx +++ b/app/javascript/mastodon/features/status/index.jsx @@ -46,8 +46,6 @@ import { unreblog, pin, unpin, - addReaction, - removeReaction, } from '../../actions/interactions'; import { openModal } from '../../actions/modal'; import { initMuteModal } from '../../actions/mutes'; @@ -267,19 +265,6 @@ class Status extends ImmutablePureComponent { } }; - handleReactionAdd = (statusId, name, url) => { - const { dispatch } = this.props; - const { signedIn } = this.context.identity; - - if (signedIn) { - dispatch(addReaction(statusId, name, url)); - } - }; - - handleReactionRemove = (statusId, name) => { - this.props.dispatch(removeReaction(statusId, name)); - }; - handlePin = (status) => { if (status.get('pinned')) { this.props.dispatch(unpin(status)); @@ -720,15 +705,12 @@ class Status extends ImmutablePureComponent { status={status} onOpenVideo={this.handleOpenVideo} onOpenMedia={this.handleOpenMedia} - onReactionAdd={this.handleReactionAdd} - onReactionRemove={this.handleReactionRemove} onToggleHidden={this.handleToggleHidden} onTranslate={this.handleTranslate} domain={domain} showMedia={this.state.showMedia} onToggleMediaVisibility={this.handleToggleMediaVisibility} pictureInPicture={pictureInPicture} - emojiMap={this.props.emojiMap} />