Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/ts/c1

 Conflicts:
	src/components/structures/RoomDirectory.tsx
	src/components/views/room_settings/RoomPublishSetting.tsx
This commit is contained in:
Michael Telatynski 2021-07-12 18:58:18 +01:00
commit ae6eaa5acc
19 changed files with 223 additions and 97 deletions

View file

@ -15,12 +15,13 @@ limitations under the License.
*/
import React from "react";
import { Visibility } from "matrix-js-sdk/src/@types/partials";
import LabelledToggleSwitch from "../elements/LabelledToggleSwitch";
import { _t } from "../../../languageHandler";
import { MatrixClientPeg } from "../../../MatrixClientPeg";
import { replaceableComponent } from "../../../utils/replaceableComponent";
import { Visibility } from "matrix-js-sdk/src/@types/partials";
import DirectoryCustomisations from '../../../customisations/Directory';
interface IProps {
roomId: string;
@ -67,10 +68,15 @@ export default class RoomPublishSetting extends React.PureComponent<IProps, ISta
render() {
const client = MatrixClientPeg.get();
const enabled = (
DirectoryCustomisations.requireCanonicalAliasAccessToPublish?.() === false ||
this.props.canSetCanonicalAlias
);
return (
<LabelledToggleSwitch value={this.state.isRoomPublished}
onChange={this.onRoomPublishChange}
disabled={!this.props.canSetCanonicalAlias}
disabled={!enabled}
label={_t("Publish this room to the public in %(domain)s's room directory?", {
domain: client.getDomain(),
})}