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:
parent
b61cc4850b
commit
7eaed1a3f8
11 changed files with 188 additions and 68 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue