Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 229a95f

Browse files
authored
Merge pull request #5734 from matrix-org/travis/skinning/pt3-easy-comps
[SK-3] Decorate easy components with replaceableComponent
2 parents b61fd1d + e5180a4 commit 229a95f

File tree

296 files changed

+595
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

296 files changed

+595
-8
lines changed

src/components/structures/ContextMenu.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import classNames from "classnames";
2222

2323
import {Key} from "../../Keyboard";
2424
import {Writeable} from "../../@types/common";
25+
import {replaceableComponent} from "../../utils/replaceableComponent";
2526

2627
// Shamelessly ripped off Modal.js. There's probably a better way
2728
// of doing reusable widgets like dialog boxes & menus where we go and
@@ -91,6 +92,7 @@ interface IState {
9192
// Generic ContextMenu Portal wrapper
9293
// all options inside the menu should be of role=menuitem/menuitemcheckbox/menuitemradiobutton and have tabIndex={-1}
9394
// this will allow the ContextMenu to manage its own focus using arrow keys as per the ARIA guidelines.
95+
@replaceableComponent("structures.ContextMenu")
9496
export class ContextMenu extends React.PureComponent<IProps, IState> {
9597
private initialFocus: HTMLElement;
9698

@@ -467,6 +469,7 @@ export const useContextMenu = <T extends any = HTMLElement>(): ContextMenuTuple<
467469
return [isOpen, button, open, close, setIsOpen];
468470
};
469471

472+
@replaceableComponent("structures.LegacyContextMenu")
470473
export default class LegacyContextMenu extends ContextMenu {
471474
render() {
472475
return this.renderMenu(false);

src/components/structures/CustomRoomTagPanel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import * as sdk from '../../index';
2121
import dis from '../../dispatcher/dispatcher';
2222
import classNames from 'classnames';
2323
import * as FormattingUtils from '../../utils/FormattingUtils';
24+
import {replaceableComponent} from "../../utils/replaceableComponent";
2425

26+
@replaceableComponent("structures.CustomRoomTagPanel")
2527
class CustomRoomTagPanel extends React.Component {
2628
constructor(props) {
2729
super(props);

src/components/structures/FilePanel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ import { _t } from '../../languageHandler';
2626
import BaseCard from "../views/right_panel/BaseCard";
2727
import {RightPanelPhases} from "../../stores/RightPanelStorePhases";
2828
import DesktopBuildsNotice, {WarningKind} from "../views/elements/DesktopBuildsNotice";
29+
import {replaceableComponent} from "../../utils/replaceableComponent";
2930

3031
/*
3132
* Component which shows the filtered file using a TimelinePanel
3233
*/
34+
@replaceableComponent("structures.FilePanel")
3335
class FilePanel extends React.Component {
3436
static propTypes = {
3537
roomId: PropTypes.string.isRequired,

src/components/structures/GenericErrorPage.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ limitations under the License.
1616

1717
import React from 'react';
1818
import PropTypes from 'prop-types';
19+
import {replaceableComponent} from "../../utils/replaceableComponent";
1920

21+
@replaceableComponent("structures.GenericErrorPage")
2022
export default class GenericErrorPage extends React.PureComponent {
2123
static propTypes = {
2224
title: PropTypes.object.isRequired, // jsx for title

src/components/structures/GroupFilterPanel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ import MatrixClientContext from "../../contexts/MatrixClientContext";
3030
import AutoHideScrollbar from "./AutoHideScrollbar";
3131
import SettingsStore from "../../settings/SettingsStore";
3232
import UserTagTile from "../views/elements/UserTagTile";
33+
import {replaceableComponent} from "../../utils/replaceableComponent";
3334

35+
@replaceableComponent("structures.GroupFilterPanel")
3436
class GroupFilterPanel extends React.Component {
3537
static contextType = MatrixClientContext;
3638

src/components/structures/GroupView.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {Group} from "matrix-js-sdk";
3939
import {allSettled, sleep} from "../../utils/promise";
4040
import RightPanelStore from "../../stores/RightPanelStore";
4141
import AutoHideScrollbar from "./AutoHideScrollbar";
42+
import {replaceableComponent} from "../../utils/replaceableComponent";
4243

4344
const LONG_DESC_PLACEHOLDER = _td(
4445
`<h1>HTML for your community's page</h1>
@@ -391,6 +392,7 @@ class FeaturedUser extends React.Component {
391392
const GROUP_JOINPOLICY_OPEN = "open";
392393
const GROUP_JOINPOLICY_INVITE = "invite";
393394

395+
@replaceableComponent("structures.GroupView")
394396
export default class GroupView extends React.Component {
395397
static propTypes = {
396398
groupId: PropTypes.string.isRequired,

src/components/structures/HostSignupAction.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ import {
2222
import { _t } from "../../languageHandler";
2323
import { HostSignupStore } from "../../stores/HostSignupStore";
2424
import SdkConfig from "../../SdkConfig";
25+
import {replaceableComponent} from "../../utils/replaceableComponent";
2526

2627
interface IProps {}
2728

2829
interface IState {}
2930

31+
@replaceableComponent("structures.HostSignupAction")
3032
export default class HostSignupAction extends React.PureComponent<IProps, IState> {
3133
private openDialog = async () => {
3234
await HostSignupStore.instance.setHostSignupActive(true);

src/components/structures/IndicatorScrollbar.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ limitations under the License.
1717
import React from "react";
1818
import PropTypes from "prop-types";
1919
import AutoHideScrollbar from "./AutoHideScrollbar";
20+
import {replaceableComponent} from "../../utils/replaceableComponent";
2021

22+
@replaceableComponent("structures.IndicatorScrollbar")
2123
export default class IndicatorScrollbar extends React.Component {
2224
static propTypes = {
2325
// If true, the scrollbar will append mx_IndicatorScrollbar_leftOverflowIndicator

src/components/structures/InteractiveAuth.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ import PropTypes from 'prop-types';
2222
import getEntryComponentForLoginType from '../views/auth/InteractiveAuthEntryComponents';
2323

2424
import * as sdk from '../../index';
25+
import {replaceableComponent} from "../../utils/replaceableComponent";
2526

2627
export const ERROR_USER_CANCELLED = new Error("User cancelled auth session");
2728

29+
@replaceableComponent("structures.InteractiveAuthComponent")
2830
export default class InteractiveAuthComponent extends React.Component {
2931
static propTypes = {
3032
// matrix client to use for UI auth requests

src/components/structures/LeftPanel.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import { MatrixClientPeg } from "../../MatrixClientPeg";
4040
import RoomListNumResults from "../views/rooms/RoomListNumResults";
4141
import LeftPanelWidget from "./LeftPanelWidget";
4242
import SpacePanel from "../views/spaces/SpacePanel";
43+
import {replaceableComponent} from "../../utils/replaceableComponent";
4344

4445
interface IProps {
4546
isMinimized: boolean;
@@ -60,6 +61,7 @@ const cssClasses = [
6061
"mx_RoomSublist_showNButton",
6162
];
6263

64+
@replaceableComponent("structures.LeftPanel")
6365
export default class LeftPanel extends React.Component<IProps, IState> {
6466
private listContainerRef: React.RefObject<HTMLDivElement> = createRef();
6567
private groupFilterPanelWatcherRef: string;

0 commit comments

Comments
 (0)