Add option to stop sending read receipts (delabs MSC2285: private read receipts) (#8629)

Co-authored-by: Travis Ralston <travisr@matrix.org>
This commit is contained in:
Šimon Brandner 2022-08-05 17:33:57 +02:00 committed by GitHub
parent b61cc4850b
commit 7eaed1a3f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 188 additions and 68 deletions

View file

@ -33,6 +33,7 @@ interface IProps {
// XXX: once design replaces all toggles make this the default
useCheckbox?: boolean;
disabled?: boolean;
disabledDescription?: string;
hideIfCannotSet?: boolean;
onChange?(checked: boolean): void;
}
@ -84,6 +85,13 @@ export default class SettingsFlag extends React.Component<IProps, IState> {
: SettingsStore.getDisplayName(this.props.name, this.props.level);
const description = SettingsStore.getDescription(this.props.name);
let disabledDescription: JSX.Element;
if (this.props.disabled && this.props.disabledDescription) {
disabledDescription = <div className="mx_SettingsFlag_microcopy">
{ this.props.disabledDescription }
</div>;
}
if (this.props.useCheckbox) {
return <StyledCheckbox
checked={this.state.value}
@ -100,6 +108,7 @@ export default class SettingsFlag extends React.Component<IProps, IState> {
{ description && <div className="mx_SettingsFlag_microcopy">
{ description }
</div> }
{ disabledDescription }
</label>
<ToggleSwitch
checked={this.state.value}