From fc5b1ed9d686f2d297f44872eb47812a5648dea3 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 8 Mar 2021 20:04:46 -0700 Subject: [PATCH] Batch of views getting replaceableComponent decorators --- src/components/views/emojipicker/Category.tsx | 2 ++ src/components/views/emojipicker/Emoji.tsx | 2 ++ src/components/views/emojipicker/EmojiPicker.tsx | 2 ++ src/components/views/emojipicker/Header.tsx | 2 ++ src/components/views/emojipicker/Preview.tsx | 2 ++ src/components/views/emojipicker/QuickReactions.tsx | 2 ++ src/components/views/emojipicker/ReactionPicker.tsx | 2 ++ src/components/views/emojipicker/Search.tsx | 2 ++ src/components/views/groups/GroupInviteTile.js | 2 ++ src/components/views/groups/GroupMemberList.js | 2 ++ src/components/views/groups/GroupMemberTile.js | 2 ++ src/components/views/groups/GroupPublicityToggle.js | 2 ++ src/components/views/groups/GroupRoomInfo.js | 2 ++ src/components/views/groups/GroupRoomList.js | 2 ++ src/components/views/groups/GroupRoomTile.js | 2 ++ src/components/views/groups/GroupTile.js | 2 ++ src/components/views/groups/GroupUserSettings.js | 2 ++ src/components/views/messages/DateSeparator.js | 2 ++ src/components/views/messages/EditHistoryMessage.js | 2 ++ src/components/views/messages/MAudioBody.js | 2 ++ src/components/views/messages/MFileBody.js | 2 ++ src/components/views/messages/MImageBody.js | 2 ++ src/components/views/messages/MJitsiWidgetEvent.tsx | 2 ++ src/components/views/messages/MKeyVerificationConclusion.js | 2 ++ src/components/views/messages/MKeyVerificationRequest.js | 2 ++ src/components/views/messages/MStickerBody.js | 2 ++ src/components/views/messages/MVideoBody.tsx | 2 ++ src/components/views/messages/MessageActionBar.js | 2 ++ src/components/views/messages/MessageEvent.js | 2 ++ src/components/views/messages/MessageTimestamp.js | 2 ++ src/components/views/messages/MjolnirBody.js | 2 ++ src/components/views/messages/ReactionsRow.js | 2 ++ src/components/views/messages/ReactionsRowButton.js | 2 ++ src/components/views/messages/ReactionsRowButtonTooltip.js | 2 ++ src/components/views/messages/RoomAvatarEvent.js | 2 ++ src/components/views/messages/RoomCreate.js | 2 ++ src/components/views/messages/SenderProfile.js | 2 ++ src/components/views/messages/TextualBody.js | 2 ++ src/components/views/messages/TextualEvent.js | 2 ++ src/components/views/messages/TileErrorBoundary.js | 2 ++ src/components/views/messages/ViewSourceEvent.js | 2 ++ 41 files changed, 82 insertions(+) diff --git a/src/components/views/emojipicker/Category.tsx b/src/components/views/emojipicker/Category.tsx index c4feaac8ae..4c7852def3 100644 --- a/src/components/views/emojipicker/Category.tsx +++ b/src/components/views/emojipicker/Category.tsx @@ -21,6 +21,7 @@ import { CATEGORY_HEADER_HEIGHT, EMOJI_HEIGHT, EMOJIS_PER_ROW } from "./EmojiPic import LazyRenderList from "../elements/LazyRenderList"; import {DATA_BY_CATEGORY, IEmoji} from "../../../emoji"; import Emoji from './Emoji'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; const OVERFLOW_ROWS = 3; @@ -47,6 +48,7 @@ interface IProps { onMouseLeave(emoji: IEmoji): void; } +@replaceableComponent("views.emojipicker.Category") class Category extends React.PureComponent { private renderEmojiRow = (rowIndex: number) => { const { onClick, onMouseEnter, onMouseLeave, selectedEmojis, emojis } = this.props; diff --git a/src/components/views/emojipicker/Emoji.tsx b/src/components/views/emojipicker/Emoji.tsx index 5d715fb935..5d7665ce98 100644 --- a/src/components/views/emojipicker/Emoji.tsx +++ b/src/components/views/emojipicker/Emoji.tsx @@ -19,6 +19,7 @@ import React from 'react'; import {MenuItem} from "../../structures/ContextMenu"; import {IEmoji} from "../../../emoji"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; interface IProps { emoji: IEmoji; @@ -28,6 +29,7 @@ interface IProps { onMouseLeave(emoji: IEmoji): void; } +@replaceableComponent("views.emojipicker.Emoji") class Emoji extends React.PureComponent { render() { const { onClick, onMouseEnter, onMouseLeave, emoji, selectedEmojis } = this.props; diff --git a/src/components/views/emojipicker/EmojiPicker.tsx b/src/components/views/emojipicker/EmojiPicker.tsx index bf0481c51c..6d7b90c8a6 100644 --- a/src/components/views/emojipicker/EmojiPicker.tsx +++ b/src/components/views/emojipicker/EmojiPicker.tsx @@ -26,6 +26,7 @@ import Search from "./Search"; import Preview from "./Preview"; import QuickReactions from "./QuickReactions"; import Category, {ICategory, CategoryKey} from "./Category"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; export const CATEGORY_HEADER_HEIGHT = 22; export const EMOJI_HEIGHT = 37; @@ -47,6 +48,7 @@ interface IState { viewportHeight: number; } +@replaceableComponent("views.emojipicker.EmojiPicker") class EmojiPicker extends React.Component { private readonly recentlyUsed: IEmoji[]; private readonly memoizedDataByCategory: Record; diff --git a/src/components/views/emojipicker/Header.tsx b/src/components/views/emojipicker/Header.tsx index 9a93722483..693f86ad73 100644 --- a/src/components/views/emojipicker/Header.tsx +++ b/src/components/views/emojipicker/Header.tsx @@ -21,12 +21,14 @@ import classNames from "classnames"; import {_t} from "../../../languageHandler"; import {Key} from "../../../Keyboard"; import {CategoryKey, ICategory} from "./Category"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; interface IProps { categories: ICategory[]; onAnchorClick(id: CategoryKey): void } +@replaceableComponent("views.emojipicker.Header") class Header extends React.PureComponent { private findNearestEnabled(index: number, delta: number) { index += this.props.categories.length; diff --git a/src/components/views/emojipicker/Preview.tsx b/src/components/views/emojipicker/Preview.tsx index 69bfdf4d1c..e0952ec73e 100644 --- a/src/components/views/emojipicker/Preview.tsx +++ b/src/components/views/emojipicker/Preview.tsx @@ -18,11 +18,13 @@ limitations under the License. import React from 'react'; import {IEmoji} from "../../../emoji"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; interface IProps { emoji: IEmoji; } +@replaceableComponent("views.emojipicker.Preview") class Preview extends React.PureComponent { render() { const { diff --git a/src/components/views/emojipicker/QuickReactions.tsx b/src/components/views/emojipicker/QuickReactions.tsx index 0477ecfb93..a250aca458 100644 --- a/src/components/views/emojipicker/QuickReactions.tsx +++ b/src/components/views/emojipicker/QuickReactions.tsx @@ -20,6 +20,7 @@ import React from 'react'; import { _t } from '../../../languageHandler'; import {getEmojiFromUnicode, IEmoji} from "../../../emoji"; import Emoji from "./Emoji"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; // We use the variation-selector Heart in Quick Reactions for some reason const QUICK_REACTIONS = ["👍", "👎", "😄", "🎉", "😕", "❤️", "🚀", "👀"].map(emoji => { @@ -39,6 +40,7 @@ interface IState { hover?: IEmoji; } +@replaceableComponent("views.emojipicker.QuickReactions") class QuickReactions extends React.Component { constructor(props) { super(props); diff --git a/src/components/views/emojipicker/ReactionPicker.tsx b/src/components/views/emojipicker/ReactionPicker.tsx index dbef0eadbe..e86d183aba 100644 --- a/src/components/views/emojipicker/ReactionPicker.tsx +++ b/src/components/views/emojipicker/ReactionPicker.tsx @@ -21,6 +21,7 @@ import {MatrixEvent} from "matrix-js-sdk/src/models/event"; import EmojiPicker from "./EmojiPicker"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import dis from "../../../dispatcher/dispatcher"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; interface IProps { mxEvent: MatrixEvent; @@ -32,6 +33,7 @@ interface IState { selectedEmojis: Set; } +@replaceableComponent("views.emojipicker.ReactionPicker") class ReactionPicker extends React.Component { constructor(props) { super(props); diff --git a/src/components/views/emojipicker/Search.tsx b/src/components/views/emojipicker/Search.tsx index fe1fecec7b..abe3e026be 100644 --- a/src/components/views/emojipicker/Search.tsx +++ b/src/components/views/emojipicker/Search.tsx @@ -19,6 +19,7 @@ import React from 'react'; import { _t } from '../../../languageHandler'; import {Key} from "../../../Keyboard"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; interface IProps { query: string; @@ -26,6 +27,7 @@ interface IProps { onEnter(): void; } +@replaceableComponent("views.emojipicker.Search") class Search extends React.PureComponent { private inputRef = React.createRef(); diff --git a/src/components/views/groups/GroupInviteTile.js b/src/components/views/groups/GroupInviteTile.js index 0c09b6ed05..dc48c01acb 100644 --- a/src/components/views/groups/GroupInviteTile.js +++ b/src/components/views/groups/GroupInviteTile.js @@ -26,8 +26,10 @@ import {MatrixClientPeg} from "../../../MatrixClientPeg"; import {ContextMenu, ContextMenuButton, toRightOf} from "../../structures/ContextMenu"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import {RovingTabIndexWrapper} from "../../../accessibility/RovingTabIndex"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; // XXX this class copies a lot from RoomTile.js +@replaceableComponent("views.groups.GroupInviteTile") export default class GroupInviteTile extends React.Component { static propTypes: { group: PropTypes.object.isRequired, diff --git a/src/components/views/groups/GroupMemberList.js b/src/components/views/groups/GroupMemberList.js index 600a466601..d5b3f9aec7 100644 --- a/src/components/views/groups/GroupMemberList.js +++ b/src/components/views/groups/GroupMemberList.js @@ -26,9 +26,11 @@ import AccessibleButton from '../elements/AccessibleButton'; import {RightPanelPhases} from "../../../stores/RightPanelStorePhases"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; import {Action} from "../../../dispatcher/actions"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; const INITIAL_LOAD_NUM_MEMBERS = 30; +@replaceableComponent("views.groups.GroupMemberList") export default class GroupMemberList extends React.Component { static propTypes = { groupId: PropTypes.string.isRequired, diff --git a/src/components/views/groups/GroupMemberTile.js b/src/components/views/groups/GroupMemberTile.js index 13617cf681..e8285803b0 100644 --- a/src/components/views/groups/GroupMemberTile.js +++ b/src/components/views/groups/GroupMemberTile.js @@ -22,7 +22,9 @@ import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import { GroupMemberType } from '../../../groups'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.groups.GroupMemberTile") export default class GroupMemberTile extends React.Component { static propTypes = { groupId: PropTypes.string.isRequired, diff --git a/src/components/views/groups/GroupPublicityToggle.js b/src/components/views/groups/GroupPublicityToggle.js index d42059551e..5399125d9f 100644 --- a/src/components/views/groups/GroupPublicityToggle.js +++ b/src/components/views/groups/GroupPublicityToggle.js @@ -19,7 +19,9 @@ import PropTypes from 'prop-types'; import * as sdk from '../../../index'; import GroupStore from '../../../stores/GroupStore'; import ToggleSwitch from "../elements/ToggleSwitch"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.groups.GroupPublicityTile") export default class GroupPublicityToggle extends React.Component { static propTypes = { groupId: PropTypes.string.isRequired, diff --git a/src/components/views/groups/GroupRoomInfo.js b/src/components/views/groups/GroupRoomInfo.js index 50bbd26029..227a17e995 100644 --- a/src/components/views/groups/GroupRoomInfo.js +++ b/src/components/views/groups/GroupRoomInfo.js @@ -24,7 +24,9 @@ import { _t } from '../../../languageHandler'; import GroupStore from '../../../stores/GroupStore'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.groups.GroupRoomInfo") export default class GroupRoomInfo extends React.Component { static contextType = MatrixClientContext; diff --git a/src/components/views/groups/GroupRoomList.js b/src/components/views/groups/GroupRoomList.js index 9bb46db47c..f8a90f9222 100644 --- a/src/components/views/groups/GroupRoomList.js +++ b/src/components/views/groups/GroupRoomList.js @@ -21,9 +21,11 @@ import PropTypes from 'prop-types'; import { showGroupAddRoomDialog } from '../../../GroupAddressPicker'; import AccessibleButton from '../elements/AccessibleButton'; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; const INITIAL_LOAD_NUM_ROOMS = 30; +@replaceableComponent("views.groups.GroupRoomList") export default class GroupRoomList extends React.Component { static propTypes = { groupId: PropTypes.string.isRequired, diff --git a/src/components/views/groups/GroupRoomTile.js b/src/components/views/groups/GroupRoomTile.js index 85aa56d055..8b25437f71 100644 --- a/src/components/views/groups/GroupRoomTile.js +++ b/src/components/views/groups/GroupRoomTile.js @@ -20,7 +20,9 @@ import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import { GroupRoomType } from '../../../groups'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.groups.GroupRoomTile") class GroupRoomTile extends React.Component { static propTypes = { groupId: PropTypes.string.isRequired, diff --git a/src/components/views/groups/GroupTile.js b/src/components/views/groups/GroupTile.js index dcc749b01f..bb1714c9f2 100644 --- a/src/components/views/groups/GroupTile.js +++ b/src/components/views/groups/GroupTile.js @@ -21,9 +21,11 @@ import * as sdk from '../../../index'; import dis from '../../../dispatcher/dispatcher'; import FlairStore from '../../../stores/FlairStore'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; function nop() {} +@replaceableComponent("views.groups.GroupTile") class GroupTile extends React.Component { static propTypes = { groupId: PropTypes.string.isRequired, diff --git a/src/components/views/groups/GroupUserSettings.js b/src/components/views/groups/GroupUserSettings.js index 9209106c8f..5b537d7377 100644 --- a/src/components/views/groups/GroupUserSettings.js +++ b/src/components/views/groups/GroupUserSettings.js @@ -18,7 +18,9 @@ import React from 'react'; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.groups.GroupUserSettings") export default class GroupUserSettings extends React.Component { static contextType = MatrixClientContext; diff --git a/src/components/views/messages/DateSeparator.js b/src/components/views/messages/DateSeparator.js index ef4b5d16d1..82ce8dc4ae 100644 --- a/src/components/views/messages/DateSeparator.js +++ b/src/components/views/messages/DateSeparator.js @@ -19,6 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { _t } from '../../../languageHandler'; import {formatFullDateNoTime} from '../../../DateUtils'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; function getdaysArray() { return [ @@ -32,6 +33,7 @@ function getdaysArray() { ]; } +@replaceableComponent("views.messages.DateSeparator") export default class DateSeparator extends React.Component { static propTypes = { ts: PropTypes.number.isRequired, diff --git a/src/components/views/messages/EditHistoryMessage.js b/src/components/views/messages/EditHistoryMessage.js index 0967be937a..7f100fbb92 100644 --- a/src/components/views/messages/EditHistoryMessage.js +++ b/src/components/views/messages/EditHistoryMessage.js @@ -27,12 +27,14 @@ import {MatrixClientPeg} from '../../../MatrixClientPeg'; import Modal from '../../../Modal'; import classNames from 'classnames'; import RedactedBody from "./RedactedBody"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; function getReplacedContent(event) { const originalContent = event.getOriginalContent(); return originalContent["m.new_content"] || originalContent; } +@replaceableComponent("views.messages.EditHistoryMessage") export default class EditHistoryMessage extends React.PureComponent { static propTypes = { // the message event being edited diff --git a/src/components/views/messages/MAudioBody.js b/src/components/views/messages/MAudioBody.js index 587dee4513..59a10e17f3 100644 --- a/src/components/views/messages/MAudioBody.js +++ b/src/components/views/messages/MAudioBody.js @@ -23,7 +23,9 @@ import {MatrixClientPeg} from '../../../MatrixClientPeg'; import { decryptFile } from '../../../utils/DecryptFile'; import { _t } from '../../../languageHandler'; import InlineSpinner from '../elements/InlineSpinner'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.MAudioBody") export default class MAudioBody extends React.Component { constructor(props) { super(props); diff --git a/src/components/views/messages/MFileBody.js b/src/components/views/messages/MFileBody.js index 676f0b7986..e9893f99b6 100644 --- a/src/components/views/messages/MFileBody.js +++ b/src/components/views/messages/MFileBody.js @@ -26,6 +26,7 @@ import Tinter from '../../../Tinter'; import request from 'browser-request'; import Modal from '../../../Modal'; import AccessibleButton from "../elements/AccessibleButton"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; // A cached tinted copy of require("../../../../res/img/download.svg") @@ -116,6 +117,7 @@ function computedStyle(element) { return cssText; } +@replaceableComponent("views.messages.MFileBody") export default class MFileBody extends React.Component { static propTypes = { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/MImageBody.js b/src/components/views/messages/MImageBody.js index 771d12accd..59c5b4e66b 100644 --- a/src/components/views/messages/MImageBody.js +++ b/src/components/views/messages/MImageBody.js @@ -27,7 +27,9 @@ import { _t } from '../../../languageHandler'; import SettingsStore from "../../../settings/SettingsStore"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import InlineSpinner from '../elements/InlineSpinner'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.MImageBody") export default class MImageBody extends React.Component { static propTypes = { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/MJitsiWidgetEvent.tsx b/src/components/views/messages/MJitsiWidgetEvent.tsx index 6031ede8fa..626efe1f36 100644 --- a/src/components/views/messages/MJitsiWidgetEvent.tsx +++ b/src/components/views/messages/MJitsiWidgetEvent.tsx @@ -21,11 +21,13 @@ import WidgetStore from "../../../stores/WidgetStore"; import EventTileBubble from "./EventTileBubble"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { Container, WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; interface IProps { mxEvent: MatrixEvent; } +@replaceableComponent("views.messages.MJitsiWidgetEvent") export default class MJitsiWidgetEvent extends React.PureComponent { constructor(props) { super(props); diff --git a/src/components/views/messages/MKeyVerificationConclusion.js b/src/components/views/messages/MKeyVerificationConclusion.js index 880299d29d..75d20131c0 100644 --- a/src/components/views/messages/MKeyVerificationConclusion.js +++ b/src/components/views/messages/MKeyVerificationConclusion.js @@ -22,7 +22,9 @@ import { _t } from '../../../languageHandler'; import {getNameForEventRoom, userLabelForEventRoom} from '../../../utils/KeyVerificationStateObserver'; import EventTileBubble from "./EventTileBubble"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.MKeyVerificationConclusion") export default class MKeyVerificationConclusion extends React.Component { constructor(props) { super(props); diff --git a/src/components/views/messages/MKeyVerificationRequest.js b/src/components/views/messages/MKeyVerificationRequest.js index d9594091c5..988606a766 100644 --- a/src/components/views/messages/MKeyVerificationRequest.js +++ b/src/components/views/messages/MKeyVerificationRequest.js @@ -25,7 +25,9 @@ import dis from "../../../dispatcher/dispatcher"; import {RightPanelPhases} from "../../../stores/RightPanelStorePhases"; import {Action} from "../../../dispatcher/actions"; import EventTileBubble from "./EventTileBubble"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.MKeyVerificationRequest") export default class MKeyVerificationRequest extends React.Component { constructor(props) { super(props); diff --git a/src/components/views/messages/MStickerBody.js b/src/components/views/messages/MStickerBody.js index 9839080661..54eb7649b4 100644 --- a/src/components/views/messages/MStickerBody.js +++ b/src/components/views/messages/MStickerBody.js @@ -17,7 +17,9 @@ limitations under the License. import React from 'react'; import MImageBody from './MImageBody'; import * as sdk from '../../../index'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.MStickerBody") export default class MStickerBody extends MImageBody { // Mostly empty to prevent default behaviour of MImageBody onClick(ev) { diff --git a/src/components/views/messages/MVideoBody.tsx b/src/components/views/messages/MVideoBody.tsx index ce4a4eda76..89985dee7d 100644 --- a/src/components/views/messages/MVideoBody.tsx +++ b/src/components/views/messages/MVideoBody.tsx @@ -22,6 +22,7 @@ import { decryptFile } from '../../../utils/DecryptFile'; import { _t } from '../../../languageHandler'; import SettingsStore from "../../../settings/SettingsStore"; import InlineSpinner from '../elements/InlineSpinner'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; interface IProps { /* the MatrixEvent to show */ @@ -38,6 +39,7 @@ interface IState { fetchingData: boolean, } +@replaceableComponent("views.messages.MVideoBody") export default class MVideoBody extends React.PureComponent { private videoRef = React.createRef(); diff --git a/src/components/views/messages/MessageActionBar.js b/src/components/views/messages/MessageActionBar.js index c94f296eac..c33debe3f5 100644 --- a/src/components/views/messages/MessageActionBar.js +++ b/src/components/views/messages/MessageActionBar.js @@ -28,6 +28,7 @@ import { isContentActionable, canEditContent } from '../../../utils/EventUtils'; import RoomContext from "../../../contexts/RoomContext"; import Toolbar from "../../../accessibility/Toolbar"; import {RovingAccessibleTooltipButton, useRovingTabIndex} from "../../../accessibility/RovingTabIndex"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; const OptionsButton = ({mxEvent, getTile, getReplyThread, permalinkCreator, onFocusChange}) => { const [menuDisplayed, button, openMenu, closeMenu] = useContextMenu(); @@ -101,6 +102,7 @@ const ReactButton = ({mxEvent, reactions, onFocusChange}) => { ; }; +@replaceableComponent("views.messages.MessageActionBar") export default class MessageActionBar extends React.PureComponent { static propTypes = { mxEvent: PropTypes.object.isRequired, diff --git a/src/components/views/messages/MessageEvent.js b/src/components/views/messages/MessageEvent.js index f93813fe79..866e0f521d 100644 --- a/src/components/views/messages/MessageEvent.js +++ b/src/components/views/messages/MessageEvent.js @@ -21,7 +21,9 @@ import SettingsStore from "../../../settings/SettingsStore"; import {Mjolnir} from "../../../mjolnir/Mjolnir"; import RedactedBody from "./RedactedBody"; import UnknownBody from "./UnknownBody"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.MessageEvent") export default class MessageEvent extends React.Component { static propTypes = { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/MessageTimestamp.js b/src/components/views/messages/MessageTimestamp.js index 199a6f47ce..c9bdb8937e 100644 --- a/src/components/views/messages/MessageTimestamp.js +++ b/src/components/views/messages/MessageTimestamp.js @@ -18,7 +18,9 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import {formatFullDate, formatTime} from '../../../DateUtils'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.MessageTimestamp") export default class MessageTimestamp extends React.Component { static propTypes = { ts: PropTypes.number.isRequired, diff --git a/src/components/views/messages/MjolnirBody.js b/src/components/views/messages/MjolnirBody.js index baaee91657..4368fd936c 100644 --- a/src/components/views/messages/MjolnirBody.js +++ b/src/components/views/messages/MjolnirBody.js @@ -17,7 +17,9 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import {_t} from '../../../languageHandler'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.MjolnirBody") export default class MjolnirBody extends React.Component { static propTypes = { mxEvent: PropTypes.object.isRequired, diff --git a/src/components/views/messages/ReactionsRow.js b/src/components/views/messages/ReactionsRow.js index 3451cdbb2d..d5c8ea2ac9 100644 --- a/src/components/views/messages/ReactionsRow.js +++ b/src/components/views/messages/ReactionsRow.js @@ -21,10 +21,12 @@ import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import { isContentActionable } from '../../../utils/EventUtils'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; // The maximum number of reactions to initially show on a message. const MAX_ITEMS_WHEN_LIMITED = 8; +@replaceableComponent("views.messages.ReactionsRow") export default class ReactionsRow extends React.PureComponent { static propTypes = { // The event we're displaying reactions for diff --git a/src/components/views/messages/ReactionsRowButton.js b/src/components/views/messages/ReactionsRowButton.js index bb8d9a3b6e..06421c02a2 100644 --- a/src/components/views/messages/ReactionsRowButton.js +++ b/src/components/views/messages/ReactionsRowButton.js @@ -23,7 +23,9 @@ import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import { formatCommaSeparatedList } from '../../../utils/FormattingUtils'; import dis from "../../../dispatcher/dispatcher"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.ReactionsRowButton") export default class ReactionsRowButton extends React.PureComponent { static propTypes = { // The event we're displaying reactions for diff --git a/src/components/views/messages/ReactionsRowButtonTooltip.js b/src/components/views/messages/ReactionsRowButtonTooltip.js index 2b90175722..5ecdfe311d 100644 --- a/src/components/views/messages/ReactionsRowButtonTooltip.js +++ b/src/components/views/messages/ReactionsRowButtonTooltip.js @@ -22,7 +22,9 @@ import * as sdk from '../../../index'; import { unicodeToShortcode } from '../../../HtmlUtils'; import { _t } from '../../../languageHandler'; import { formatCommaSeparatedList } from '../../../utils/FormattingUtils'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.ReactionsRowButtonTooltip") export default class ReactionsRowButtonTooltip extends React.PureComponent { static propTypes = { // The event we're displaying reactions for diff --git a/src/components/views/messages/RoomAvatarEvent.js b/src/components/views/messages/RoomAvatarEvent.js index f526d080cc..ba860216f0 100644 --- a/src/components/views/messages/RoomAvatarEvent.js +++ b/src/components/views/messages/RoomAvatarEvent.js @@ -23,7 +23,9 @@ import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import Modal from '../../../Modal'; import AccessibleButton from '../elements/AccessibleButton'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.RoomAvatarEvent") export default class RoomAvatarEvent extends React.Component { static propTypes = { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/RoomCreate.js b/src/components/views/messages/RoomCreate.js index 479592aa42..3e02884c02 100644 --- a/src/components/views/messages/RoomCreate.js +++ b/src/components/views/messages/RoomCreate.js @@ -23,7 +23,9 @@ import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks'; import { _t } from '../../../languageHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import EventTileBubble from "./EventTileBubble"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.RoomCreate") export default class RoomCreate extends React.Component { static propTypes = { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/SenderProfile.js b/src/components/views/messages/SenderProfile.js index d2db05252c..bd10526799 100644 --- a/src/components/views/messages/SenderProfile.js +++ b/src/components/views/messages/SenderProfile.js @@ -20,7 +20,9 @@ import Flair from '../elements/Flair.js'; import FlairStore from '../../../stores/FlairStore'; import {getUserNameColorClass} from '../../../utils/FormattingUtils'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.SenderProfile") export default class SenderProfile extends React.Component { static propTypes = { mxEvent: PropTypes.object.isRequired, // event whose sender we're showing diff --git a/src/components/views/messages/TextualBody.js b/src/components/views/messages/TextualBody.js index 04db7bd725..b0eb6f2f35 100644 --- a/src/components/views/messages/TextualBody.js +++ b/src/components/views/messages/TextualBody.js @@ -35,7 +35,9 @@ import {isPermalinkHost} from "../../../utils/permalinks/Permalinks"; import {toRightOf} from "../../structures/ContextMenu"; import {copyPlaintext} from "../../../utils/strings"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.TextualBody") export default class TextualBody extends React.Component { static propTypes = { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/TextualEvent.js b/src/components/views/messages/TextualEvent.js index 99e94147f7..a020cc6c52 100644 --- a/src/components/views/messages/TextualEvent.js +++ b/src/components/views/messages/TextualEvent.js @@ -18,7 +18,9 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import * as TextForEvent from "../../../TextForEvent"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.TextualEvent") export default class TextualEvent extends React.Component { static propTypes = { /* the MatrixEvent to show */ diff --git a/src/components/views/messages/TileErrorBoundary.js b/src/components/views/messages/TileErrorBoundary.js index 9b67e32548..0e9a7b6128 100644 --- a/src/components/views/messages/TileErrorBoundary.js +++ b/src/components/views/messages/TileErrorBoundary.js @@ -20,7 +20,9 @@ import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import Modal from '../../../Modal'; import SdkConfig from "../../../SdkConfig"; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.TileErrorBoundary") export default class TileErrorBoundary extends React.Component { constructor(props) { super(props); diff --git a/src/components/views/messages/ViewSourceEvent.js b/src/components/views/messages/ViewSourceEvent.js index 9064fc3b68..adc7a248cd 100644 --- a/src/components/views/messages/ViewSourceEvent.js +++ b/src/components/views/messages/ViewSourceEvent.js @@ -17,7 +17,9 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; +import {replaceableComponent} from "../../../utils/replaceableComponent"; +@replaceableComponent("views.messages.ViewSourceEvent") export default class ViewSourceEvent extends React.PureComponent { static propTypes = { /* the MatrixEvent to show */