diff --git a/src/components/views/dialogs/SpaceSettingsDialog.tsx b/src/components/views/dialogs/SpaceSettingsDialog.tsx index 1273f06401..5e0cd96740 100644 --- a/src/components/views/dialogs/SpaceSettingsDialog.tsx +++ b/src/components/views/dialogs/SpaceSettingsDialog.tsx @@ -27,7 +27,7 @@ import TabbedView, { Tab } from "../../structures/TabbedView"; import SpaceSettingsGeneralTab from '../spaces/SpaceSettingsGeneralTab'; import SpaceSettingsVisibilityTab from "../spaces/SpaceSettingsVisibilityTab"; import SettingsStore from "../../../settings/SettingsStore"; -import {UIFeature} from "../../../settings/UIFeature"; +import { UIFeature } from "../../../settings/UIFeature"; import AdvancedRoomSettingsTab from "../settings/tabs/room/AdvancedRoomSettingsTab"; export enum SpaceSettingsTab { @@ -91,4 +91,3 @@ const SpaceSettingsDialog: React.FC = ({ matrixClient: cli, space, onFin }; export default SpaceSettingsDialog; - diff --git a/src/components/views/elements/LabelledToggleSwitch.tsx b/src/components/views/elements/LabelledToggleSwitch.tsx index 957e3dbc97..d97b698fd8 100644 --- a/src/components/views/elements/LabelledToggleSwitch.tsx +++ b/src/components/views/elements/LabelledToggleSwitch.tsx @@ -1,5 +1,5 @@ /* -Copyright 2019, 2021 The Matrix.org Foundation C.I.C. +Copyright 2019 - 2021 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/components/views/elements/RoomAliasField.tsx b/src/components/views/elements/RoomAliasField.tsx index 7eff529c46..74af311b47 100644 --- a/src/components/views/elements/RoomAliasField.tsx +++ b/src/components/views/elements/RoomAliasField.tsx @@ -1,5 +1,5 @@ /* -Copyright 2019, 2021 The Matrix.org Foundation C.I.C. +Copyright 2019 - 2021 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -39,9 +39,13 @@ interface IState { export default class RoomAliasField extends React.PureComponent { private fieldRef = createRef(); - public state = { - isValid: true, - }; + constructor(props, context) { + super(props, context); + + this.state = { + isValid: true, + }; + } private asFullAlias(localpart: string): string { return `#${localpart}:${this.props.domain}`; @@ -123,15 +127,15 @@ export default class RoomAliasField extends React.PureComponent ], }); - get isValid() { + public get isValid() { return this.state.isValid; } - validate(options: IValidateOpts) { + public validate(options: IValidateOpts) { return this.fieldRef.current?.validate(options); } - focus() { + public focus() { this.fieldRef.current?.focus(); } } diff --git a/src/components/views/room_settings/RoomPublishSetting.tsx b/src/components/views/room_settings/RoomPublishSetting.tsx index 24df5f1c84..95b0ac100d 100644 --- a/src/components/views/room_settings/RoomPublishSetting.tsx +++ b/src/components/views/room_settings/RoomPublishSetting.tsx @@ -1,5 +1,5 @@ /* -Copyright 2020, 2021 The Matrix.org Foundation C.I.C. +Copyright 2020 - 2021 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -33,9 +33,13 @@ interface IState { @replaceableComponent("views.room_settings.RoomPublishSetting") export default class RoomPublishSetting extends React.PureComponent { - public state = { - isRoomPublished: false, - }; + constructor(props, context) { + super(props, context); + + this.state = { + isRoomPublished: false, + }; + } private onRoomPublishChange = (e) => { const valueBefore = this.state.isRoomPublished; @@ -67,7 +71,7 @@ export default class RoomPublishSetting extends React.PureComponent ); diff --git a/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx index 7e7d9cba90..c4963d0154 100644 --- a/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx @@ -1,5 +1,5 @@ /* -Copyright 2019, 2021 The Matrix.org Foundation C.I.C. +Copyright 2019 - 2021 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ limitations under the License. */ import React from 'react'; +import { EventType } from 'matrix-js-sdk/src/@types/event'; import { _t } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; @@ -56,10 +57,10 @@ export default class AdvancedRoomSettingsTab extends React.Component { - const tombstone = room.currentState.getStateEvents("m.room.tombstone", ""); + const tombstone = room.currentState.getStateEvents(EventType.RoomTombstone, ""); const additionalStateChanges: Partial = {}; - const createEvent = room.currentState.getStateEvents("m.room.create", ""); + const createEvent = room.currentState.getStateEvents(EventType.RoomCreate, ""); const predecessor = createEvent ? createEvent.getContent().predecessor : null; if (predecessor && predecessor.room_id) { additionalStateChanges.oldRoomId = predecessor.room_id; @@ -100,9 +101,9 @@ export default class AdvancedRoomSettingsTab extends React.Component{_t('This room is not accessible by remote Matrix servers')}; + unfederatableSection =
{ _t('This room is not accessible by remote Matrix servers') }
; } let roomUpgradeButton; @@ -110,7 +111,7 @@ export default class AdvancedRoomSettingsTab extends React.Component

- {_t( + { _t( "Warning: Upgrading a room will not automatically migrate room members " + "to the new version of the room. We'll post a link to the new room in the old " + "version of the room - room members will have to click this link to join the new room.", @@ -118,10 +119,10 @@ export default class AdvancedRoomSettingsTab extends React.Component {sub}, "i": (sub) => {sub}, }, - )} + ) }

- {_t("Upgrade this room to the recommended room version")} + { _t("Upgrade this room to the recommended room version") } ); @@ -141,21 +142,21 @@ export default class AdvancedRoomSettingsTab extends React.Component -
{_t("Advanced")}
+
{ _t("Advanced") }
{ room?.isSpaceRoom() ? _t("Space information") : _t("Room information") }
- {_t("Internal room ID:")}  + { _t("Internal room ID:") }  { this.props.roomId }
{ unfederatableSection }
- {_t("Room version")} + { _t("Room version") }
- {_t("Room version:")}  + { _t("Room version:") }  { room.getVersion() }
{ oldRoomLink } diff --git a/src/components/views/spaces/SpaceSettingsGeneralTab.tsx b/src/components/views/spaces/SpaceSettingsGeneralTab.tsx index db0a180846..3afdc629e4 100644 --- a/src/components/views/spaces/SpaceSettingsGeneralTab.tsx +++ b/src/components/views/spaces/SpaceSettingsGeneralTab.tsx @@ -90,7 +90,7 @@ const SpaceSettingsGeneralTab = ({ matrixClient: cli, space, onFinished }: IProp }; return
-
{_t("General")}
+
{ _t("General") }
{ _t("Edit settings relating to your space.") }
diff --git a/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx b/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx index 2f80ad97a6..263823603b 100644 --- a/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx +++ b/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx @@ -137,7 +137,7 @@ const SpaceSettingsVisibilityTab = ({ matrixClient: cli, space }: IProps) => { } return
-
{_t("Visibility")}
+
{ _t("Visibility") }
{ error &&
{ error }
}